Class: D13n::Rack::D13nMiddleware
- Inherits:
-
Object
- Object
- D13n::Rack::D13nMiddleware
- Defined in:
- lib/d13n/rack/d13n_middleware.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#stream_options ⇒ Object
readonly
Returns the value of attribute stream_options.
Instance Method Summary collapse
- #build_stream_name ⇒ Object
-
#initialize(app, options = {}) ⇒ D13nMiddleware
constructor
A new instance of D13nMiddleware.
Constructor Details
#initialize(app, options = {}) ⇒ D13nMiddleware
Returns a new instance of D13nMiddleware.
6 7 8 9 10 11 12 13 |
# File 'lib/d13n/rack/d13n_middleware.rb', line 6 def initialize(app, ={}) @app = app @category = :middleware @target = self @stream_options = { :stream_name => build_stream_name } end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
5 6 7 |
# File 'lib/d13n/rack/d13n_middleware.rb', line 5 def category @category end |
#stream_options ⇒ Object (readonly)
Returns the value of attribute stream_options.
5 6 7 |
# File 'lib/d13n/rack/d13n_middleware.rb', line 5 def @stream_options end |
Instance Method Details
#build_stream_name ⇒ Object
15 16 17 18 |
# File 'lib/d13n/rack/d13n_middleware.rb', line 15 def build_stream_name prefix = ::D13n::Metric::Instrumentation::ControllerInstrumentation::StreamNamer.prefix_for_category(nil, @category) "#{prefix}.#{self.class.name}.call" end |