提交 3582c6ae 编写于 作者: S 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.
上级 ab3fb00c
......@@ -22,6 +22,7 @@ v 8.9.0 (unreleased)
- Reduce number of fog gem dependencies
- Remove project notification settings associated with deleted 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
- Fix groups API to list only user's accessible projects
- Redesign account and email confirmation emails
......
......@@ -138,4 +138,20 @@ if Gitlab::Metrics.enabled?
GC::Profiler.enable
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册