Class: TsdMetrics::Counter
- Inherits:
-
Object
- Object
- TsdMetrics::Counter
- Defined in:
- lib/tsd_metrics/counter.rb
Instance Method Summary collapse
- #createNewSample ⇒ Object
-
#initialize(parentMetric) ⇒ Counter
constructor
A new instance of Counter.
- #values ⇒ Object
Constructor Details
#initialize(parentMetric) ⇒ Counter
Returns a new instance of Counter.
20 21 22 23 24 |
# File 'lib/tsd_metrics/counter.rb', line 20 def initialize(parentMetric) @parentMetric = parentMetric @samples = [] @staticSample = nil end |
Instance Method Details
#createNewSample ⇒ Object
26 27 28 29 30 |
# File 'lib/tsd_metrics/counter.rb', line 26 def createNewSample newSample = CounterSample.new(@parentMetric) @samples.push(newSample) return newSample end |
#values ⇒ Object
32 33 34 35 36 |
# File 'lib/tsd_metrics/counter.rb', line 32 def values @samples.map do |s| s.sampleRepresentation end end |