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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a277e09b79fa17edf12f018a94a78c66cce4cc13cb4507ec6e8c82266ff4e0f
4
- data.tar.gz: de009b471d90a44f3721e3acad8c6f25cfc3e82d3f0ad72a76e8e7b0bf9e6e45
3
+ metadata.gz: b3eef01acf595b16deb86b2578776e3487b513865fca93ede7684ba982932706
4
+ data.tar.gz: e5194e0230ac9672b9c30fbd1bf1be3b11333d894a21505dd97e39891f72b960
5
5
  SHA512:
6
- metadata.gz: 88bfdd110c7360730d076f24b96681d5b705ab926fa3925b79850bb499cc3247e3566fc132cdb5ae6877d7e533569515dcd00bd7e7b5d7e8c98c0fc77de8104d
7
- data.tar.gz: 2658a7a6f6f735782868b43a9c1b68d3f63fd1d5ace3f8d1553bc471c50bf340f03000daded30012fb86f901f1b94cb029788e45ccbaf22f0e831d1be91fb8de
6
+ metadata.gz: 60c79e4a4e550adf557129aa278986726370e21f77ca5f67864f23fbb181f5c904d02f5015d51d8317c748b9a72b74cfd59a5f14b4a0af0ffce6b03883ceef4a
7
+ data.tar.gz: 5bd99ea95151fd95a5f72597474ec6c81e3fd9e1f0284f5d85b7595257f24cddde5b0a315a6705a6258b8b7d0ebcbe5178f6816978ebc3b2c47a435578d58ee0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-exporter (11.0.1)
4
+ gitlab-exporter (11.1.0)
5
5
  connection_pool (= 2.2.5)
6
6
  pg (= 1.2.3)
7
7
  puma (= 5.3.2)
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
@@ -1,5 +1,5 @@
1
1
  module GitLab
2
2
  module Exporter
3
- VERSION = "11.0.1".freeze
3
+ VERSION = "11.1.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-exporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.1
4
+ version: 11.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Carranza