sidekiq_queue_metrics 2.0 → 2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +17 -1
- data/lib/sidekiq_queue_metrics/version.rb +1 -1
- data/lib/sidekiq_queue_metrics/views/queues_stats.erb +22 -2
- data/lib/sidekiq_queue_metrics/web_extension.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee2405a1becb45a02fbe203b1602a67eb7faa7ad8b663521a1d2a5ab6f429fd6
|
4
|
+
data.tar.gz: f02be22ab996b62b4c143d74b23dfbb95f5fe813e1afe9a1e3a6d67e7520a9aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 467a81381a1e6b5662880d573d3aa60eeba108c1ea8eafefae0c31d27a8aa5f441e654250e0ab7438d3cfb8a1a015cf4a419b930279c58ea9573ad5c48aa86ba
|
7
|
+
data.tar.gz: 0033cb5d83bb4dba953898ddde4c4672567098293206479825430ab14da398149681e3dfb7e99af52a26fca0e141115d51bf1a0dc7a39571ba539b51a8386d84
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
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
|
+
[](https://GitHub.com/ajitsing/sidekiq_queue_metrics/graphs/commit-activity)
|
4
5
|
[](https://opensource.org/licenses/MIT)
|
5
6
|
[](https://badge.fury.io/rb/sidekiq_queue_metrics)
|
7
|
+
[](http://hits.dwyl.io/ajitsing/sidekiq_queue_metrics)
|
6
8
|

|
7
9
|
[](https://travis-ci.org/ajitsing/sidekiq_queue_metrics)
|
8
10
|
[](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:
|
@@ -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,
|
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
|
-
|
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.
|
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:
|
11
|
+
date: 2019-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|