| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
variables such as @cpu_time, @idle_time and @allocations; this reduces one allocation
|
|
|
|
| |
`ActiveSupport::Notifications::Fanout::Subscribers::Timed` subscriber
|
|
|
|
| |
with change to ActiveSupport::Notifications::Instrumenter#instrument
|
|
|
|
|
| |
* Update #instrument to make passing a block optional. This will let users
leverage #instrument for messaging in addition to instrumentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've found a few places in Rails code base where I think it makes sense
to calculate elapsed time more precisely by using
`Concurrent.monotonic_time`:
- Fix calculation of elapsed time in `ActiveSupport::Cache::MemoryStore#prune`
- Fix calculation of elapsed time in
`ActiveRecord::ConnectionAdapters::ConnectionPool::Queue#wait_poll`
- Fix calculation of elapsed time in
`ActiveRecord::ConnectionAdapters::ConnectionPool#attempt_to_checkout_all_existing_connections`
- Fix calculation of elapsed time in `ActiveRecord::ConnectionAdapters::Mysql2Adapter#explain`
See
https://docs.ruby-lang.org/en/2.5.0/Process.html#method-c-clock_gettime
https://blog.dnsimple.com/2018/03/elapsed-time-with-ruby-the-right-way
Related to 7c4542146f0dde962205e5a90839349631ae60fb
|
| |
|
|
|
|
|
|
|
|
| |
Since #33449, `event.end = Time.now` is not used anymore and should use
`event.finish!`.
We can't use `deprecate :end=` in definition time in this module due to
circular require in `active_support/deprecation/behaviors`.
|
|
|
|
|
| |
Add Windows support for `ActiveSupport::Testing::Parallelization`
and `ActiveSupport::Notifications::Instrumenter`.
|
|
|
|
| |
It's not defined on JRuby and unlike monotonic time, concurrent-ruby doesn't have an cross-platform abstraction for this.
|
|
|
|
|
|
|
| |
We don't need to have a special subscribe method for objects. The
regular `subscribe` method is more expensive than a specialized method,
but `subscribe` should not be called frequently. If that turns out to
be a hotspot, we can introduce a specialized method. :)
|
|
|
|
|
|
| |
Fanout notifier can send event objects to subscribers now. Also moved
`end` lower in the `finish!` method to guarantee that CPU time is
shorter than real time.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use process clock instead of Time.now
This fixes any issues with the system clock changing and also eliminates
2 object allocations per event.
* Add start! and finish! methods to the event object so we can record
more information
* Adds cpu time, idle time, and allocation count for a particular event.
Co-authored-by: Aaron Patterson <aaron.patterson@gmail.com>
|
| |
|
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
| |
- Adds new key/value pair to payload when an exception is raised
e.g. `:exception_object=> #<RuntimeError: FAIL>`
- Updates relevant test
- Adds CHANGELOG entry
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue is that on the exit from Instrumenter#instrument section,
an Evented listener will run into an error because its thread local
(Thread.current[:_timestack]) has not been set up by the #start
method (this obviously happens because the Evented listeners didn't
exist at the time, since no subscribtion to that section was made yet).
Note: support for subscribing to instrumented sections, while being
inside those instrumented sections, might be removed in the future.
Maybe fixes #21873.
|
|
|
|
|
|
|
|
| |
@rafaelfranca suggested in f7c7bcd9 that code examples should display
the result after `# =>` and not after `#=>`.
This commit replaces *all* the occurrences of `#=>` in the code documentation
(mostly added by me :sob:) with the suggested `# =>`.
|
|
|
|
|
|
|
|
|
| |
Stems from comments by @zzak on e07f3dd:
* https://github.com/rails/docrails/commit/e07f3ddcac394d2a8dc23fc571318b7e8c2497b1#commitcomment-9015634
* https://github.com/rails/docrails/commit/e07f3ddcac394d2a8dc23fc571318b7e8c2497b1#commitcomment-9015639
[ci skip]
|
|
|
|
| |
[ci skip]
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
activerecord/test/cases/adapter_test.rb
guides/source/testing.md
[ci skip]
|
| | |
|
|/
|
|
| |
its payload the same way that ActiveSupport::Notifications does.
Fix spelling in test name.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Refactor log subscriber, use select! to avoid a new object
* Remove deprecation messages related to AS::Deprecation behavior
This was added about 2 years ago for Rails 3:
https://github.com/rails/rails/commit/d4c7d3fd94e5a885a6366eaeb3b908bb58ffd4db
* Remove some not used requires
* Refactor delegate to avoid string conversions and if statements inside each block
|
|
|
|
| |
standard library. (It has been deprecated in the 3-1-stable branch.)
|
|
|
|
|
|
| |
* 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;
|
| |
|
| |
|
|
|
|
| |
listened to. Also, fix a possible concurrency issue.
|
| |
|
|
|
|
| |
Benchmark. [#5098 state:open]
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
|
|
|
| |
result).
|
| |
|
| |
|