Class: Prometheus::Client::Summary::Value
- Inherits:
-
Hash
- Object
- Hash
- Prometheus::Client::Summary::Value
- Includes:
- UsesValueType
- Defined in:
- lib/prometheus/client/summary.rb
Overview
Value represents the state of a Summary at a given point.
Instance Attribute Summary collapse
-
#sum ⇒ Object
Returns the value of attribute sum.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(type, name, labels) ⇒ Value
constructor
A new instance of Value.
- #observe(value) ⇒ Object
Methods included from UsesValueType
Constructor Details
#initialize(type, name, labels) ⇒ Value
Returns a new instance of Value.
16 17 18 19 |
# File 'lib/prometheus/client/summary.rb', line 16 def initialize(type, name, labels) @sum = value_object(type, name, "#{name}_sum", labels) @total = value_object(type, name, "#{name}_count", labels) end |
Instance Attribute Details
#sum ⇒ Object
Returns the value of attribute sum.
14 15 16 |
# File 'lib/prometheus/client/summary.rb', line 14 def sum @sum end |
#total ⇒ Object
Returns the value of attribute total.
14 15 16 |
# File 'lib/prometheus/client/summary.rb', line 14 def total @total end |
Instance Method Details
#observe(value) ⇒ Object
21 22 23 24 |
# File 'lib/prometheus/client/summary.rb', line 21 def observe(value) @sum.increment(value) @total.increment end |