Class: Metriksd::LibratoMetricsReporter::TimesliceRollup::SumGauge

Inherits:
Object
  • Object
show all
Defined in:
lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



44
45
46
# File 'lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb', line 44

def name
  @name
end

#sourceObject

Returns the value of attribute source.



44
45
46
# File 'lib/metriksd/librato_metrics_reporter/timeslice_rollup.rb', line 44

def source
  @source
end

#valueObject

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_hashObject



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