mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Update ActiveSupport::Subscriber docs
For consistency purposes with the changes done in https://github.com/rails/rails/pull/12285
This commit is contained in:
parent
bfd5bf8313
commit
25b3f738e4
1 changed files with 2 additions and 7 deletions
|
@ -10,19 +10,14 @@ module ActiveSupport
|
|||
#
|
||||
# module ActiveRecord
|
||||
# class StatsSubscriber < ActiveSupport::Subscriber
|
||||
# attach_to :active_record
|
||||
#
|
||||
# def sql(event)
|
||||
# Statsd.timing("sql.#{event.payload[:name]}", event.duration)
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# And it's finally registered as:
|
||||
#
|
||||
# ActiveRecord::StatsSubscriber.attach_to :active_record
|
||||
#
|
||||
# Since we need to know all instance methods before attaching the log
|
||||
# subscriber, the line above should be called after your subscriber definition.
|
||||
#
|
||||
# After configured, whenever a "sql.active_record" notification is published,
|
||||
# it will properly dispatch the event (ActiveSupport::Notifications::Event) to
|
||||
# the +sql+ method.
|
||||
|
|
Loading…
Reference in a new issue