Class: OCI::DataCatalog::Models::JobMetric

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_catalog/models/job_metric.rb

Overview

A set of metrics are collected periodically to assess the state and performance characteristics of the execution instance of a job. The metrics are grouped based on their category and sub categories and aggregated based on their batch information.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ JobMetric

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :key (String)

    The value to assign to the #key property

  • :description (String)

    The value to assign to the #description property

  • :job_execution_key (String)

    The value to assign to the #job_execution_key property

  • :time_inserted (DateTime)

    The value to assign to the #time_inserted property

  • :category (String)

    The value to assign to the #category property

  • :display_name (String)

    The value to assign to the #display_name property

  • :sub_category (String)

    The value to assign to the #sub_category property

  • :unit (String)

    The value to assign to the #unit property

  • :value (String)

    The value to assign to the #value property

  • :batch_key (String)

    The value to assign to the #batch_key property

  • :uri (String)

    The value to assign to the #uri property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :created_by_id (String)

    The value to assign to the #created_by_id property

  • :updated_by_id (String)

    The value to assign to the #updated_by_id property



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/oci/data_catalog/models/job_metric.rb', line 149

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.key = attributes[:'key'] if attributes[:'key']

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

  self.job_execution_key = attributes[:'jobExecutionKey'] if attributes[:'jobExecutionKey']

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

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

  self.time_inserted = attributes[:'timeInserted'] if attributes[:'timeInserted']

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

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.sub_category = attributes[:'subCategory'] if attributes[:'subCategory']

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

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

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

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

  self.batch_key = attributes[:'batchKey'] if attributes[:'batchKey']

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

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.created_by_id = attributes[:'createdById'] if attributes[:'createdById']

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

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

  self.updated_by_id = attributes[:'updatedById'] if attributes[:'updatedById']

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

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

Instance Attribute Details

#batch_keyString

Batch key for grouping, may be null.

Returns:

  • (String)


56
57
58
# File 'lib/oci/data_catalog/models/job_metric.rb', line 56

def batch_key
  @batch_key
end

#categoryString

Category of this metric.

Returns:

  • (String)


34
35
36
# File 'lib/oci/data_catalog/models/job_metric.rb', line 34

def category
  @category
end

#created_by_idString

OCID of the user who created the metric for this job. Usually the executor of the job instance.

Returns:

  • (String)


75
76
77
# File 'lib/oci/data_catalog/models/job_metric.rb', line 75

def created_by_id
  @created_by_id
end

#descriptionString

Detailed description of the metric.

Returns:

  • (String)


20
21
22
# File 'lib/oci/data_catalog/models/job_metric.rb', line 20

def description
  @description
end

#display_nameString

A user-friendly display name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


40
41
42
# File 'lib/oci/data_catalog/models/job_metric.rb', line 40

def display_name
  @display_name
end

#job_execution_keyString

The unique key of the parent job execution for which the job metric resource is being created.

Returns:

  • (String)


24
25
26
# File 'lib/oci/data_catalog/models/job_metric.rb', line 24

def job_execution_key
  @job_execution_key
end

#keyString

[Required] Key of the job metric that is immutable.

Returns:

  • (String)


16
17
18
# File 'lib/oci/data_catalog/models/job_metric.rb', line 16

def key
  @key
end

#sub_categoryString

Sub category of this metric under the category. Used for aggregating values. May be null.

Returns:

  • (String)


44
45
46
# File 'lib/oci/data_catalog/models/job_metric.rb', line 44

def sub_category
  @sub_category
end

#time_createdDateTime

The date and time the job metric was created, in the format defined by RFC3339. Example: 2019-03-25T21:10:29.600Z

Returns:

  • (DateTime)


66
67
68
# File 'lib/oci/data_catalog/models/job_metric.rb', line 66

def time_created
  @time_created
end

#time_insertedDateTime

The time the metric was logged or captured in the system where the job executed. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


30
31
32
# File 'lib/oci/data_catalog/models/job_metric.rb', line 30

def time_inserted
  @time_inserted
end

#time_updatedDateTime

The last time that this metric was updated. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


70
71
72
# File 'lib/oci/data_catalog/models/job_metric.rb', line 70

def time_updated
  @time_updated
end

#unitString

Unit of this metric.

Returns:

  • (String)


48
49
50
# File 'lib/oci/data_catalog/models/job_metric.rb', line 48

def unit
  @unit
end

#updated_by_idString

OCID of the user who created the metric for this job. Usually the executor of the job instance.

Returns:

  • (String)


80
81
82
# File 'lib/oci/data_catalog/models/job_metric.rb', line 80

def updated_by_id
  @updated_by_id
end

#uriString

URI to the job metric instance in the API.

Returns:

  • (String)


60
61
62
# File 'lib/oci/data_catalog/models/job_metric.rb', line 60

def uri
  @uri
end

#valueString

Value of this metric.

Returns:

  • (String)


52
53
54
# File 'lib/oci/data_catalog/models/job_metric.rb', line 52

def value
  @value
end

Class Method Details

.attribute_mapObject

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



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/oci/data_catalog/models/job_metric.rb', line 83

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'description': :'description',
    'job_execution_key': :'jobExecutionKey',
    'time_inserted': :'timeInserted',
    'category': :'category',
    'display_name': :'displayName',
    'sub_category': :'subCategory',
    'unit': :'unit',
    'value': :'value',
    'batch_key': :'batchKey',
    'uri': :'uri',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'created_by_id': :'createdById',
    'updated_by_id': :'updatedById'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/oci/data_catalog/models/job_metric.rb', line 106

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'description': :'String',
    'job_execution_key': :'String',
    'time_inserted': :'DateTime',
    'category': :'String',
    'display_name': :'String',
    'sub_category': :'String',
    'unit': :'String',
    'value': :'String',
    'batch_key': :'String',
    'uri': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'created_by_id': :'String',
    'updated_by_id': :'String'
    # 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



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/oci/data_catalog/models/job_metric.rb', line 229

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

  self.class == other.class &&
    key == other.key &&
    description == other.description &&
    job_execution_key == other.job_execution_key &&
    time_inserted == other.time_inserted &&
    category == other.category &&
    display_name == other.display_name &&
    sub_category == other.sub_category &&
    unit == other.unit &&
    value == other.value &&
    batch_key == other.batch_key &&
    uri == other.uri &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    created_by_id == other.created_by_id &&
    updated_by_id == other.updated_by_id
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



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/oci/data_catalog/models/job_metric.rb', line 273

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


253
254
255
# File 'lib/oci/data_catalog/models/job_metric.rb', line 253

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



262
263
264
# File 'lib/oci/data_catalog/models/job_metric.rb', line 262

def hash
  [key, description, job_execution_key, time_inserted, category, display_name, sub_category, unit, value, batch_key, uri, time_created, time_updated, created_by_id, updated_by_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



306
307
308
309
310
311
312
313
314
315
# File 'lib/oci/data_catalog/models/job_metric.rb', line 306

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



300
301
302
# File 'lib/oci/data_catalog/models/job_metric.rb', line 300

def to_s
  to_hash.to_s
end