Class: Metriksd::LibratoMetricsReporter::TimesliceRollup::SumGauge
- Inherits:
-
Object
- Object
- Metriksd::LibratoMetricsReporter::TimesliceRollup::SumGauge
- Defined in:
- lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#source ⇒ Object
Returns the value of attribute source.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, source) ⇒ SumGauge
constructor
A new instance of SumGauge.
- #mark(value) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(name, source) ⇒ SumGauge
Returns a new instance of SumGauge.
46 47 48 49 50 |
# File 'lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb', line 46 def initialize(name, source) @name = name @source = source @value = 0 end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
44 45 46 |
# File 'lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb', line 44 def name @name end |
#source ⇒ Object
Returns the value of attribute source.
44 45 46 |
# File 'lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb', line 44 def source @source end |
#value ⇒ Object
Returns the value of attribute value.
44 45 46 |
# File 'lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb', line 44 def value @value end |
Instance Method Details
#mark(value) ⇒ Object
52 53 54 |
# File 'lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb', line 52 def mark(value) @value += value end |
#to_hash ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb', line 56 def to_hash { :name => name, :source => source, :value => value } end |