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 8 9 10 11 12 |
# File 'lib/prometheus_exporter/server/web_collector.rb', line 5 def initialize @metrics = {} @http_requests_total = nil @http_request_duration_seconds = nil @http_request_redis_duration_seconds = nil @http_request_sql_duration_seconds = nil @http_request_queue_duration_seconds = nil end |
Instance Method Details
#collect(obj) ⇒ Object
18 19 20 21 |
# File 'lib/prometheus_exporter/server/web_collector.rb', line 18 def collect(obj) ensure_metrics observe(obj) end |
#metrics ⇒ Object
23 24 25 |
# File 'lib/prometheus_exporter/server/web_collector.rb', line 23 def metrics @metrics.values end |
#type ⇒ Object
14 15 16 |
# File 'lib/prometheus_exporter/server/web_collector.rb', line 14 def type "web" end |