mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-12 06:06:05 +10:00
Merge branch 'transaction-query-count' into 'master'
Count the number of SQL queries per transaction cc @pcarranza See merge request !3783
This commit is contained in:
@@ -4,6 +4,7 @@ v 8.7.0 (unreleased)
|
||||
- Method instrumentation now uses Module#prepend instead of aliasing methods
|
||||
- Repository.clean_old_archives is now instrumented
|
||||
- Add support for environment variables on a job level in CI configuration file
|
||||
- SQL query counts are now tracked per transaction
|
||||
- The Projects::HousekeepingService class has extra instrumentation
|
||||
- All service classes (those residing in app/services) are now instrumented
|
||||
- Developers can now add custom tags to transactions
|
||||
|
||||
@@ -9,6 +9,7 @@ module Gitlab
|
||||
return unless current_transaction
|
||||
|
||||
current_transaction.increment(:sql_duration, event.duration)
|
||||
current_transaction.increment(:sql_count, 1)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -28,6 +28,9 @@ describe Gitlab::Metrics::Subscribers::ActiveRecord do
|
||||
expect(transaction).to receive(:increment).
|
||||
with(:sql_duration, 0.2)
|
||||
|
||||
expect(transaction).to receive(:increment).
|
||||
with(:sql_count, 1)
|
||||
|
||||
subscriber.sql(event)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user