class Prometheus::Client::Counter

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

Public Instance Methods

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

  label_set = label_set_for(labels)
  @store.increment(labels: label_set, by: by)
end
type() click to toggle source
# File lib/prometheus/client/counter.rb, line 9
def type
  :counter
end