Class: Lepus::Prometheus::Collector
- Inherits:
-
PrometheusExporter::Server::TypeCollector
- Object
- PrometheusExporter::Server::TypeCollector
- Lepus::Prometheus::Collector
- Defined in:
- lib/lepus/prometheus/collector.rb
Constant Summary collapse
- DEFAULT_BUCKETS =
[0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10].freeze
Instance Method Summary collapse
- #collect(obj) ⇒ Object
-
#initialize ⇒ Collector
constructor
A new instance of Collector.
- #metrics ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize ⇒ Collector
Returns a new instance of Collector.
19 20 21 |
# File 'lib/lepus/prometheus/collector.rb', line 19 def initialize @metrics = {} end |
Instance Method Details
#collect(obj) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lepus/prometheus/collector.rb', line 31 def collect(obj) case obj["metric"] when "delivery" then collect_delivery(obj) when "publish" then collect_publish(obj) when "process" then collect_process(obj) when "process_info" then collect_process_info(obj) when "queue" then collect_queue(obj) when "queue_poll" then collect_queue_poll(obj) when "queue_poll_error" then collect_queue_poll_error(obj) end end |
#metrics ⇒ Object
27 28 29 |
# File 'lib/lepus/prometheus/collector.rb', line 27 def metrics @metrics.values end |
#type ⇒ Object
23 24 25 |
# File 'lib/lepus/prometheus/collector.rb', line 23 def type "lepus" end |