Class: Sapience::Extensions::ActiveJob::Notifications
- Inherits:
-
Notifications
- Object
- Notifications
- Sapience::Extensions::ActiveJob::Notifications
- Defined in:
- lib/sapience/extensions/active_job/notifications.rb
Instance Attribute Summary
Attributes inherited from Notifications
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Notifications
constructor
Options:.
Methods inherited from Notifications
#metrics, #record?, subscribe, use
Constructor Details
#initialize(opts = {}) ⇒ Notifications
Options:
*:metric_name
- the metric name, defaults to “activejob.perform” *:tags
- additional tags
11 12 13 14 15 16 17 18 |
# File 'lib/sapience/extensions/active_job/notifications.rb', line 11 def initialize(opts = {}) super @metric_name = opts[:metric_name] || "activejob.perform" Sapience::Extensions::Notifications.subscribe "perform.active_job" do |event| record event end end |