class OCI::DataCatalog::Models::JobMetric

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.

Attributes

batch_key[RW]

Batch key for grouping, may be null. @return [String]

category[RW]

Category of this metric. @return [String]

created_by_id[RW]

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

@return [String]

description[RW]

Detailed description of the metric. @return [String]

display_name[RW]

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

@return [String]

job_execution_key[RW]

The unique key of the parent job execution for which the job metric resource is being created. @return [String]

key[RW]

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

sub_category[RW]

Sub category of this metric under the category. Used for aggregating values. May be null. @return [String]

time_created[RW]

The date and time the job metric was created, in the format defined by [RFC3339](tools.ietf.org/html/rfc3339). Example: `2019-03-25T21:10:29.600Z`

@return [DateTime]

time_inserted[RW]

The time the metric was logged or captured in the system where the job executed. An [RFC3339](tools.ietf.org/html/rfc3339) formatted datetime string.

@return [DateTime]

time_updated[RW]

The last time that this metric was updated. An [RFC3339](tools.ietf.org/html/rfc3339) formatted datetime string. @return [DateTime]

unit[RW]

Unit of this metric. @return [String]

updated_by_id[RW]

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

@return [String]

uri[RW]

URI to the job metric instance in the API. @return [String]

value[RW]

Value of this metric. @return [String]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/oci/data_catalog/models/job_metric.rb, line 82
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
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :key The value to assign to the {#key} property @option attributes [String] :description The value to assign to the {#description} property @option attributes [String] :job_execution_key The value to assign to the {#job_execution_key} property @option attributes [DateTime] :time_inserted The value to assign to the {#time_inserted} property @option attributes [String] :category The value to assign to the {#category} property @option attributes [String] :display_name The value to assign to the {#display_name} property @option attributes [String] :sub_category The value to assign to the {#sub_category} property @option attributes [String] :unit The value to assign to the {#unit} property @option attributes [String] :value The value to assign to the {#value} property @option attributes [String] :batch_key The value to assign to the {#batch_key} property @option attributes [String] :uri The value to assign to the {#uri} property @option attributes [DateTime] :time_created The value to assign to the {#time_created} property @option attributes [DateTime] :time_updated The value to assign to the {#time_updated} property @option attributes [String] :created_by_id The value to assign to the {#created_by_id} property @option attributes [String] :updated_by_id The value to assign to the {#updated_by_id} property

# File lib/oci/data_catalog/models/job_metric.rb, line 148
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
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/data_catalog/models/job_metric.rb, line 105
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

Public Instance Methods

==(other) click to toggle source

Checks equality by comparing each attribute. @param [Object] other the other object to be compared

# File lib/oci/data_catalog/models/job_metric.rb, line 228
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) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/oci/data_catalog/models/job_metric.rb, line 272
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) click to toggle source

@see the `==` method @param [Object] other the other object to be compared

# File lib/oci/data_catalog/models/job_metric.rb, line 252
def eql?(other)
  self == other
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/oci/data_catalog/models/job_metric.rb, line 261
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_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/oci/data_catalog/models/job_metric.rb, line 305
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() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/oci/data_catalog/models/job_metric.rb, line 299
def to_s
  to_hash.to_s
end

Private Instance Methods

_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/oci/data_catalog/models/job_metric.rb, line 322
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end