gitlab-exporter 11.0.1 → 11.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -3
- data/lib/gitlab_exporter/sidekiq.rb +22 -0
- data/lib/gitlab_exporter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3eef01acf595b16deb86b2578776e3487b513865fca93ede7684ba982932706
|
4
|
+
data.tar.gz: e5194e0230ac9672b9c30fbd1bf1be3b11333d894a21505dd97e39891f72b960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60c79e4a4e550adf557129aa278986726370e21f77ca5f67864f23fbb181f5c904d02f5015d51d8317c748b9a72b74cfd59a5f14b4a0af0ffce6b03883ceef4a
|
7
|
+
data.tar.gz: 5bd99ea95151fd95a5f72597474ec6c81e3fd9e1f0284f5d85b7595257f24cddde5b0a315a6705a6258b8b7d0ebcbe5178f6816978ebc3b2c47a435578d58ee0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -34,7 +34,7 @@ metrics.
|
|
34
34
|
`git_pull_time_milliseconds`, `git_push_time_milliseconds`
|
35
35
|
* git processes stats (see Process below)
|
36
36
|
1. [Sidekiq](lib/gitlab_exporter/sidekiq.rb)
|
37
|
-
* Stats
|
37
|
+
* Stats (probe_stats)
|
38
38
|
* `sidekiq_jobs_processed_total`
|
39
39
|
* `sidekiq_jobs_failed_total`
|
40
40
|
* `sidekiq_jobs_enqueued_size`
|
@@ -44,14 +44,21 @@ metrics.
|
|
44
44
|
* `sidekiq_default_queue_latency_seconds`
|
45
45
|
* `sidekiq_processes_size`
|
46
46
|
* `sidekiq_workers_size`
|
47
|
-
* Queues
|
47
|
+
* Queues (probe_queues)
|
48
48
|
* `sidekiq_queue_size`
|
49
49
|
* `sidekiq_queue_paused`
|
50
50
|
* `sidekiq_queue_latency_seconds`
|
51
|
-
* Jobs
|
51
|
+
* Jobs (probe_jobs_limit)
|
52
52
|
* `sidekiq_enqueued_jobs`
|
53
|
+
* Workers (probe_workers)
|
53
54
|
* `sidekiq_running_jobs`
|
55
|
+
* Retries (probe_retries)
|
54
56
|
* `sidekiq_to_be_retried_jobs`
|
57
|
+
* Future Sets (probe_future_sets)
|
58
|
+
* `sidekiq_schedule_set_processing_delay_seconds`
|
59
|
+
* `sidekiq_schedule_set_backlog_count`
|
60
|
+
* `sidekiq_retry_set_processing_delay_seconds`
|
61
|
+
* `sidekiq_retry_set_backlog_count`
|
55
62
|
|
56
63
|
### Setup with GitLab Development Kit
|
57
64
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "sidekiq/api"
|
2
|
+
require "sidekiq/scheduled"
|
2
3
|
require "digest"
|
3
4
|
|
4
5
|
module GitLab
|
@@ -76,6 +77,27 @@ module GitLab
|
|
76
77
|
self
|
77
78
|
end
|
78
79
|
|
80
|
+
def probe_future_sets
|
81
|
+
now = Time.now.to_f
|
82
|
+
with_sidekiq do
|
83
|
+
Sidekiq.redis do |conn|
|
84
|
+
Sidekiq::Scheduled::SETS.each do |set|
|
85
|
+
# Default to 0; if all jobs are due in the future, there is no "negative" delay.
|
86
|
+
delay = 0
|
87
|
+
|
88
|
+
_job, timestamp = conn.zrangebyscore(set, "-inf", now.to_s, limit: [0, 1], withscores: true).first
|
89
|
+
delay = now - timestamp if timestamp
|
90
|
+
|
91
|
+
@metrics.add("sidekiq_#{set}_set_processing_delay_seconds", delay)
|
92
|
+
|
93
|
+
# zcount is O(log(N)) (prob. binary search), so is still quick even with large sets
|
94
|
+
@metrics.add("sidekiq_#{set}_set_backlog_count",
|
95
|
+
conn.zcount(set, "-inf", now.to_s))
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
79
101
|
# Count worker classes present in Sidekiq queues. This only looks at the
|
80
102
|
# first PROBE_JOBS_LIMIT jobs in each queue. This means that we run a
|
81
103
|
# single LRANGE command for each queue, which does not block other
|