Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gitlab-org
gitlab-exporter
Commits
14791a4c
Unverified
Commit
14791a4c
authored
Jul 20, 2021
by
Craig Miskell
Browse files
Better style code
parent
408bee66
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/gitlab_exporter/sidekiq.rb
View file @
14791a4c
...
...
@@ -85,9 +85,8 @@ module GitLab
# Default to 0; if all jobs are due in the future, there is no "negative" delay.
delay
=
0
entry
=
conn
.
zrangebyscore
(
set
,
"-inf"
,
now
.
to_s
,
limit:
[
0
,
1
],
withscores:
true
).
first
# entry[0] is the job as JSON, entry[1] is the score (timestamp) when it should execute
delay
=
now
-
entry
[
1
]
if
entry
_job
,
timestamp
=
conn
.
zrangebyscore
(
set
,
"-inf"
,
now
.
to_s
,
limit:
[
0
,
1
],
withscores:
true
).
first
delay
=
now
-
timestamp
if
timestamp
@metrics
.
add
(
"sidekiq_
#{
set
}
_set_processing_delay_seconds"
,
delay
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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