Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a95cb2b3
Commit
a95cb2b3
authored
Aug 09, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
0fe56995
9e19125f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
lib/gitlab/sidekiq_logging/structured_logger.rb
lib/gitlab/sidekiq_logging/structured_logger.rb
+5
-1
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
+2
-2
No files found.
lib/gitlab/sidekiq_logging/structured_logger.rb
View file @
a95cb2b3
...
...
@@ -39,7 +39,7 @@ module Gitlab
# Old gitlab-shell messages don't provide enqueued_at/created_at attributes
enqueued_at
=
payload
[
'enqueued_at'
]
||
payload
[
'created_at'
]
if
enqueued_at
payload
[
'scheduling_latency_s'
]
=
elapsed
(
Time
.
iso8601
(
enqueued_at
).
to_f
)
payload
[
'scheduling_latency_s'
]
=
elapsed
_by_absolute_time
(
Time
.
iso8601
(
enqueued_at
)
)
end
payload
...
...
@@ -89,6 +89,10 @@ module Gitlab
end
end
def
elapsed_by_absolute_time
(
start
)
(
Time
.
now
.
utc
-
start
).
to_f
.
round
(
3
)
end
def
elapsed
(
start
)
(
current_time
-
start
).
round
(
3
)
end
...
...
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
View file @
a95cb2b3
...
...
@@ -3,8 +3,8 @@ require 'spec_helper'
describe
Gitlab
::
SidekiqLogging
::
StructuredLogger
do
describe
'#call'
do
let
(
:timestamp
)
{
Time
.
iso8601
(
'2018-01-01T12:00:00Z'
)
}
let
(
:created_at
)
{
timestamp
}
let
(
:scheduling_latency_s
)
{
0
.0
}
let
(
:created_at
)
{
timestamp
-
1
.
second
}
let
(
:scheduling_latency_s
)
{
1
.0
}
let
(
:job
)
do
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment