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 13 |
# 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 @http_request_memcache_duration_seconds = nil end |
Instance Method Details
#collect(obj) ⇒ Object
19 20 21 22 |
# File 'lib/prometheus_exporter/server/web_collector.rb', line 19 def collect(obj) ensure_metrics observe(obj) end |
#metrics ⇒ Object
24 25 26 |
# File 'lib/prometheus_exporter/server/web_collector.rb', line 24 def metrics @metrics.values end |
#type ⇒ Object
15 16 17 |
# File 'lib/prometheus_exporter/server/web_collector.rb', line 15 def type "web" end |