Class: Metrics::Handler
- Inherits:
-
Object
- Object
- Metrics::Handler
- Defined in:
- lib/metrics/handler.rb
Overview
Internal: Responsible for taking a list or an Array of Metrics::Instrumenters and passing them to the formatter.
Instance Attribute Summary collapse
-
#instrumenters ⇒ Object
readonly
Returns the value of attribute instrumenters.
Class Method Summary collapse
Instance Method Summary collapse
-
#handle ⇒ Object
Public: Writes all of the instrumenters to STDOUT using the formatter.
-
#initialize(*instrumenters) ⇒ Handler
constructor
A new instance of Handler.
Constructor Details
#initialize(*instrumenters) ⇒ Handler
Returns a new instance of Handler.
12 13 14 |
# File 'lib/metrics/handler.rb', line 12 def initialize(*instrumenters) @instrumenters = instrumenters.flatten end |
Instance Attribute Details
#instrumenters ⇒ Object (readonly)
Returns the value of attribute instrumenters.
6 7 8 |
# File 'lib/metrics/handler.rb', line 6 def instrumenters @instrumenters end |
Class Method Details
.handle(*instrumenters) ⇒ Object
8 9 10 |
# File 'lib/metrics/handler.rb', line 8 def self.handle(*instrumenters) new(*instrumenters).handle end |
Instance Method Details
#handle ⇒ Object
Public: Writes all of the instrumenters to STDOUT using the formatter.
Returns an Array of Metrics::Instrumenters that were written to STDOUT.
19 20 21 22 |
# File 'lib/metrics/handler.rb', line 19 def handle write instrumenters result end |