aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/log_subscriber.rb
Commit message (Collapse)AuthorAgeFilesLines
* implements a much faster auto EXPLAIN, closes #3843 [José Valim & Xavier Noria]Xavier Noria2011-12-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This commit vastly reduces the impact of auto explain logging when enabled, while keeping a negligible cost when disabled. The first implementation was based on the idea of subscribing to "sql.active_record" when needed, and unsubscribing once done. This is the idea behind AR::Relation#explain. Subscribe, collect, unsubscribe. But with the current implementation of notifications unsubscribing is costly, because it wipes an internal cache and that puts a penalty on the next event. So we are switching to an approach where a long-running subscriber is listening. Instead of collecting the queries with a closure in a dedicated subscriber, now we setup a thread local. If the feature is disabled by setting the threshold to nil, the subscriber will call a method that does nothing. That's totally cheap.
* Make the identity map use the instrumentation infrastructure so we can style ↵David Heinemeier Hansson2011-05-011-0/+9
| | | | the messages nicely with colors (FIXME: Can someone look into why the test is not working?)
* sql logger ignores schema statementsAaron Patterson2011-03-281-0/+3
|
* fixing tests on 1.8, using a list of lists because order is importantAaron Patterson2011-02-101-1/+3
|
* simplify bind parameter loggingAaron Patterson2011-02-101-3/+1
|
* bind parameters are logged to debug logAaron Patterson2011-02-101-4/+12
|
* Move runtime back to the Thread.currentJosé Valim2010-07-261-3/+15
|
* Cache connection access.José Valim2010-07-251-4/+1
|
* Move runtime back to connection.José Valim2010-07-251-15/+6
|
* Revert the previous three commits.José Valim2010-07-251-1/+15
| | | | | | * 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;
* use a hash to collect optional statistics about the instrumentationAaron Patterson2010-07-251-15/+1
|
* runtime should be properly initialized.José Valim2010-07-251-2/+1
|
* Move runtime to log subscriber.José Valim2010-07-251-6/+16
|
* Get rid of instrumenter.elapsed.José Valim2010-07-241-0/+5
|
* Minor performance improvment in notifications/fanout and ↵Daniel Guettler2010-07-191-0/+2
| | | | active_record/log_subscriber [#5098 state:open]
* avoid const lookup. we know what these constants are in advanceAaron Patterson2010-07-191-3/+3
|
* Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing ↵José Valim2010-06-241-0/+32
frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved]