Class: Datadog::Core::Telemetry::Event::GenerateMetrics Private

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/core/telemetry/event/generate_metrics.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Telemetry class for the ‘generate-metrics’ event

Direct Known Subclasses

Distributions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace, metric_series) ⇒ GenerateMetrics

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of GenerateMetrics.



17
18
19
20
21
# File 'lib/datadog/core/telemetry/event/generate_metrics.rb', line 17

def initialize(namespace, metric_series)
  super()
  @namespace = namespace
  @metric_series = metric_series
end

Instance Attribute Details

#metric_seriesObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/datadog/core/telemetry/event/generate_metrics.rb', line 11

def metric_series
  @metric_series
end

#namespaceObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/datadog/core/telemetry/event/generate_metrics.rb', line 11

def namespace
  @namespace
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



30
31
32
# File 'lib/datadog/core/telemetry/event/generate_metrics.rb', line 30

def ==(other)
  other.is_a?(GenerateMetrics) && other.namespace == @namespace && other.metric_series == @metric_series
end

#hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



36
37
38
# File 'lib/datadog/core/telemetry/event/generate_metrics.rb', line 36

def hash
  [self.class, @namespace, @metric_series].hash
end

#payloadObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
26
27
28
# File 'lib/datadog/core/telemetry/event/generate_metrics.rb', line 23

def payload
  {
    namespace: @namespace,
    series: @metric_series.map(&:to_h)
  }
end

#typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



13
14
15
# File 'lib/datadog/core/telemetry/event/generate_metrics.rb', line 13

def type
  'generate-metrics'
end