sidekiq-worker-stats 0.0.1 → 0.0.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08db32267957270f87358293679314a435e4101e
|
4
|
+
data.tar.gz: 07a10d922c29af634224ebb0765e1214b2f14573
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbdae23927fcb82cce672dcc8af3f6c2db0cd77cd952130f44ef79f29d7a5e2fd03d16c0db4733f88c6b1bf528f6f650f578512a493483bdb7aab86398d27a1a
|
7
|
+
data.tar.gz: 41b09daf7ff631672295cb072833d1e4916e1672612915738e7070e451868257302cee106c1fbc3b9ccd561cdb603bcc7a89b4b674a65f0620bcc4e5be2d905c
|
data/README.md
CHANGED
@@ -17,6 +17,7 @@ gem 'sidekiq-worker-stats'
|
|
17
17
|
Simply having the gem in your Gemfile is enough to get you started. Your
|
18
18
|
job count will be visible via a Worker Stats tab in the Web UI.
|
19
19
|
|
20
|
+
![Web UI](http://i.imgur.com/aCPB1YS.png)
|
20
21
|
## Dependencies
|
21
22
|
|
22
23
|
Depends on Sidekiq >= 2.16.0
|
@@ -4,25 +4,35 @@
|
|
4
4
|
</div>
|
5
5
|
</header>
|
6
6
|
|
7
|
+
<div class="dropdown pull-right">
|
8
|
+
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
9
|
+
Queues
|
10
|
+
<span class="caret"></span>
|
11
|
+
</button>
|
12
|
+
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
|
13
|
+
<% @queues.each do |q| %>
|
14
|
+
<li><a href=<%="?queue=#{q.downcase}"%>><%= q.capitalize %></a></li>
|
15
|
+
<% end %>
|
16
|
+
</ul>
|
17
|
+
</div>
|
18
|
+
|
7
19
|
<%= csrf_tag if respond_to?(:csrf_tag) %>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<
|
14
|
-
<
|
15
|
-
<
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
</table>
|
27
|
-
<% end %>
|
20
|
+
<h4><%= @queue.name.capitalize %></h4>
|
21
|
+
<% if @workers[@queue.name].nil? %>
|
22
|
+
<div class="alert alert-success">Nothing waiting in queue</div>
|
23
|
+
<% else %>
|
24
|
+
<table class="table table-striped table-bordered table-white">
|
25
|
+
<thead>
|
26
|
+
<tr>
|
27
|
+
<th>Name</th>
|
28
|
+
<th>Count</th>
|
29
|
+
</tr>
|
30
|
+
</thead>
|
31
|
+
<% @workers[@queue.name].each do |worker| %>
|
32
|
+
<tr>
|
33
|
+
<td><%=worker.first%></td>
|
34
|
+
<td><%=worker.last%></td>
|
35
|
+
</tr>
|
36
|
+
<% end %>
|
37
|
+
</table>
|
28
38
|
<% end %>
|
@@ -7,8 +7,9 @@ module Sidekiq
|
|
7
7
|
|
8
8
|
app.get "/worker_stats" do
|
9
9
|
@queues = Sidekiq::Queue.all.map(&:name)
|
10
|
+
@queue = params[:queue] ? Sidekiq::Queue.new(params[:queue]) : Sidekiq::Queue.new
|
10
11
|
@workers = {}
|
11
|
-
|
12
|
+
@queue.each do |q|
|
12
13
|
@workers[q.name] = {}
|
13
14
|
total = q.map{|cue| cue.klass}
|
14
15
|
klasses = total.uniq
|