Commit 3582c6ae authored by Sean McGivern's avatar Sean McGivern

Track new Redis connections

Increment the counter `new_redis_connections` on each call to
`Redis::Client#connect`, if we're in a transaction.
parent ab3fb00c
...@@ -22,6 +22,7 @@ v 8.9.0 (unreleased) ...@@ -22,6 +22,7 @@ v 8.9.0 (unreleased)
- Reduce number of fog gem dependencies - Reduce number of fog gem dependencies
- Remove project notification settings associated with deleted projects - Remove project notification settings associated with deleted projects
- Fix 404 page when viewing TODOs that contain milestones or labels in different projects - Fix 404 page when viewing TODOs that contain milestones or labels in different projects
- Add a metric for the number of new Redis connections created by a transaction
- Redesign navigation for project pages - Redesign navigation for project pages
- Fix groups API to list only user's accessible projects - Fix groups API to list only user's accessible projects
- Redesign account and email confirmation emails - Redesign account and email confirmation emails
......
...@@ -138,4 +138,20 @@ if Gitlab::Metrics.enabled? ...@@ -138,4 +138,20 @@ if Gitlab::Metrics.enabled?
GC::Profiler.enable GC::Profiler.enable
Gitlab::Metrics::Sampler.new.start Gitlab::Metrics::Sampler.new.start
module TrackNewRedisConnections
def connect(*args)
val = super
if current_transaction = Gitlab::Metrics::Transaction.current
current_transaction.increment(:new_redis_connections, 1)
end
val
end
end
class ::Redis::Client
prepend TrackNewRedisConnections
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment