Class: Sentry::Metrics::CounterMetric
- Defined in:
- lib/sentry/metrics/counter_metric.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #add(value) ⇒ Object
-
#initialize(value) ⇒ CounterMetric
constructor
A new instance of CounterMetric.
- #serialize ⇒ Object
- #weight ⇒ Object
Constructor Details
#initialize(value) ⇒ CounterMetric
Returns a new instance of CounterMetric.
8 9 10 |
# File 'lib/sentry/metrics/counter_metric.rb', line 8 def initialize(value) @value = value.to_f end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/sentry/metrics/counter_metric.rb', line 6 def value @value end |
Instance Method Details
#add(value) ⇒ Object
12 13 14 |
# File 'lib/sentry/metrics/counter_metric.rb', line 12 def add(value) @value += value.to_f end |
#serialize ⇒ Object
16 17 18 |
# File 'lib/sentry/metrics/counter_metric.rb', line 16 def serialize [value] end |
#weight ⇒ Object
20 21 22 |
# File 'lib/sentry/metrics/counter_metric.rb', line 20 def weight 1 end |