Class: OpenCensus::Stats::Exemplar
- Inherits:
-
Object
- Object
- OpenCensus::Stats::Exemplar
- Defined in:
- lib/opencensus/stats/exemplar.rb
Overview
Exemplars are example points that may be used to annotate aggregated Distribution values. They are metadata that gives information about a particular value added to a Distribution bucket.
Instance Attribute Summary collapse
-
#attachments ⇒ Hash<String,String>
readonly
Contextual information about the example value.
-
#time ⇒ Time
readonly
The observation (sampling) time of the above value.
-
#value ⇒ Integer, Float
readonly
Value of the exemplar point.
Instance Method Summary collapse
-
#initialize(value:, time:, attachments:) ⇒ Exemplar
constructor
Create instance of the exemplar.
Constructor Details
#initialize(value:, time:, attachments:) ⇒ Exemplar
Create instance of the exemplar
30 31 32 33 34 35 36 37 |
# File 'lib/opencensus/stats/exemplar.rb', line 30 def initialize value:, time:, attachments: @value = value @time = time raise ArgumentError, "attachments can not be empty" if .nil? @attachments = end |
Instance Attribute Details
#attachments ⇒ Hash<String,String> (readonly)
Contextual information about the example value
23 24 25 |
# File 'lib/opencensus/stats/exemplar.rb', line 23 def @attachments end |
#time ⇒ Time (readonly)
The observation (sampling) time of the above value
19 20 21 |
# File 'lib/opencensus/stats/exemplar.rb', line 19 def time @time end |
#value ⇒ Integer, Float (readonly)
Value of the exemplar point. It determines which bucket the exemplar belongs to
15 16 17 |
# File 'lib/opencensus/stats/exemplar.rb', line 15 def value @value end |