Class: Google::Apis::MonitoringV3::Metric

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/monitoring_v3/classes.rb,
generated/google/apis/monitoring_v3/representations.rb,
generated/google/apis/monitoring_v3/representations.rb

Overview

A specific metric identified by specifying values for all of the labels of a MetricDescriptor.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Metric

Returns a new instance of Metric.



42
43
44
# File 'generated/google/apis/monitoring_v3/classes.rb', line 42

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#labelsHash<String,String>

The set of labels that uniquely identify a metric. To specify a metric, all labels enumerated in the MetricDescriptor must be assigned values. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


34
35
36
# File 'generated/google/apis/monitoring_v3/classes.rb', line 34

def labels
  @labels
end

#typeString

An existing metric type, see google.api.MetricDescriptor. For example, compute. googleapis.com/instance/cpu/usage_time. Corresponds to the JSON property type

Returns:

  • (String)


40
41
42
# File 'generated/google/apis/monitoring_v3/classes.rb', line 40

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



47
48
49
50
# File 'generated/google/apis/monitoring_v3/classes.rb', line 47

def update!(**args)
  @labels = args[:labels] if args.key?(:labels)
  @type = args[:type] if args.key?(:type)
end