Class: OpenCensus::Stats::Measurement

Inherits:
Object
  • Object
show all
Defined in:
lib/opencensus/stats/measurement.rb

Overview

Measurement

Describes a data point to be collected for a Measure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(measure:, value:, tags:) ⇒ Measurement

Create a instance of measurement

Parameters:

  • measure (Measure)

    A measure to which the value is applied.

  • value (Integer, Float)

    Measurement value.

  • tags (Hash<String,String>)

    The tags to which the value is applied



27
28
29
30
31
32
# File 'lib/opencensus/stats/measurement.rb', line 27

def initialize measure:, value:, tags:
  @measure = measure
  @value = value
  @tags = Tags::TagMap.new tags
  @time = Time.now.utc
end

Instance Attribute Details

#measureMeasure (readonly)

Returns A measure to which the value is applied.

Returns:

  • (Measure)

    A measure to which the value is applied.



11
12
13
# File 'lib/opencensus/stats/measurement.rb', line 11

def measure
  @measure
end

#tagsTagMap (readonly)

Returns The tags to which the value is applied.

Returns:

  • (TagMap)

    The tags to which the value is applied



17
18
19
# File 'lib/opencensus/stats/measurement.rb', line 17

def tags
  @tags
end

#timeTime (readonly)

Returns The time when measurement was created.

Returns:

  • (Time)

    The time when measurement was created.



20
21
22
# File 'lib/opencensus/stats/measurement.rb', line 20

def time
  @time
end

#valueInteger, Float (readonly)

Returns The recorded value.

Returns:

  • (Integer, Float)

    The recorded value



14
15
16
# File 'lib/opencensus/stats/measurement.rb', line 14

def value
  @value
end