Class: Metrics::Integration::Rack::Endpoint
- Inherits:
-
Object
- Object
- Metrics::Integration::Rack::Endpoint
- Defined in:
- lib/ruby-metrics/integration/rack_endpoint.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
Returns the value of attribute agent.
-
#app ⇒ Object
Returns the value of attribute app.
-
#options ⇒ Object
Returns the value of attribute options.
-
#requests ⇒ Object
Returns the value of attribute requests.
-
#status_codes ⇒ Object
Returns the value of attribute status_codes.
-
#uncaught_exceptions ⇒ Object
Returns the value of attribute uncaught_exceptions.
Instance Method Summary collapse
- #call(_) ⇒ Object
-
#initialize(options = {}) ⇒ Endpoint
constructor
A new instance of Endpoint.
Constructor Details
Instance Attribute Details
#agent ⇒ Object
Returns the value of attribute agent.
10 11 12 |
# File 'lib/ruby-metrics/integration/rack_endpoint.rb', line 10 def agent @agent end |
#app ⇒ Object
Returns the value of attribute app.
10 11 12 |
# File 'lib/ruby-metrics/integration/rack_endpoint.rb', line 10 def app @app end |
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/ruby-metrics/integration/rack_endpoint.rb', line 10 def @options end |
#requests ⇒ Object
Returns the value of attribute requests.
10 11 12 |
# File 'lib/ruby-metrics/integration/rack_endpoint.rb', line 10 def requests @requests end |
#status_codes ⇒ Object
Returns the value of attribute status_codes.
10 11 12 |
# File 'lib/ruby-metrics/integration/rack_endpoint.rb', line 10 def status_codes @status_codes end |
#uncaught_exceptions ⇒ Object
Returns the value of attribute uncaught_exceptions.
10 11 12 |
# File 'lib/ruby-metrics/integration/rack_endpoint.rb', line 10 def uncaught_exceptions @uncaught_exceptions end |
Instance Method Details
#call(_) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/ruby-metrics/integration/rack_endpoint.rb', line 20 def call(_) body = @agent.to_json [ 200, { 'Content-Type' => 'application/json', 'Content-Length' => body.size.to_s }, [body] ] end |