sidekiq-worker-stats 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -4
- data/Gemfile +1 -0
- data/lib/sidekiq/worker_stats/version.rb +1 -1
- data/lib/sidekiq/worker_stats/views/worker_stats.erb +22 -22
- data/lib/sidekiq/worker_stats/web_extension.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2acf9694cc59e265871dfe3dbbf2999190b240d
|
4
|
+
data.tar.gz: 7643b8d0cda97c9a5c9230606e986cd6301f124e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fd4ffc5243f146a74f819ea77634b62214de66c1549a15e1f761b12da218ce6a67c28ee302f5dd7251d747739d53bd7c9e6812ec302e84e5aa2813259db141e
|
7
|
+
data.tar.gz: 03836d89418b16d51e3805331ca57e6a33c87e32ca5aadc46a5c81cdd41b1bed32dfda5aa00e4159da98c3502879adf4a39e6c3de22baf425ed080da658bf5ca
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -18,37 +18,17 @@
|
|
18
18
|
</div>
|
19
19
|
|
20
20
|
<%= csrf_tag if respond_to?(:csrf_tag) %>
|
21
|
-
<h4><%= @queue.name.capitalize %></h4>
|
22
|
-
<% if @workers[@queue.name].nil? %>
|
23
|
-
<div class="alert alert-success">Nothing waiting in queue</div>
|
24
|
-
<% else %>
|
25
|
-
<table class="table table-striped table-bordered table-white">
|
26
|
-
<thead>
|
27
|
-
<tr>
|
28
|
-
<th>Name</th>
|
29
|
-
<th>Count</th>
|
30
|
-
</tr>
|
31
|
-
</thead>
|
32
|
-
<% @workers[@queue.name].each do |worker| %>
|
33
|
-
<tr>
|
34
|
-
<td><%=worker.first%></td>
|
35
|
-
<td><%=worker.last%></td>
|
36
|
-
</tr>
|
37
|
-
<% end %>
|
38
|
-
</table>
|
39
|
-
<% end %>
|
40
|
-
|
41
21
|
<% if params[:queue] == "all" %>
|
42
22
|
<% @queues.each do |q| %>
|
43
23
|
<h4><%= q.capitalize %></h4>
|
44
|
-
<% if @workers[q].
|
24
|
+
<% if @workers[q].empty? %>
|
45
25
|
<div class="alert alert-success">Nothing waiting in queue</div>
|
46
26
|
<% else %>
|
47
27
|
<table class="table table-striped table-bordered table-white">
|
48
28
|
<thead>
|
49
29
|
<tr>
|
50
30
|
<th>Name</th>
|
51
|
-
<th>Count</th>
|
31
|
+
<th style="width: 150px">Count</th>
|
52
32
|
</tr>
|
53
33
|
</thead>
|
54
34
|
<% @workers[q].each do |worker| %>
|
@@ -60,4 +40,24 @@
|
|
60
40
|
</table>
|
61
41
|
<% end %>
|
62
42
|
<% end %>
|
43
|
+
<% else %>
|
44
|
+
<h4><%= @queue.name.capitalize %></h4>
|
45
|
+
<% if @workers[@queue].nil? %>
|
46
|
+
<div class="alert alert-success">Nothing waiting in queue</div>
|
47
|
+
<% else %>
|
48
|
+
<table class="table table-striped table-bordered table-white">
|
49
|
+
<thead>
|
50
|
+
<tr>
|
51
|
+
<th>Name</th>
|
52
|
+
<th style="width: 150px">Count</th>
|
53
|
+
</tr>
|
54
|
+
</thead>
|
55
|
+
<% @workers[@queue.name].each do |worker| %>
|
56
|
+
<tr>
|
57
|
+
<td><%=worker.first%></td>
|
58
|
+
<td><%=worker.last%></td>
|
59
|
+
</tr>
|
60
|
+
<% end %>
|
61
|
+
</table>
|
62
|
+
<% end %>
|
63
63
|
<% end %>
|
@@ -7,7 +7,6 @@ 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
|
11
10
|
@workers = {}
|
12
11
|
|
13
12
|
if params[:queue] == "all"
|
@@ -20,12 +19,13 @@ module Sidekiq
|
|
20
19
|
end
|
21
20
|
end
|
22
21
|
else
|
23
|
-
@queue.
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
@queue = params[:queue] ? Sidekiq::Queue.new(params[:queue]) : Sidekiq::Queue.new
|
23
|
+
@workers[@queue.name] = {}
|
24
|
+
total = @queue.map{|cue| cue.klass}
|
25
|
+
klasses = total.uniq
|
26
|
+
if klasses
|
27
27
|
klasses.each do |klass|
|
28
|
-
@workers[
|
28
|
+
@workers[@queue.name][klass] = total.count(klass)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|