class Prometheus::Client::Counter

Counter is a metric that exposes merely a sum or tally of things.

Public Instance Methods

increment(labels = {}, by = 1) click to toggle source
# File lib/prometheus/client/counter.rb, line 12
def increment(labels = {}, by = 1)
  raise ArgumentError, 'increment must be a non-negative number' if by < 0

  label_set = label_set_for(labels)
  synchronize { @values[label_set] += by }
end
type() click to toggle source
# File lib/prometheus/client/counter.rb, line 8
def type
  :counter
end

Private Instance Methods

default() click to toggle source
# File lib/prometheus/client/counter.rb, line 21
def default
  0.0
end