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: ca0f848e1d7e64e367a9b92809d4e29cc0fc9f48
4
- data.tar.gz: 2f0effc33fa028932d2b967e93b7d7eb86346076
3
+ metadata.gz: 08db32267957270f87358293679314a435e4101e
4
+ data.tar.gz: 07a10d922c29af634224ebb0765e1214b2f14573
5
5
  SHA512:
6
- metadata.gz: 2ea27189580d87f02d48ac618808bb386472dc762a78699b58018e1ef0e6224ead01c30a672441815b1f107f2166ba9b57847c7bb5ff081dfe7f0dee80ddcc5e
7
- data.tar.gz: 8898d99310f0d992cd85d6fce7f2bcd17abaa977d9e5e442c4ae81ab9c4f7290bc694c8a10535828a8514599d29dafef9f5bf669fbdf9a686d1693c3056ba035
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
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module WorkerStats
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -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
- <% @queues.each do |q| %>
9
- <h4><%= q.capitalize %></h4>
10
- <% if @workers[q].empty? %>
11
- <div>Nothing waiting in queue</div>
12
- <% else %>
13
- <table class="table table-striped table-bordered table-white">
14
- <thead>
15
- <tr>
16
- <th>Name</th>
17
- <th>Count</th>
18
- </tr>
19
- </thead>
20
- <% @workers[q].each do |worker| %>
21
- <tr>
22
- <td><%=worker.first%></td>
23
- <td><%=worker.last%></td>
24
- </tr>
25
- <% end %>
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
- Sidekiq::Queue.all.each do |q|
12
+ @queue.each do |q|
12
13
  @workers[q.name] = {}
13
14
  total = q.map{|cue| cue.klass}
14
15
  klasses = total.uniq
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-worker-stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Stephens