Class: PrometheusExporter::Server::WebCollector

Inherits:
TypeCollector show all
Defined in:
lib/prometheus_exporter/server/web_collector.rb

Instance Method Summary collapse

Constructor Details

#initializeWebCollector

Returns a new instance of WebCollector.



5
6
7
# File 'lib/prometheus_exporter/server/web_collector.rb', line 5

def initialize
  @metrics = {}
end

Instance Method Details

#collect(obj) ⇒ Object



13
14
15
16
# File 'lib/prometheus_exporter/server/web_collector.rb', line 13

def collect(obj)
  ensure_metrics
  observe(obj)
end

#metricsObject



18
19
20
# File 'lib/prometheus_exporter/server/web_collector.rb', line 18

def metrics
  @metrics.values
end

#typeObject



9
10
11
# File 'lib/prometheus_exporter/server/web_collector.rb', line 9

def type
  "web"
end