Class: Metrics::Metric
- Inherits:
-
Object
- Object
- Metrics::Metric
- Defined in:
- lib/metrics/metric.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Instance Method Summary collapse
- #emit(value, tags: nil, sample_rate: 1.0) ⇒ Object
-
#initialize(name, type, description, unit) ⇒ Metric
constructor
A new instance of Metric.
Constructor Details
#initialize(name, type, description, unit) ⇒ Metric
Returns a new instance of Metric.
25 26 27 28 29 30 |
# File 'lib/metrics/metric.rb', line 25 def initialize(name, type, description, unit) @name = name @type = type @description = description @unit = unit end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
34 35 36 |
# File 'lib/metrics/metric.rb', line 34 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
32 33 34 |
# File 'lib/metrics/metric.rb', line 32 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
33 34 35 |
# File 'lib/metrics/metric.rb', line 33 def type @type end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
35 36 37 |
# File 'lib/metrics/metric.rb', line 35 def unit @unit end |
Instance Method Details
#emit(value, tags: nil, sample_rate: 1.0) ⇒ Object
37 38 39 |
# File 'lib/metrics/metric.rb', line 37 def emit(value, tags: nil, sample_rate: 1.0) raise NotImplementedError end |