yabeda-sidekiq 0.2.0 → 0.5.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: 4c513f6e9028c0bc3a385488105d314a5c7e7ba9ef795bcbd07895d21fe80c8a
4
- data.tar.gz: d76ba8c2d976a4ba2356713fc40b9c8ed7720aa8ddd15adc08f5d338a8d06604
3
+ metadata.gz: 56cc207100137641a1ba2cd7151f411473a003623f4316f470c9cab2734b0c46
4
+ data.tar.gz: ab292a2728a35ab4ed163f9d77e4260d33944052fb384c93895fceddcdd63876
5
5
  SHA512:
6
- metadata.gz: f99e5b2d9a108a659affa0f14d3b0528377485616b6213f2f06eb0c2744d2c6e9d97051a0f56ee4aa1757b1ee4109bda42fd7c66b23f656b4764ce7c06ac039e
7
- data.tar.gz: 916fe6c0019e72bbe444cc75a5d3ec8ab27d174eb688e7de121f31b80a1280b522c5c0902dd5839946cd9d3ef9387704126cce295171889b72b0ffc998a8b796
6
+ metadata.gz: 225fdd8793b40a5efc4ae7a476e90e142cf2a1b8b790d395262d76f7a7ad8f73d7f9969f7cfe7dcb87359eee272bfa9ab5dac08b7ff477961814f70daa81f676
7
+ data.tar.gz: 7673942008c4c0b83d57fa681016f6b4238107f3c355165fa616191a9a6f8d339828830d3e7fff03d9f3d80e67a1f657756459d87aecd0681547ba6060b2fe7e
data/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 0.5.0 - 2020-02-20
9
+
10
+ ### Added
11
+
12
+ - New `sidekiq_job_latency` histogram to track latency statistics of different job classes. [#9](https://github.com/yabeda-rb/yabeda-sidekiq/pull/9) by [@asusikov]
13
+
14
+ ### Changed
15
+
16
+ - **BREAKING CHANGE!** Renamed `sidekiq_jobs_latency` gauge to `sidekiq_queue_latency` to better describe its purpose and differentiate with the new histogram. [#9](https://github.com/yabeda-rb/yabeda-sidekiq/pull/9) by [@asusikov]
17
+
8
18
  ## 0.2.0 - 2020-01-14
9
19
 
10
20
  ### Changed
@@ -40,3 +50,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
40
50
  - Initial release of evil-metrics-sidekiq gem. @Envek
41
51
 
42
52
  [@dsalahutdinov]: https://github.com/dsalahutdinov "Salahutdinov Dmitry"
53
+ [@asusikov]: https://github.com/asusikov "Alexander Susikov"
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Built-in metrics for [Sidekiq] monitoring out of the box! Part of the [yabeda] suite.
4
4
 
5
+ Sample Grafana dashboard ID: [11667](https://grafana.com/grafana/dashboards/11667)
6
+
5
7
  ## Installation
6
8
 
7
9
  ```ruby
@@ -31,7 +33,8 @@ end
31
33
  - Number of jobs have been finished successfully: `sidekiq_jobs_success_total` (segmented by queue and class name)
32
34
  - Number of jobs have been failed: `sidekiq_jobs_failed_total` (segmented by queue and class name)
33
35
  - Time of job run: `sidekiq_job_runtime` (seconds per job execution, segmented by queue and class name)
34
- - Time of the queue latency `sidekiq_jobs_latency` (the difference in seconds since the oldest job in the queue was enqueued)
36
+ - Time of the queue latency `sidekiq_queue_latency` (the difference in seconds since the oldest job in the queue was enqueued)
37
+ - Time of the job latency `sidekiq_job_latency` (the difference in seconds since the enqueuing until running job)
35
38
  - Number of jobs in queues: `sidekiq_jobs_waiting_count` (segmented by queue)
36
39
  - Number of scheduled jobs:`sidekiq_jobs_scheduled_count`
37
40
  - Number of jobs in retry set: `sidekiq_jobs_retry_count`
@@ -32,8 +32,12 @@ module Yabeda
32
32
  gauge :jobs_retry_count, tags: [], comment: "The number of failed jobs waiting to be retried"
33
33
  gauge :jobs_dead_count, tags: [], comment: "The number of jobs exceeded their retry count."
34
34
  gauge :active_processes, tags: [], comment: "The number of active Sidekiq worker processes."
35
- gauge :jobs_latency, tags: %i[queue], comment: "The job latency, the difference in seconds since the oldest job in the queue was enqueued"
35
+ gauge :queue_latency, tags: %i[queue], comment: "The queue latency, the difference in seconds since the oldest job in the queue was enqueued"
36
36
 
37
+ histogram :job_latency, comment: "The job latency, the difference in seconds between enqueued and running time",
38
+ unit: :seconds, per: :job,
39
+ tags: %i[queue worker],
40
+ buckets: LONG_RUNNING_JOB_RUNTIME_BUCKETS
37
41
  histogram :job_runtime, comment: "A histogram of the job execution time.",
38
42
  unit: :seconds, per: :job,
39
43
  tags: %i[queue worker],
@@ -52,7 +56,7 @@ module Yabeda
52
56
  sidekiq_jobs_retry_count.set({}, stats.retry_size)
53
57
 
54
58
  ::Sidekiq::Queue.all.each do |queue|
55
- sidekiq_jobs_latency.set({ queue: queue.name }, queue.latency)
59
+ sidekiq_queue_latency.set({ queue: queue.name }, queue.latency)
56
60
  end
57
61
 
58
62
  # That is quite slow if your retry set is large
@@ -8,6 +8,8 @@ module Yabeda
8
8
  labels = Yabeda::Sidekiq.labelize(worker, job, queue)
9
9
  start = Time.now
10
10
  begin
11
+ job_instance = ::Sidekiq::Job.new(job)
12
+ Yabeda.sidekiq_job_latency.measure(labels, job_instance.latency)
11
13
  yield
12
14
  Yabeda.sidekiq_jobs_success_total.increment(labels)
13
15
  rescue Exception # rubocop: disable Lint/RescueException
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yabeda
4
4
  module Sidekiq
5
- VERSION = "0.2.0"
5
+ VERSION = "0.5.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yabeda-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-14 00:00:00.000000000 Z
11
+ date: 2020-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yabeda