diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
commit | 983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch) | |
tree | b153cd387c14ba23bd5a07514c7c01fddf6a78a0 /lib/gitlab/grape_logging | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'lib/gitlab/grape_logging')
-rw-r--r-- | lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/grape_logging/loggers/queue_duration_logger.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb b/lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb index 045a341f2ed..ac149cadb5b 100644 --- a/lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb +++ b/lib/gitlab/grape_logging/formatters/lograge_with_timestamp.rb @@ -15,9 +15,9 @@ module Gitlab attributes = { time: datetime.utc.iso8601(3), severity: severity, - duration: time[:total], - db: time[:db], - view: time[:view] + duration_s: Gitlab::Utils.ms_to_round_sec(time[:total]), + db_duration_s: Gitlab::Utils.ms_to_round_sec(time[:db]), + view_duration_s: Gitlab::Utils.ms_to_round_sec(time[:view]) }.merge!(data) ::Lograge.formatter.call(attributes) << "\n" diff --git a/lib/gitlab/grape_logging/loggers/queue_duration_logger.rb b/lib/gitlab/grape_logging/loggers/queue_duration_logger.rb index 705e23adff2..fe741a5bbe8 100644 --- a/lib/gitlab/grape_logging/loggers/queue_duration_logger.rb +++ b/lib/gitlab/grape_logging/loggers/queue_duration_logger.rb @@ -18,9 +18,9 @@ module Gitlab return {} unless proxy_start && start_time # Time in milliseconds since gitlab-workhorse started the request - duration = (start_time.to_f * 1_000 - proxy_start.to_f / 1_000_000).round(2) + duration = start_time.to_f * 1_000 - proxy_start.to_f / 1_000_000 - { 'queue_duration': duration } + { 'queue_duration_s': Gitlab::Utils.ms_to_round_sec(duration) } end end end |