summaryrefslogtreecommitdiff
path: root/lib/gitlab/metrics/subscribers/ldap.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/metrics/subscribers/ldap.rb')
-rw-r--r--lib/gitlab/metrics/subscribers/ldap.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/gitlab/metrics/subscribers/ldap.rb b/lib/gitlab/metrics/subscribers/ldap.rb
index 409ecbb6e8a..3dae2d1fd88 100644
--- a/lib/gitlab/metrics/subscribers/ldap.rb
+++ b/lib/gitlab/metrics/subscribers/ldap.rb
@@ -8,8 +8,6 @@ module Gitlab
# at the end of the event key, e.g. `open.net_ldap`
attach_to :net_ldap
- InstrumentationStorage = ::Gitlab::Instrumentation::Storage
-
COUNTER = :net_ldap_count
DURATION = :net_ldap_duration_s
@@ -28,12 +26,12 @@ module Gitlab
class << self
# @return [Integer] the total number of LDAP requests
def count
- InstrumentationStorage[COUNTER].to_i
+ Gitlab::SafeRequestStore[COUNTER].to_i
end
# @return [Float] the total duration spent on LDAP requests
def duration
- InstrumentationStorage[DURATION].to_f
+ Gitlab::SafeRequestStore[DURATION].to_f
end
# Used in Gitlab::InstrumentationHelper to merge the LDAP stats
@@ -73,10 +71,10 @@ module Gitlab
# Track these events as statistics for the current requests, for logging purposes
def add_to_request_store(event)
- return unless InstrumentationStorage.active?
+ return unless Gitlab::SafeRequestStore.active?
- InstrumentationStorage[COUNTER] = self.class.count + 1
- InstrumentationStorage[DURATION] = self.class.duration + convert_to_seconds(event.duration)
+ Gitlab::SafeRequestStore[COUNTER] = self.class.count + 1
+ Gitlab::SafeRequestStore[DURATION] = self.class.duration + convert_to_seconds(event.duration)
end
# Converts the observed events into Prometheus metrics