Class: OCI::Opsi::Models::HostMemoryStatistics
- Inherits:
-
HostResourceStatistics
- Object
- HostResourceStatistics
- OCI::Opsi::Models::HostMemoryStatistics
- Defined in:
- lib/oci/opsi/models/host_memory_statistics.rb
Overview
Contains memory statistics.
Constant Summary
Constants inherited from HostResourceStatistics
OCI::Opsi::Models::HostResourceStatistics::RESOURCE_NAME_ENUM
Instance Attribute Summary collapse
- #available_memory ⇒ Float
- #free_memory ⇒ Float
-
#huge_page_size_in_mb ⇒ Float
Size of huge pages in megabytes.
-
#huge_pages_free ⇒ Integer
Total number of available huge pages.
-
#huge_pages_reserved ⇒ Integer
Total number of huge pages which are used or reserved.
-
#huge_pages_total ⇒ Integer
Total number of huge pages.
- #load ⇒ OCI::Opsi::Models::SummaryStatistics
Attributes inherited from HostResourceStatistics
#capacity, #resource_name, #usage, #usage_change_percent, #utilization_percent
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ HostMemoryStatistics
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Methods inherited from HostResourceStatistics
Constructor Details
#initialize(attributes = {}) ⇒ HostMemoryStatistics
Initializes the object
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 98 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['resourceName'] = 'HOST_MEMORY_STATISTICS' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.free_memory = attributes[:'freeMemory'] if attributes[:'freeMemory'] raise 'You cannot provide both :freeMemory and :free_memory' if attributes.key?(:'freeMemory') && attributes.key?(:'free_memory') self.free_memory = attributes[:'free_memory'] if attributes[:'free_memory'] self.available_memory = attributes[:'availableMemory'] if attributes[:'availableMemory'] raise 'You cannot provide both :availableMemory and :available_memory' if attributes.key?(:'availableMemory') && attributes.key?(:'available_memory') self.available_memory = attributes[:'available_memory'] if attributes[:'available_memory'] self.huge_pages_total = attributes[:'hugePagesTotal'] if attributes[:'hugePagesTotal'] raise 'You cannot provide both :hugePagesTotal and :huge_pages_total' if attributes.key?(:'hugePagesTotal') && attributes.key?(:'huge_pages_total') self.huge_pages_total = attributes[:'huge_pages_total'] if attributes[:'huge_pages_total'] self.huge_page_size_in_mb = attributes[:'hugePageSizeInMB'] if attributes[:'hugePageSizeInMB'] raise 'You cannot provide both :hugePageSizeInMB and :huge_page_size_in_mb' if attributes.key?(:'hugePageSizeInMB') && attributes.key?(:'huge_page_size_in_mb') self.huge_page_size_in_mb = attributes[:'huge_page_size_in_mb'] if attributes[:'huge_page_size_in_mb'] self.huge_pages_free = attributes[:'hugePagesFree'] if attributes[:'hugePagesFree'] raise 'You cannot provide both :hugePagesFree and :huge_pages_free' if attributes.key?(:'hugePagesFree') && attributes.key?(:'huge_pages_free') self.huge_pages_free = attributes[:'huge_pages_free'] if attributes[:'huge_pages_free'] self.huge_pages_reserved = attributes[:'hugePagesReserved'] if attributes[:'hugePagesReserved'] raise 'You cannot provide both :hugePagesReserved and :huge_pages_reserved' if attributes.key?(:'hugePagesReserved') && attributes.key?(:'huge_pages_reserved') self.huge_pages_reserved = attributes[:'huge_pages_reserved'] if attributes[:'huge_pages_reserved'] self.load = attributes[:'load'] if attributes[:'load'] end |
Instance Attribute Details
#available_memory ⇒ Float
16 17 18 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 16 def available_memory @available_memory end |
#free_memory ⇒ Float
13 14 15 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 13 def free_memory @free_memory end |
#huge_page_size_in_mb ⇒ Float
Size of huge pages in megabytes.
26 27 28 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 26 def huge_page_size_in_mb @huge_page_size_in_mb end |
#huge_pages_free ⇒ Integer
Total number of available huge pages.
31 32 33 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 31 def huge_pages_free @huge_pages_free end |
#huge_pages_reserved ⇒ Integer
Total number of huge pages which are used or reserved.
36 37 38 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 36 def huge_pages_reserved @huge_pages_reserved end |
#huge_pages_total ⇒ Integer
Total number of huge pages.
21 22 23 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 21 def huge_pages_total @huge_pages_total end |
#load ⇒ OCI::Opsi::Models::SummaryStatistics
39 40 41 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 39 def load @load end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 42 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'usage': :'usage', 'capacity': :'capacity', 'utilization_percent': :'utilizationPercent', 'usage_change_percent': :'usageChangePercent', 'resource_name': :'resourceName', 'free_memory': :'freeMemory', 'available_memory': :'availableMemory', 'huge_pages_total': :'hugePagesTotal', 'huge_page_size_in_mb': :'hugePageSizeInMB', 'huge_pages_free': :'hugePagesFree', 'huge_pages_reserved': :'hugePagesReserved', 'load': :'load' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 62 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'usage': :'Float', 'capacity': :'Float', 'utilization_percent': :'Float', 'usage_change_percent': :'Float', 'resource_name': :'String', 'free_memory': :'Float', 'available_memory': :'Float', 'huge_pages_total': :'Integer', 'huge_page_size_in_mb': :'Float', 'huge_pages_free': :'Integer', 'huge_pages_reserved': :'Integer', 'load': :'OCI::Opsi::Models::SummaryStatistics' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 154 def ==(other) return true if equal?(other) self.class == other.class && usage == other.usage && capacity == other.capacity && utilization_percent == other.utilization_percent && usage_change_percent == other.usage_change_percent && resource_name == other.resource_name && free_memory == other.free_memory && available_memory == other.available_memory && huge_pages_total == other.huge_pages_total && huge_page_size_in_mb == other.huge_page_size_in_mb && huge_pages_free == other.huge_pages_free && huge_pages_reserved == other.huge_pages_reserved && load == other.load end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 195 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
175 176 177 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 175 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
184 185 186 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 184 def hash [usage, capacity, utilization_percent, usage_change_percent, resource_name, free_memory, available_memory, huge_pages_total, huge_page_size_in_mb, huge_pages_free, huge_pages_reserved, load].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
228 229 230 231 232 233 234 235 236 237 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 228 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
222 223 224 |
# File 'lib/oci/opsi/models/host_memory_statistics.rb', line 222 def to_s to_hash.to_s end |