Class: Prometheus::Client::Rack::Collector
- Inherits:
-
Object
- Object
- Prometheus::Client::Rack::Collector
- Defined in:
- lib/prometheus/client/rack/collector.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
-
#call(env) ⇒ Object
:nodoc:.
-
#initialize(app, options = {}) ⇒ Collector
constructor
A new instance of Collector.
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/prometheus/client/rack/collector.rb', line 7 def app @app end |
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
7 8 9 |
# File 'lib/prometheus/client/rack/collector.rb', line 7 def registry @registry end |
Instance Method Details
#call(env) ⇒ Object
:nodoc:
16 17 18 19 20 21 22 |
# File 'lib/prometheus/client/rack/collector.rb', line 16 def call(env) # :nodoc: start = Time.now @app.call(env) ensure @requests.increment @requests_duration.increment({}, ((Time.now - start) * 1_000_000).to_i) end |