Module: PrometheusExporter::Ext::Server::StatsCollector
- Included in:
- ProcCpuCollector
- Defined in:
- lib/prometheus_exporter/ext/server/stats_collector.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#collect(obj) ⇒ Object
Collects metric data received from client.
- #initialize ⇒ Object
-
#metrics ⇒ Array<PrometheusExporter::Metric::Base>
Returns all metrics collected by this collector.
Instance Method Details
#collect(obj) ⇒ Object
Collects metric data received from client.
40 41 42 43 |
# File 'lib/prometheus_exporter/ext/server/stats_collector.rb', line 40 def collect(obj) obj = normalize_labels(obj) fill_observers(@observers, obj) end |
#initialize ⇒ Object
27 28 29 30 |
# File 'lib/prometheus_exporter/ext/server/stats_collector.rb', line 27 def initialize super @observers = build_observers end |
#metrics ⇒ Array<PrometheusExporter::Metric::Base>
Returns all metrics collected by this collector.
34 35 36 |
# File 'lib/prometheus_exporter/ext/server/stats_collector.rb', line 34 def metrics @observers.values end |