class OpenCensus::Stats::Measure

Measure

The definition of the Measurement. Describes the type of the individual values/measurements recorded by an application. It includes information such as the type of measurement, the units of measurement and descriptive names for the data. This provides th fundamental type used for recording data.

Constants

BYTE

Unit name for bytes @return [String]

DOUBLE_TYPE

Measure double type @return [String]

INT64_TYPE

Measure int64 type @return [String]

KBYTE

Unit name for Kilobytes @return [String]

MS

Unit name for Milli seconds @return [String]

NS

Unit name for Nano seconds @return [String]

SEC

Unit name for Seconds @return [String]

UNIT_NONE

Describes the unit used for the Measure. Should follows the format described by unitsofmeasure.org/ucum.html Unit name for general counts @return [String]

US

Unit name for Micro seconds @return [String]

Attributes

description[R]

@return [String]

name[R]

@return [String]

type[R]

Data type of the measure. @return [String] Valid types are {INT64_TYPE}, {DOUBLE_TYPE}.

unit[R]

Unit type of the measurement. i.e “kb”, “ms” etc @return [String]

Public Class Methods

new(name:, unit:, type:, description: nil) click to toggle source

@private Create instance of the measure.

# File lib/opencensus/stats/measure.rb, line 71
def initialize name:, unit:, type:, description: nil
  @name = name
  @unit = unit
  @type = type
  @description = description
end

Public Instance Methods

create_measurement(value:, tags: Measurement.new measure: self, value: value, tags: tags) click to toggle source

Create new measurement @param [Integer, Float] value @param [Hash<String,String>] tags Tags to which the value is recorded @return [Measurement]

# File lib/opencensus/stats/measure.rb, line 82
def create_measurement value:, tags:
  Measurement.new measure: self, value: value, tags: tags
end
double?() click to toggle source

Is float data type @return [Boolean]

# File lib/opencensus/stats/measure.rb, line 94
def double?
  type == DOUBLE_TYPE
end
int64?() click to toggle source

Is int64 data type @return [Boolean]

# File lib/opencensus/stats/measure.rb, line 88
def int64?
  type == INT64_TYPE
end