diff options
author | José Valim <jose.valim@gmail.com> | 2009-10-15 14:49:29 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-10-15 18:19:25 -0300 |
commit | 5988b87c30eb0ce50c235187f5dfcfcfb98da01b (patch) | |
tree | 9296872692328820d2a97f29ecfb434fd99a8aab /activesupport/lib | |
parent | 11f9f556b83f90e33ae516cc7a74177a9befdb0b (diff) | |
download | rails-5988b87c30eb0ce50c235187f5dfcfcfb98da01b.tar.gz rails-5988b87c30eb0ce50c235187f5dfcfcfb98da01b.tar.bz2 rails-5988b87c30eb0ce50c235187f5dfcfcfb98da01b.zip |
Added parent_of? method to help tracing events.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/orchestra.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/orchestra.rb b/activesupport/lib/active_support/orchestra.rb index 96e6ce8865..5f57127401 100644 --- a/activesupport/lib/active_support/orchestra.rb +++ b/activesupport/lib/active_support/orchestra.rb @@ -112,6 +112,11 @@ module ActiveSupport @result = @payload.delete(:result) @duration = @payload.delete(:duration) end + + def parent_of?(event) + start = (self.time - event.time) * 1000 + start <= 0 && (start + self.duration >= event.duration) + end end # This is a default queue implementation that ships with Orchestra. It |