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

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/monitoring_v3/classes.rb,
lib/google/apis/monitoring_v3/representations.rb,
lib/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

Constructor Details

#initialize(**args) ⇒ Metric

Returns a new instance of Metric.



2467
2468
2469
# File 'lib/google/apis/monitoring_v3/classes.rb', line 2467

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

Instance Attribute Details

#labelsHash<String,String>

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


2459
2460
2461
# File 'lib/google/apis/monitoring_v3/classes.rb', line 2459

def labels
  @labels
end

#typeString

An existing metric type, see google.api.MetricDescriptor. For example, custom. googleapis.com/invoice/paid/amount. Corresponds to the JSON property type

Returns:

  • (String)


2465
2466
2467
# File 'lib/google/apis/monitoring_v3/classes.rb', line 2465

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2472
2473
2474
2475
# File 'lib/google/apis/monitoring_v3/classes.rb', line 2472

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