Class: GreekFire::Metric
- Inherits:
-
Struct
- Object
- Struct
- GreekFire::Metric
- Includes:
- ActiveModel::Conversion
- Defined in:
- app/models/greek_fire/metric.rb
Instance Attribute Summary collapse
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Attribute Details
#labels ⇒ Object
Returns the value of attribute labels
4 5 6 |
# File 'app/models/greek_fire/metric.rb', line 4 def labels @labels end |
#name ⇒ Object
Returns the value of attribute name
4 5 6 |
# File 'app/models/greek_fire/metric.rb', line 4 def name @name end |
#value ⇒ Object
Returns the value of attribute value
4 5 6 |
# File 'app/models/greek_fire/metric.rb', line 4 def value @value end |
Class Method Details
.clear_metrics ⇒ Object
22 23 24 25 |
# File 'app/models/greek_fire/metric.rb', line 22 def clear_metrics @registry.clear @dynamic_measures.clear end |
.metrics ⇒ Object
16 17 18 19 20 |
# File 'app/models/greek_fire/metric.rb', line 16 def metrics (@dynamic_measures.map do |stat| stat.call end + @registry).flatten.compact end |
.register(measurer = nil, &block) ⇒ Object
10 11 12 13 14 |
# File 'app/models/greek_fire/metric.rb', line 10 def register(measurer=nil, &block) @registry << measurer unless measurer.nil? @dynamic_measures << block if block_given? end |