Sha256: 6ce192a8180061864367defccdee9fd8ba33a2c227723a92d7d8883ec1d6ac63
Contents?: true
Size: 350 Bytes
Versions: 5
Compression:
Stored size: 350 Bytes
Contents
# frozen_string_literal: true class Async::App::Metrics::Store include Enumerable def set(name, value:, suffix: "total", **labels) key = [name, labels] counters[key] ||= { name:, labels:, suffix:, value: } counters[key].merge!(value:) end def each(&) = counters.values.each(&) private def counters = @counters ||= {} end
Version data entries
5 entries across 5 versions & 1 rubygems