Class: PrometheusExporter::Server::WebCollector
- Inherits:
-
TypeCollector
- Object
- TypeCollector
- PrometheusExporter::Server::WebCollector
- Defined in:
- lib/prometheus_exporter/server/web_collector.rb
Instance Method Summary collapse
- #collect(obj) ⇒ Object
-
#initialize ⇒ WebCollector
constructor
A new instance of WebCollector.
- #metrics ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize ⇒ WebCollector
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 |
#metrics ⇒ Object
18 19 20 |
# File 'lib/prometheus_exporter/server/web_collector.rb', line 18 def metrics @metrics.values end |
#type ⇒ Object
9 10 11 |
# File 'lib/prometheus_exporter/server/web_collector.rb', line 9 def type "web" end |