summaryrefslogtreecommitdiff
path: root/lib/gitlab/grape_logging/loggers/perf_logger.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/grape_logging/loggers/perf_logger.rb')
-rw-r--r--lib/gitlab/grape_logging/loggers/perf_logger.rb27
1 files changed, 4 insertions, 23 deletions
diff --git a/lib/gitlab/grape_logging/loggers/perf_logger.rb b/lib/gitlab/grape_logging/loggers/perf_logger.rb
index 7e86b35a215..ca4a702cb94 100644
--- a/lib/gitlab/grape_logging/loggers/perf_logger.rb
+++ b/lib/gitlab/grape_logging/loggers/perf_logger.rb
@@ -5,30 +5,11 @@ module Gitlab
module GrapeLogging
module Loggers
class PerfLogger < ::GrapeLogging::Loggers::Base
- def parameters(_, _)
- gitaly_data.merge(rugged_data)
- end
-
- def gitaly_data
- gitaly_calls = Gitlab::GitalyClient.get_request_count
+ include ::Gitlab::InstrumentationHelper
- return {} if gitaly_calls.zero?
-
- {
- gitaly_calls: Gitlab::GitalyClient.get_request_count,
- gitaly_duration: Gitlab::GitalyClient.query_time_ms
- }
- end
-
- def rugged_data
- rugged_calls = Gitlab::RuggedInstrumentation.query_count
-
- return {} if rugged_calls.zero?
-
- {
- rugged_calls: rugged_calls,
- rugged_duration_ms: Gitlab::RuggedInstrumentation.query_time_ms
- }
+ def parameters(_, _)
+ payload = {}
+ payload.tap { add_instrumentation_data(payload) }
end
end
end