Class: Tracekit::Metrics::MetricDataPoint
- Inherits:
-
Object
- Object
- Tracekit::Metrics::MetricDataPoint
- Defined in:
- lib/tracekit/metrics/metric_data_point.rb
Overview
Represents a single metric data point for export
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#timestamp_nanos ⇒ Object
readonly
Returns the value of attribute timestamp_nanos.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name:, type:, value:, tags:) ⇒ MetricDataPoint
constructor
A new instance of MetricDataPoint.
Constructor Details
#initialize(name:, type:, value:, tags:) ⇒ MetricDataPoint
Returns a new instance of MetricDataPoint.
9 10 11 12 13 14 15 |
# File 'lib/tracekit/metrics/metric_data_point.rb', line 9 def initialize(name:, type:, value:, tags:) @name = name @type = type # "counter", "gauge", "histogram" @value = value @tags = @timestamp_nanos = (Time.now.to_f * 1_000_000_000).to_i end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/tracekit/metrics/metric_data_point.rb', line 7 def name @name end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
7 8 9 |
# File 'lib/tracekit/metrics/metric_data_point.rb', line 7 def @tags end |
#timestamp_nanos ⇒ Object (readonly)
Returns the value of attribute timestamp_nanos.
7 8 9 |
# File 'lib/tracekit/metrics/metric_data_point.rb', line 7 def @timestamp_nanos end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/tracekit/metrics/metric_data_point.rb', line 7 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/tracekit/metrics/metric_data_point.rb', line 7 def value @value end |