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.
361 362 363 364 365 |
# File 'lib/datadog/core/telemetry/event.rb', line 361 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.
355 356 357 |
# File 'lib/datadog/core/telemetry/event.rb', line 355 def metric_series @metric_series end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
355 356 357 |
# File 'lib/datadog/core/telemetry/event.rb', line 355 def namespace @namespace end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
374 375 376 |
# File 'lib/datadog/core/telemetry/event.rb', line 374 def ==(other) other.is_a?(GenerateMetrics) && other.namespace == @namespace && other.metric_series == @metric_series end |
#hash ⇒ Object
380 381 382 |
# File 'lib/datadog/core/telemetry/event.rb', line 380 def hash [self.class, @namespace, @metric_series].hash end |
#payload ⇒ Object
367 368 369 370 371 372 |
# File 'lib/datadog/core/telemetry/event.rb', line 367 def payload { namespace: @namespace, series: @metric_series.map(&:to_h) } end |
#type ⇒ Object
357 358 359 |
# File 'lib/datadog/core/telemetry/event.rb', line 357 def type 'generate-metrics' end |