diff options
author | Stan Hu <stanhu@gmail.com> | 2019-03-27 13:56:36 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-03-27 14:01:21 +0300 |
commit | 74ff33a3fdb83cd03c41436b4ae10ca48075f0e9 (patch) | |
tree | 6104d45c38d0588c7c938eb83b976235b0d4a1db /lib/gitlab/grape_logging | |
parent | 0610bb091766d3bb935fc10898dd66bc6f76b1c5 (diff) |
Log Gitaly RPC duration to api_json.log and production_json.log
This makes it easier to debug Gitaly performance issues in the field.
This commit also makes the tracking of query time thread-safe via
RequestStore.
Diffstat (limited to 'lib/gitlab/grape_logging')
-rw-r--r-- | lib/gitlab/grape_logging/loggers/perf_logger.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/grape_logging/loggers/perf_logger.rb b/lib/gitlab/grape_logging/loggers/perf_logger.rb index e3b9c59bd6e..18ea3a8d2f3 100644 --- a/lib/gitlab/grape_logging/loggers/perf_logger.rb +++ b/lib/gitlab/grape_logging/loggers/perf_logger.rb @@ -6,7 +6,10 @@ module Gitlab module Loggers class PerfLogger < ::GrapeLogging::Loggers::Base def parameters(_, _) - { gitaly_calls: Gitlab::GitalyClient.get_request_count } + { + gitaly_calls: Gitlab::GitalyClient.get_request_count, + gitaly_duration: Gitlab::GitalyClient.query_time_ms + } end end end |