Class: OpenCensus::Stats::Measure
- Inherits:
-
Object
- Object
- OpenCensus::Stats::Measure
- Defined in:
- lib/opencensus/stats/measure.rb
Overview
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.
Constant Summary collapse
- UNIT_NONE =
Describes the unit used for the Measure. Should follows the format described by http://unitsofmeasure.org/ucum.html Unit name for general counts
"1".freeze
- BYTE =
Unit name for bytes
"By".freeze
- KBYTE =
Unit name for Kilobytes
"kb".freeze
- SEC =
Unit name for Seconds
"s".freeze
- MS =
Unit name for Milli seconds
"ms".freeze
- US =
Unit name for Micro seconds
"us".freeze
- NS =
Unit name for Nano seconds
"ns".freeze
- INT64_TYPE =
Measure int64 type
"INT64".freeze
- DOUBLE_TYPE =
Measure double type
"DOUBLE".freeze
Instance Attribute Summary collapse
- #description ⇒ String readonly
- #name ⇒ String readonly
-
#type ⇒ String
readonly
Data type of the measure.
-
#unit ⇒ String
readonly
Unit type of the measurement.
Instance Method Summary collapse
-
#create_measurement(value:, tags:) ⇒ Measurement
Create new measurement.
-
#double? ⇒ Boolean
Is float data type.
-
#int64? ⇒ Boolean
Is int64 data type.
Instance Attribute Details
#description ⇒ String (readonly)
59 60 61 |
# File 'lib/opencensus/stats/measure.rb', line 59 def description @description end |
#name ⇒ String (readonly)
56 57 58 |
# File 'lib/opencensus/stats/measure.rb', line 56 def name @name end |
#type ⇒ String (readonly)
Data type of the measure.
67 68 69 |
# File 'lib/opencensus/stats/measure.rb', line 67 def type @type end |
#unit ⇒ String (readonly)
Unit type of the measurement. i.e "kb", "ms" etc
63 64 65 |
# File 'lib/opencensus/stats/measure.rb', line 63 def unit @unit end |
Instance Method Details
#create_measurement(value:, tags:) ⇒ Measurement
Create new measurement
82 83 84 |
# File 'lib/opencensus/stats/measure.rb', line 82 def create_measurement value:, tags: Measurement.new measure: self, value: value, tags: end |
#double? ⇒ Boolean
Is float data type
94 95 96 |
# File 'lib/opencensus/stats/measure.rb', line 94 def double? type == DOUBLE_TYPE end |
#int64? ⇒ Boolean
Is int64 data type
88 89 90 |
# File 'lib/opencensus/stats/measure.rb', line 88 def int64? type == INT64_TYPE end |