Sha256: 4a071aedb981d48ff6a38ab6e7c68d305e01c7d16814b75ef4003ccd22cf6c28
Contents?: true
Size: 474 Bytes
Versions: 15
Compression:
Stored size: 474 Bytes
Contents
# encoding: UTF-8 require 'prometheus/client/metric' module Prometheus module Client # Counter is a metric that exposes merely a sum or tally of things. class Counter < Metric def type :counter end 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 end end end
Version data entries
15 entries across 15 versions & 2 rubygems