diff options
author | Stan Hu <stanhu@gmail.com> | 2019-08-02 23:40:32 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-02 23:48:14 -0700 |
commit | a43c84e6ab34056262cc6b831afa01043936b343 (patch) | |
tree | 5eb166d706b0cb09ed94f3d3996755891f0fdc6d /lib | |
parent | bce8b66d516e906f6131d8a6dcae797def5288b6 (diff) | |
download | gitlab-ce-a43c84e6ab34056262cc6b831afa01043936b343.tar.gz |
Only track Redis calls if Peek is enabledsh-disable-redis-peek
In dev environments, Sidekiq was encountering the message:
Circular dependency detected while autoloading constant Gitlab::Profiler
This saves some overhead during normal usage.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/peek/views/redis_detailed.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/peek/views/redis_detailed.rb b/lib/peek/views/redis_detailed.rb index b95307deddb..f36f581d5e9 100644 --- a/lib/peek/views/redis_detailed.rb +++ b/lib/peek/views/redis_detailed.rb @@ -16,6 +16,7 @@ module Gitlab private def add_call_details(duration, args) + return unless peek_enabled? # redis-rb passes an array (e.g. [:get, key]) return unless args.length == 1 @@ -26,6 +27,10 @@ module Gitlab } end + def peek_enabled? + Gitlab::SafeRequestStore.store[:peek_enabled] + end + def detail_store ::Gitlab::SafeRequestStore['redis_call_details'] ||= [] end |