Class: Circuitry::Middleware::Seismograph
- Inherits:
-
Object
- Object
- Circuitry::Middleware::Seismograph
- Defined in:
- lib/circuitry/middleware/seismograph.rb
Instance Attribute Summary collapse
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#stat ⇒ Object
readonly
Returns the value of attribute stat.
Instance Method Summary collapse
- #call(topic, _message, &block) ⇒ Object
-
#initialize(options = {}) ⇒ Seismograph
constructor
A new instance of Seismograph.
Constructor Details
#initialize(options = {}) ⇒ Seismograph
Returns a new instance of Seismograph.
8 9 10 11 |
# File 'lib/circuitry/middleware/seismograph.rb', line 8 def initialize( = {}) self.namespace = .fetch(:namespace, 'circuitry') self.stat = .fetch(:stat) end |
Instance Attribute Details
#namespace ⇒ Object
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/circuitry/middleware/seismograph.rb', line 6 def namespace @namespace end |
#stat ⇒ Object
Returns the value of attribute stat.
6 7 8 |
# File 'lib/circuitry/middleware/seismograph.rb', line 6 def stat @stat end |
Instance Method Details
#call(topic, _message, &block) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/circuitry/middleware/seismograph.rb', line 13 def call(topic, , &block) = ["topic:#{topic}"] sensor.benchmark(stat, tags: , &block) rescue StandardError => err log.error('Circuitry message processing failed', description: err., tags: ) raise err end |