Commit Graph

45 Commits

Author SHA1 Message Date
Carl Lerche
e539228d08 Bug fix: Evented notification subscribers can handle published events 2013-05-17 16:27:23 -07:00
Prathamesh Sonpatki
b5429eec60 Fix Typo existant -> existent [ci skip] 2013-05-08 09:50:46 +05:30
stopdropandrew
a007800a55 ActiveSupport::Notifications::Instrumenter#instrument should yield
its payload the same way that ActiveSupport::Notifications does.
Fix spelling in test name.
2013-03-02 16:05:05 -08:00
タコ焼き仮面
c6d86a5db4 make events not use date and time to determine parent_of. fixes #5932 2012-06-18 16:34:23 -07:00
Xavier Noria
d287e90870 implements AS::Notifications.subscribed, which provides subscriptions to events while a block runs 2011-11-05 12:02:54 -07:00
Arun Agrawal
83eec4ca4c Requiring delegate. 2011-08-16 01:36:21 +05:30
Jon Leighton
d411c85a65 Replace references to ActiveSupport::SecureRandom with just SecureRandom, and require 'securerandom' from the stdlib when active support is required. 2011-05-23 20:25:44 +01:00
Aaron Patterson
3e02b3702e just use an attr_accessor so we do not pay ||= on every notification call 2011-02-09 14:02:38 -08:00
José Valim
ff0d842454 Revert the previous three commits.
* AS::Notifications#instrument should not measure anything, it is not its responsibility;

* Adding another argument to AS::Notifications#instrument API needs to be properly discussed;
2010-07-25 20:46:42 +02:00
Aaron Patterson
b7e0408ca9 use a hash to collect optional statistics about the instrumentation 2010-07-25 11:11:23 -07:00
José Valim
834bd23a07 Get rid of instrumenter.elapsed. 2010-07-24 10:22:22 +02:00
José Valim
9df9c4bac0 Add a test for elapsed and require missing benchmark file. 2010-07-20 17:07:18 +02:00
Santiago Pastorino
3870366092 Float comparison adjustment
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-18 19:28:46 +02:00
Santiago Pastorino
725090942f We shouldn't rely on float comparison, delta added just in case float representation of this values aren't equal 2010-07-12 09:59:52 +08:00
José Valim
a76c7e68d5 Event should be aware if yielded block failed or not. 2010-05-02 22:45:54 +02:00
Justin George
109d3ee38d Make notifications go off even when an error is raised, so that we capture the underlying performance data [#4505 state:resolved]
This is important when trying to keep track of many layers of interrelated calls

i.e.:

ActiveRecord::Base.transaction do
  MyModel.find(1) #ActiveRecord::NotFound
end # should capture the full time until the error propagation

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:53 +02:00
David Chelimsky
864bd9c21f allow unsubscribe by name or subscription [#4433 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-24 22:06:24 -07:00
José Valim
a6dc227167 Mark bang instrumentations as something that you shuold not be listening to. 2010-03-17 23:44:03 +01:00
Carlhuda
fc0882ba5a Optimize AS::Notifications to remember which subscribers don't match and not run them. This will allow notifications that are only useful in dev or testing to run efficiently in production. 2010-03-01 17:45:37 -08:00
Carlhuda
c88360ef36 You can unsubscribe a subscriber 2010-03-01 17:45:37 -08:00
Prem Sichanugrist
f0523f72b4 Rename Rails::Subscriber to Rails::LogSubscriber 2010-02-16 22:36:15 +01:00
José Valim
31248fe369 Remove instrument! and require thread from AS::Notifications. 2010-02-04 10:39:55 +01:00
Mikel Lindsaar
2ebea1c02d deOMGifying Railties, Active Support, and Action Pack 2010-01-31 09:46:30 -08:00
José Valim
378464a2e4 Default to sync instrumentation. 2010-01-21 13:09:12 +01:00
José Valim
0334f9f6cf Add ActionDispatch::Notifications middleware. 2010-01-17 11:29:51 +01:00
José Valim
7f4d8e3fbd Yield the payload notifications for further modification (like adding the result). 2010-01-15 12:24:31 +01:00
José Valim
7c3573f327 Add instrument! to notifications which adds the result to the payload. 2010-01-14 01:07:03 +01:00
José Valim
4704af763f Do not send notifications when instrumentation raise an error. 2010-01-13 01:19:22 +01:00
José Valim
74f6ccea20 instrumenter should be accessible from ActiveSupport::Notifications. 2010-01-06 22:24:16 +01:00
José Valim
45462c5e41 Expose Instrumenter id in Notifications. 2010-01-04 23:05:28 +01:00
José Valim
75ba102a80 Remove ActionView inline logging to ActiveSupport::Notifications and create ActionController::Base#log_event, so everything can be logged within one listener. Also expose log_process_action as a hook for different modules to include their own information during the action processing. This allow ActiveRecord to hook and any other ORM. Finally, this commit changes 'Processing' and 'Rendering' in logs to 'Processed' and 'Rendered' because at the point it's logged, everying already happened. 2009-12-26 20:28:53 +01:00
Jeremy Kemper
327545c3ae Notifications: synchronous fanout queue pushes events to subscribers rather than having them concurrently pull 2009-11-29 02:30:35 -08:00
Jeremy Kemper
4f2a04cc08 Notifications: extract central Notifier, cordon off the internal Fanout implementation, and segregate instrumentation concerns 2009-11-28 12:50:09 -08:00
Jeremy Kemper
ddf681ce1d Expose a simple Queue#wait to block until all notifications are drained 2009-11-28 12:50:09 -08:00
Jeremy Kemper
6f7fc5824f Revert "Create SyncListener. Since they do not rely on Thread, they can be used on Google App Engine."
Take a step back on this API direction.

This reverts commit 8104f65c3225453d13307c3c2733c2a8f99e491a.
2009-11-28 12:50:09 -08:00
José Valim
8104f65c32 Create SyncListener. Since they do not rely on Thread, they can be used on Google App Engine.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-11-23 09:08:17 -08:00
Jeremy Kemper
58c0d31487 Notifications: queue.drained? for testability in place of brittle sleeps 2009-11-13 20:58:38 -08:00
Jeremy Kemper
66fda6b894 Fix duration check for longer sleep 2009-11-13 19:28:59 -08:00
Jeremy Kemper
7ab78b9ccd CI: slow down brittle notifications tests 2009-11-13 18:57:10 -08:00
Yehuda Katz
c9487ed6af Change Event#thread_id to #transaction_id. Defaults to one "transaction" per thread but you can explicitly declare the start of a new one. This makes it possible for each request to have it own id. 2009-10-28 01:58:33 -07:00
Yehuda Katz
cbcb947b00 AS::Notifications.subscribe blocks are now yielded the arguments to pass to AS::Notifications::Event.new 2009-10-27 21:04:53 -07:00
Yehuda Katz
b3a198041b Some optimizations on AS::Notifications. This does not change the public-facing API. 2009-10-27 09:15:41 -07:00
José Valim
2d7abe245e Renamed Orchestra to Notifications once again [#3321 state:resolved] 2009-10-15 18:51:51 -03:00
José Valim
8b340ab2f6 Revert "Rename Orchestra to Notifications [#3321 state:resolved]"
This reverts commit 8cbf825425dc8ad3770881ea4e100b9023c69ce2.
2009-10-15 18:06:15 -03:00
Joshua Peek
8cbf825425 Rename Orchestra to Notifications [#3321 state:resolved] 2009-10-14 19:50:36 -05:00