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
d2640e4c
Commit
d2640e4c
authored
Dec 16, 2019
by
Aakriti Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ISO time format with 3 fraction digits
This is done to standardize timestamp format in log files
parent
55dd96ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
lib/gitlab/sidekiq_logging/structured_logger.rb
lib/gitlab/sidekiq_logging/structured_logger.rb
+1
-1
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
+5
-5
No files found.
lib/gitlab/sidekiq_logging/structured_logger.rb
View file @
d2640e4c
...
...
@@ -117,7 +117,7 @@ module Gitlab
def
format_time
(
timestamp
)
return
timestamp
if
timestamp
.
is_a?
(
String
)
Time
.
at
(
timestamp
).
utc
.
iso8601
(
6
)
Time
.
at
(
timestamp
).
utc
.
iso8601
(
3
)
end
def
limited_job_args
(
args
)
...
...
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
View file @
d2640e4c
...
...
@@ -4,7 +4,7 @@ require 'fast_spec_helper'
describe
Gitlab
::
SidekiqLogging
::
StructuredLogger
do
describe
'#call'
do
let
(
:timestamp
)
{
Time
.
iso8601
(
'2018-01-01T12:00:00Z'
)
}
let
(
:timestamp
)
{
Time
.
iso8601
(
'2018-01-01T12:00:00
.000
Z'
)
}
let
(
:created_at
)
{
timestamp
-
1
.
second
}
let
(
:scheduling_latency_s
)
{
1.0
}
...
...
@@ -30,8 +30,8 @@ describe Gitlab::SidekiqLogging::StructuredLogger do
'message'
=>
'TestWorker JID-da883554ee4fe414012f5f42: start'
,
'job_status'
=>
'start'
,
'pid'
=>
Process
.
pid
,
'created_at'
=>
created_at
.
iso8601
(
6
),
'enqueued_at'
=>
created_at
.
iso8601
(
6
),
'created_at'
=>
created_at
.
iso8601
(
3
),
'enqueued_at'
=>
created_at
.
iso8601
(
3
),
'scheduling_latency_s'
=>
scheduling_latency_s
)
end
...
...
@@ -40,7 +40,7 @@ describe Gitlab::SidekiqLogging::StructuredLogger do
'message'
=>
'TestWorker JID-da883554ee4fe414012f5f42: done: 0.0 sec'
,
'job_status'
=>
'done'
,
'duration'
=>
0.0
,
"completed_at"
=>
timestamp
.
iso8601
(
6
),
"completed_at"
=>
timestamp
.
iso8601
(
3
),
"cpu_s"
=>
1.111112
)
end
...
...
@@ -145,7 +145,7 @@ describe Gitlab::SidekiqLogging::StructuredLogger do
end
context
'with latency'
do
let
(
:created_at
)
{
Time
.
iso8601
(
'2018-01-01T10:00:00Z'
)
}
let
(
:created_at
)
{
Time
.
iso8601
(
'2018-01-01T10:00:00
.000
Z'
)
}
let
(
:scheduling_latency_s
)
{
7200.0
}
it
'logs with scheduling latency'
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