Commit e9918b1a authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'sh-disable-redis-peek' into 'master'

Only track Redis calls if Peek is enabled

See merge request gitlab-org/gitlab-ce!31438
parents f3e2d048 a43c84e6
---
title: Only track Redis calls if Peek is enabled
merge_request: 31438
author:
type: performance
......@@ -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
......
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