class Prometheus::Client::DataStores::SingleThreaded::MetricStore
Public Class Methods
Source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 27 def initialize @internal_store = Hash.new { |hash, key| hash[key] = 0.0 } end
Public Instance Methods
Source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 47 def all_values @internal_store.dup end
Source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 43 def get(labels:) @internal_store[labels] end
Source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 39 def increment(labels:, by: 1) @internal_store[labels] += by end
Source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 35 def set(labels:, val:) @internal_store[labels] = val.to_f end
Source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 31 def synchronize yield end