Class: Sqreen::FrameworkCB
Overview
Framework-aware callback
Direct Known Subclasses
Constant Summary
Constants inherited from CB
Instance Attribute Summary collapse
-
#framework ⇒ Object
Returns the value of attribute framework.
Attributes inherited from CB
#klass, #method, #overtimeable
Instance Method Summary collapse
-
#record_observation(category, key, observation, at = Time.now.utc) ⇒ Object
Record a metric observation.
- #whitelisted? ⇒ Boolean
Methods inherited from CB
#failing?, #initialize, #overtime!, #post?, #pre?, #priority, #to_s
Constructor Details
This class inherits a constructor from Sqreen::CB
Instance Attribute Details
#framework ⇒ Object
Returns the value of attribute framework.
12 13 14 |
# File 'lib/sqreen/framework_cb.rb', line 12 def framework @framework end |
Instance Method Details
#record_observation(category, key, observation, at = Time.now.utc) ⇒ Object
Record a metric observation
25 26 27 28 |
# File 'lib/sqreen/framework_cb.rb', line 25 def record_observation(category, key, observation, at = Time.now.utc) return unless framework framework.observe(:observations, [category, key, observation, at], [], false) end |
#whitelisted? ⇒ Boolean
14 15 16 17 18 |
# File 'lib/sqreen/framework_cb.rb', line 14 def whitelisted? whitelisted = SharedStorage.get(:whitelisted) return whitelisted unless whitelisted.nil? framework && !framework.whitelisted_match.nil? end |