Class: OCI::Nosql::Models::TableUsageSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/nosql/models/table_usage_summary.rb

Overview

TableUsageSummary represents a single usage record, or slice, that includes information about read and write throughput consumed during that period as well as the current information regarding storage capacity. In addition the count of throttling exceptions for the period is reported.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TableUsageSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :seconds_in_period (Integer)

    The value to assign to the #seconds_in_period property

  • :read_units (Integer)

    The value to assign to the #read_units property

  • :write_units (Integer)

    The value to assign to the #write_units property

  • :storage_in_g_bs (Integer)

    The value to assign to the #storage_in_g_bs property

  • :read_throttle_count (Integer)

    The value to assign to the #read_throttle_count property

  • :write_throttle_count (Integer)

    The value to assign to the #write_throttle_count property

  • :storage_throttle_count (Integer)

    The value to assign to the #storage_throttle_count property



91
92
93
94
95
96
97
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
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 91

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.seconds_in_period = attributes[:'secondsInPeriod'] if attributes[:'secondsInPeriod']

  raise 'You cannot provide both :secondsInPeriod and :seconds_in_period' if attributes.key?(:'secondsInPeriod') && attributes.key?(:'seconds_in_period')

  self.seconds_in_period = attributes[:'seconds_in_period'] if attributes[:'seconds_in_period']

  self.read_units = attributes[:'readUnits'] if attributes[:'readUnits']

  raise 'You cannot provide both :readUnits and :read_units' if attributes.key?(:'readUnits') && attributes.key?(:'read_units')

  self.read_units = attributes[:'read_units'] if attributes[:'read_units']

  self.write_units = attributes[:'writeUnits'] if attributes[:'writeUnits']

  raise 'You cannot provide both :writeUnits and :write_units' if attributes.key?(:'writeUnits') && attributes.key?(:'write_units')

  self.write_units = attributes[:'write_units'] if attributes[:'write_units']

  self.storage_in_g_bs = attributes[:'storageInGBs'] if attributes[:'storageInGBs']

  raise 'You cannot provide both :storageInGBs and :storage_in_g_bs' if attributes.key?(:'storageInGBs') && attributes.key?(:'storage_in_g_bs')

  self.storage_in_g_bs = attributes[:'storage_in_g_bs'] if attributes[:'storage_in_g_bs']

  self.read_throttle_count = attributes[:'readThrottleCount'] if attributes[:'readThrottleCount']

  raise 'You cannot provide both :readThrottleCount and :read_throttle_count' if attributes.key?(:'readThrottleCount') && attributes.key?(:'read_throttle_count')

  self.read_throttle_count = attributes[:'read_throttle_count'] if attributes[:'read_throttle_count']

  self.write_throttle_count = attributes[:'writeThrottleCount'] if attributes[:'writeThrottleCount']

  raise 'You cannot provide both :writeThrottleCount and :write_throttle_count' if attributes.key?(:'writeThrottleCount') && attributes.key?(:'write_throttle_count')

  self.write_throttle_count = attributes[:'write_throttle_count'] if attributes[:'write_throttle_count']

  self.storage_throttle_count = attributes[:'storageThrottleCount'] if attributes[:'storageThrottleCount']

  raise 'You cannot provide both :storageThrottleCount and :storage_throttle_count' if attributes.key?(:'storageThrottleCount') && attributes.key?(:'storage_throttle_count')

  self.storage_throttle_count = attributes[:'storage_throttle_count'] if attributes[:'storage_throttle_count']
end

Instance Attribute Details

#read_throttle_countInteger

The number of times reads were throttled due to exceeding the read throughput limit.

Returns:

  • (Integer)


34
35
36
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 34

def read_throttle_count
  @read_throttle_count
end

#read_unitsInteger

Read throughput during the sampling period.

Returns:

  • (Integer)


20
21
22
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 20

def read_units
  @read_units
end

#seconds_in_periodInteger

The length of the sampling period.

Returns:

  • (Integer)


16
17
18
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 16

def seconds_in_period
  @seconds_in_period
end

#storage_in_g_bsInteger

The size of the table, in GB.

Returns:

  • (Integer)


28
29
30
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 28

def storage_in_g_bs
  @storage_in_g_bs
end

#storage_throttle_countInteger

The number of times writes were throttled because the table exceeded its size limit.

Returns:

  • (Integer)


46
47
48
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 46

def storage_throttle_count
  @storage_throttle_count
end

#write_throttle_countInteger

The number of times writes were throttled due to exceeding the write throughput limit.

Returns:

  • (Integer)


40
41
42
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 40

def write_throttle_count
  @write_throttle_count
end

#write_unitsInteger

Write throughput during the sampling period.

Returns:

  • (Integer)


24
25
26
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 24

def write_units
  @write_units
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 49

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'seconds_in_period': :'secondsInPeriod',
    'read_units': :'readUnits',
    'write_units': :'writeUnits',
    'storage_in_g_bs': :'storageInGBs',
    'read_throttle_count': :'readThrottleCount',
    'write_throttle_count': :'writeThrottleCount',
    'storage_throttle_count': :'storageThrottleCount'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 64

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'seconds_in_period': :'Integer',
    'read_units': :'Integer',
    'write_units': :'Integer',
    'storage_in_g_bs': :'Integer',
    'read_throttle_count': :'Integer',
    'write_throttle_count': :'Integer',
    'storage_throttle_count': :'Integer'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 147

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    seconds_in_period == other.seconds_in_period &&
    read_units == other.read_units &&
    write_units == other.write_units &&
    storage_in_g_bs == other.storage_in_g_bs &&
    read_throttle_count == other.read_throttle_count &&
    write_throttle_count == other.write_throttle_count &&
    storage_throttle_count == other.storage_throttle_count
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 183

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


163
164
165
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 163

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



172
173
174
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 172

def hash
  [seconds_in_period, read_units, write_units, storage_in_g_bs, read_throttle_count, write_throttle_count, storage_throttle_count].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



216
217
218
219
220
221
222
223
224
225
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 216

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



210
211
212
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 210

def to_s
  to_hash.to_s
end