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):



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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 108

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']

  self.max_shard_size_usage_in_percent = attributes[:'maxShardSizeUsageInPercent'] if attributes[:'maxShardSizeUsageInPercent']

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

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

  self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']

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

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

Instance Attribute Details

#max_shard_size_usage_in_percentInteger

The percentage of allowed per-shard usage for the table shard with the highest usage.

Returns:

  • (Integer)


52
53
54
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 52

def max_shard_size_usage_in_percent
  @max_shard_size_usage_in_percent
end

#read_throttle_countInteger

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

Returns:

  • (Integer)


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

def read_throttle_count
  @read_throttle_count
end

#read_unitsInteger

Read throughput during the sampling period.

Returns:

  • (Integer)


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

def read_units
  @read_units
end

#seconds_in_periodInteger

The length of the sampling period.

Returns:

  • (Integer)


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

def seconds_in_period
  @seconds_in_period
end

#storage_in_g_bsInteger

The size of the table, in GB.

Returns:

  • (Integer)


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

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)


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

def storage_throttle_count
  @storage_throttle_count
end

#time_startedDateTime

The time stamp of this usage record.

Returns:

  • (DateTime)


57
58
59
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 57

def time_started
  @time_started
end

#write_throttle_countInteger

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

Returns:

  • (Integer)


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

def write_throttle_count
  @write_throttle_count
end

#write_unitsInteger

Write throughput during the sampling period.

Returns:

  • (Integer)


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

def write_units
  @write_units
end

Class Method Details

.attribute_mapObject

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



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

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',
    'max_shard_size_usage_in_percent': :'maxShardSizeUsageInPercent',
    'time_started': :'timeStarted'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 77

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',
    'max_shard_size_usage_in_percent': :'Integer',
    'time_started': :'DateTime'
    # 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



176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 176

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 &&
    max_shard_size_usage_in_percent == other.max_shard_size_usage_in_percent &&
    time_started == other.time_started
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



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 214

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


194
195
196
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 194

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



203
204
205
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 203

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



247
248
249
250
251
252
253
254
255
256
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 247

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



241
242
243
# File 'lib/oci/nosql/models/table_usage_summary.rb', line 241

def to_s
  to_hash.to_s
end