sidekiq_queue_metrics 2.0 → 2.1

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: 8d104466f165a5787ee101d1a4d4b7e1909d47dafab3f7ea3363454f44a22f27
4
- data.tar.gz: 6eeee50fdc2eedb29aa6adc216b1ede0249b57e49770638fb96300f0400c7b0f
3
+ metadata.gz: ee2405a1becb45a02fbe203b1602a67eb7faa7ad8b663521a1d2a5ab6f429fd6
4
+ data.tar.gz: f02be22ab996b62b4c143d74b23dfbb95f5fe813e1afe9a1e3a6d67e7520a9aa
5
5
  SHA512:
6
- metadata.gz: bd32c75be538976be8659d35016c2d5eaabc36cabd33f2ddf351f4dd3289bd758d67e16f8b9fe912ca615c7167b9b8d683a4ae3278bbf6571f22d21f1fe0f673
7
- data.tar.gz: 8916f90cc120083e3c66a0553b2b6eda9273bcc8a47148c000a7fd981f86f174e3d03094be9f0a8e2c9b0b410917bdf15bf0e3297722ecc561f56d79464492ba
6
+ metadata.gz: 467a81381a1e6b5662880d573d3aa60eeba108c1ea8eafefae0c31d27a8aa5f441e654250e0ab7438d3cfb8a1a015cf4a419b930279c58ea9573ad5c48aa86ba
7
+ data.tar.gz: 0033cb5d83bb4dba953898ddde4c4672567098293206479825430ab14da398149681e3dfb7e99af52a26fca0e141115d51bf1a0dc7a39571ba539b51a8386d84
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  .idea
2
+ *.gem
@@ -6,7 +6,7 @@ GEM
6
6
  diff-lcs (1.3)
7
7
  eldritch (1.1.3)
8
8
  reentrant_mutex (~> 1.1.0)
9
- rack (2.0.5)
9
+ rack (2.0.6)
10
10
  rack-protection (2.0.3)
11
11
  rack
12
12
  redis (4.0.1)
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # sidekiq_queue_metrics
2
2
  Records stats of each sidekiq queue and exposes APIs to retrieve them
3
3
 
4
+ [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/ajitsing/sidekiq_queue_metrics/graphs/commit-activity)
4
5
  [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://opensource.org/licenses/MIT)
5
6
  [![Gem Version](https://badge.fury.io/rb/sidekiq_queue_metrics.svg)](https://badge.fury.io/rb/sidekiq_queue_metrics)
7
+ [![HitCount](http://hits.dwyl.io/ajitsing/sidekiq_queue_metrics.svg)](http://hits.dwyl.io/ajitsing/sidekiq_queue_metrics)
6
8
  ![Gem Downloads](http://ruby-gem-downloads-badge.herokuapp.com/sidekiq_queue_metrics?type=total)
7
9
  [![Build Status](https://travis-ci.org/ajitsing/sidekiq_queue_metrics.svg?branch=master)](https://travis-ci.org/ajitsing/sidekiq_queue_metrics)
8
10
  [![Twitter Follow](https://img.shields.io/twitter/follow/Ajit5ingh.svg?style=social)](https://twitter.com/Ajit5ingh)
@@ -23,10 +25,24 @@ end
23
25
  ```
24
26
 
25
27
  ## Usage
26
- sidekiq_queue_metrics adds a new tab `Queue Metrics` in Sidekiq UI.
28
+ `sidekiq_queue_metrics` adds a new tab `Queue Metrics` in Sidekiq UI. In `Queue Metrics` tab you will see widget of all the queues with latest stats. To checkout individual queue summary click on the queue name. On queue summary page you will see all the stats of the queue along with 50 recently failed jobs. To see the details of the failed job click on the enqueued time column of the failed job row.
29
+
30
+ The failed job count is configuratble. You can configure your desired count using below config.
31
+
32
+ ```ruby
33
+ Sidekiq::QueueMetrics.max_recently_failed_jobs = 100
34
+ ```
27
35
 
28
36
  <img src="https://github.com/ajitsing/ScreenShots/blob/master/sidekiq_queue_metrics/sidekiq_queue_metrics.png"/>
29
37
 
38
+ ### Queue Summary
39
+
40
+ <img src="https://github.com/ajitsing/ScreenShots/blob/master/sidekiq_queue_metrics/queue_summary.png"/>
41
+
42
+ ### Failed Job
43
+
44
+ <img src="https://github.com/ajitsing/ScreenShots/blob/master/sidekiq_queue_metrics/failed_job.png"/>
45
+
30
46
  You can also use the below apis to directly consume the queue metrics.
31
47
 
32
48
  Fetch stats of all queues:
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module QueueMetrics
3
- VERSION = '2.0'
3
+ VERSION = '2.1'
4
4
  end
5
5
  end
@@ -17,6 +17,26 @@
17
17
  font-weight: bold;
18
18
  }
19
19
 
20
+ .animate_processed {
21
+ animation:blinking_processed_text 0.5s 1;
22
+ }
23
+
24
+ .animate_failed {
25
+ animation:blinking_failed_text 0.5s 1;
26
+ }
27
+
28
+ @keyframes blinking_processed_text{
29
+ 0%{background-color: transparent;}
30
+ 50%{background-color: rgba(35, 130, 13, 0.9);}
31
+ 100%{background-color: transparent;}
32
+ }
33
+
34
+ @keyframes blinking_failed_text{
35
+ 0%{background-color: transparent;}
36
+ 50%{background-color: rgba(158, 19, 19, 0.96);}
37
+ 100%{background-color: transparent;}
38
+ }
39
+
20
40
  .failed_count {
21
41
  color: rgba(158, 19, 19, 0.96);
22
42
  font-size: 1.1em;
@@ -46,10 +66,10 @@
46
66
  <th style="width: 30%" class="center"><span class="heading">Count</span></th>
47
67
  </tr>
48
68
  </thead>
49
- <% metrics.each do |metric_name, count| %>
69
+ <% metrics.each do |metric_name, detail| %>
50
70
  <tr>
51
71
  <td><%= metric_name.split('_').map(&:capitalize).join(' ') %></td>
52
- <td class="center"><span class="<%= metric_name %>_count"><%= count %></span></td>
72
+ <td class="center"><span class="<%= metric_name %>_count <%= detail['animate'] ? "animate_#{metric_name}" : "" %>"><%= detail['count'] %></span></td>
53
73
  </tr>
54
74
  <% end %>
55
75
  </table>
@@ -4,7 +4,18 @@ module Sidekiq::QueueMetrics
4
4
  view_path = File.join(File.expand_path("..", __FILE__), "views")
5
5
 
6
6
  app.get "/queue_metrics" do
7
- @queue_metrics = Sidekiq::QueueMetrics.fetch
7
+ queue_metrics = Sidekiq::QueueMetrics.fetch
8
+ @@last_metrics ||= queue_metrics
9
+
10
+ @queue_metrics = queue_metrics.each_with_object({}) do |queue_metric, new_queue_metrics|
11
+ queue, metric = queue_metric
12
+ new_queue_metrics[queue] = metric.each_with_object({}) do |current_metric, updated_metrics|
13
+ name, count = current_metric
14
+ updated_metrics[name] = {'count' => count, 'animate' => @@last_metrics[queue][name] != count}
15
+ end
16
+ end
17
+
18
+ @@last_metrics = queue_metrics
8
19
  render(:erb, File.read(File.join(view_path, "queues_stats.erb")))
9
20
  end
10
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_queue_metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.0'
4
+ version: '2.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ajit Singh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-16 00:00:00.000000000 Z
11
+ date: 2019-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq