summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-10-31 23:20:07 +0100
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2017-11-01 10:19:55 +0100
commit9936ae26b350d556c01c6d6ffeec70d6068b26a7 (patch)
tree310eb8c87ee81bf5241051436195b7135b22ad66 /lib
parent0134079430f0179c527d388539c0986352bca9bd (diff)
downloadgitlab-ce-9936ae26b350d556c01c6d6ffeec70d6068b26a7.tar.gz
Measure Gitaly migration sites against original
We were missing data for Gitaly migration call sites against the original implementation. This commit adds a histogram with a flag telling us if gitaly received the call or the original implementation did.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/gitaly_client.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index 6868be26758..0b35a787e07 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -34,10 +34,11 @@ module Gitlab
private_constant :MUTEX
class << self
- attr_accessor :query_time
+ attr_accessor :query_time, :migrate_histogram
end
self.query_time = 0
+ self.migrate_histogram = Gitlab::Metrics.histogram(:gitaly_migrate_call_duration, "Gitaly migration call execution timings")
def self.stub(name, storage)
MUTEX.synchronize do
@@ -171,8 +172,11 @@ module Gitlab
feature_stack = Thread.current[:gitaly_feature_stack] ||= []
feature_stack.unshift(feature)
begin
+ start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield is_enabled
ensure
+ total_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
+ migrate_histogram.observe({ gitaly_enabled: is_enabled, feature: feature }, total_time)
feature_stack.shift
Thread.current[:gitaly_feature_stack] = nil if feature_stack.empty?
end