diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2018-01-15 22:06:40 +0100 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2018-01-29 15:13:03 +0100 |
commit | d97548daa82ab02884a6eaffe7d9e32d754b3a08 (patch) | |
tree | 456543d3643a527296ba9a09ec4160ef3fb396dc /lib | |
parent | e5d6141541712b6bf2532aa654a5ad499cc26ea1 (diff) | |
download | gitlab-ce-d97548daa82ab02884a6eaffe7d9e32d754b3a08.tar.gz |
cleanup method call
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/metrics/concern.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/metrics/method_call.rb | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/metrics/concern.rb b/lib/gitlab/metrics/concern.rb index 093bd960d02..940337deb74 100644 --- a/lib/gitlab/metrics/concern.rb +++ b/lib/gitlab/metrics/concern.rb @@ -43,12 +43,14 @@ module Gitlab return @@_metric_provider_cached_#{name} if @@_metric_provider_cached_#{name} @@_metrics_provider_mutex.synchronize do - puts "Initiaalized" @@_metric_provider_cached_#{name} ||= #{metric_fetching_code} end end + + def reload_#{name}! + @@_metric_provider_cached_#{name} = nil + end METRIC - puts method_code instance_eval(method_code, __FILE__, line) module_eval(method_code, __FILE__, line) diff --git a/lib/gitlab/metrics/method_call.rb b/lib/gitlab/metrics/method_call.rb index d4698d83a05..5cd5c388fb6 100644 --- a/lib/gitlab/metrics/method_call.rb +++ b/lib/gitlab/metrics/method_call.rb @@ -41,7 +41,7 @@ module Gitlab @call_count += 1 if above_threshold? - gitlab_method_call_duration_seconds.observe(@transaction.labels.merge(labels), real_time) + self.class.gitlab_method_call_duration_seconds.observe(@transaction.labels.merge(labels), real_time) end retval |