Class: Prometheus::Client::DataStores::SingleThreaded

Inherits:
Object
  • Object
show all
Defined in:
lib/prometheus/client/data_stores/single_threaded.rb

Overview

Stores all the data in a simple Hash for each Metric

Has no synchronization primitives, making it the fastest store for single-threaded scenarios, but must absolutely not be used in multi-threaded scenarios.

Defined Under Namespace

Classes: InvalidStoreSettingsError

Instance Method Summary collapse

Instance Method Details

#for_metric(metric_name, metric_type:, metric_settings: {}) ⇒ Object



11
12
13
14
15
# File 'lib/prometheus/client/data_stores/single_threaded.rb', line 11

def for_metric(metric_name, metric_type:, metric_settings: {})
  # We don't need `metric_type` or `metric_settings` for this particular store
  validate_metric_settings(metric_settings: metric_settings)
  MetricStore.new
end