Class: DDMetrics::Counter

Inherits:
Metric
  • Object
show all
Defined in:
lib/ddmetrics/counter.rb

Instance Method Summary collapse

Methods inherited from Metric

#basic_metric_for, #each, #initialize, #labels, #validate_label

Constructor Details

This class inherits a constructor from DDMetrics::Metric

Instance Method Details

#get(label) ⇒ Object



10
11
12
13
# File 'lib/ddmetrics/counter.rb', line 10

def get(label)
  validate_label(label)
  basic_metric_for(label, BasicCounter).value
end

#increment(label) ⇒ Object



5
6
7
8
# File 'lib/ddmetrics/counter.rb', line 5

def increment(label)
  validate_label(label)
  basic_metric_for(label, BasicCounter).increment
end

#to_sObject



15
16
17
# File 'lib/ddmetrics/counter.rb', line 15

def to_s
  DDMetrics::Printer.new.counter_to_s(self)
end