Class: Datadog::Core::Telemetry::Event::GenerateMetrics
- Defined in:
- lib/datadog/core/telemetry/event.rb
Overview
Telemetry class for the ‘generate-metrics’ event
Direct Known Subclasses
Instance Attribute Summary collapse
-
#metric_series ⇒ Object
readonly
Returns the value of attribute metric_series.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(namespace, metric_series) ⇒ GenerateMetrics
constructor
A new instance of GenerateMetrics.
- #payload ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(namespace, metric_series) ⇒ GenerateMetrics
Returns a new instance of GenerateMetrics.
364 365 366 367 368 |
# File 'lib/datadog/core/telemetry/event.rb', line 364 def initialize(namespace, metric_series) super() @namespace = namespace @metric_series = metric_series end |
Instance Attribute Details
#metric_series ⇒ Object (readonly)
Returns the value of attribute metric_series.
358 359 360 |
# File 'lib/datadog/core/telemetry/event.rb', line 358 def metric_series @metric_series end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
358 359 360 |
# File 'lib/datadog/core/telemetry/event.rb', line 358 def namespace @namespace end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
377 378 379 |
# File 'lib/datadog/core/telemetry/event.rb', line 377 def ==(other) other.is_a?(GenerateMetrics) && other.namespace == @namespace && other.metric_series == @metric_series end |
#hash ⇒ Object
383 384 385 |
# File 'lib/datadog/core/telemetry/event.rb', line 383 def hash [self.class, @namespace, @metric_series].hash end |
#payload ⇒ Object
370 371 372 373 374 375 |
# File 'lib/datadog/core/telemetry/event.rb', line 370 def payload { namespace: @namespace, series: @metric_series.map(&:to_h) } end |
#type ⇒ Object
360 361 362 |
# File 'lib/datadog/core/telemetry/event.rb', line 360 def type 'generate-metrics' end |