Method: OpenCensus::Stats::Exemplar#initialize

Defined in:
lib/opencensus/stats/exemplar.rb

#initialize(value:, time:, attachments:) ⇒ Exemplar

Create instance of the exemplar

Parameters:

  • value (Integer, Float)
  • time (Time)
  • attachments. (Hash<String,String>)

    Attachments are key-value pairs that describe the context in which the exemplar was recored.

Raises:

  • (ArgumentError)


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 attachments.nil?

  @attachments = attachments
end