class Prometheus::Client::DataStores::SingleThreaded::MetricStore
Public Class Methods
new()
click to toggle 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
all_values()
click to toggle source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 47 def all_values @internal_store.dup end
get(labels:)
click to toggle source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 43 def get(labels:) @internal_store[labels] end
increment(labels:, by: 1)
click to toggle source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 39 def increment(labels:, by: 1) @internal_store[labels] += by end
set(labels:, val:)
click to toggle source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 35 def set(labels:, val:) @internal_store[labels] = val.to_f end
synchronize() { || ... }
click to toggle source
# File lib/prometheus/client/data_stores/single_threaded.rb, line 31 def synchronize yield end