Class: Datadog::Core::Telemetry::Metric::Gauge
- Inherits:
-
IntervalMetric
- Object
- Base
- IntervalMetric
- Datadog::Core::Telemetry::Metric::Gauge
- Defined in:
- lib/datadog/core/telemetry/metric.rb
Overview
A gauge type takes the last value reported during the interval. This type would make sense for tracking RAM or CPU usage, where taking the last value provides a representative picture of the host’s behavior during the time interval.
Constant Summary collapse
- TYPE =
'gauge'
Instance Attribute Summary
Attributes inherited from IntervalMetric
Attributes inherited from Base
#common, #name, #tags, #values
Instance Method Summary collapse
Methods inherited from IntervalMetric
Methods inherited from Base
Constructor Details
This class inherits a constructor from Datadog::Core::Telemetry::Metric::IntervalMetric
Instance Method Details
#track(value) ⇒ Object
108 109 110 111 112 113 114 115 116 |
# File 'lib/datadog/core/telemetry/metric.rb', line 108 def track(value) if values.empty? values << [Time.now.to_i, value] else values[0][0] = Time.now.to_i values[0][1] = value end nil end |
#type ⇒ Object
104 105 106 |
# File 'lib/datadog/core/telemetry/metric.rb', line 104 def type TYPE end |