sidekiq-job-stats 0.1.2 → 0.1.4
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/Gemfile.lock +1 -1
- data/lib/sidekiq_job_stats/middleware.rb +3 -3
- data/lib/sidekiq_job_stats/version.rb +1 -1
- data/lib/web/views/job_histories.erb +60 -26
- data/lib/web/views/job_stats.erb +21 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afde023b391c1dfda3aca053cb913865565e585cce1c8ae54eba4b425ef22af9
|
4
|
+
data.tar.gz: 50e53c32fc5c466b51f052422410a42f26aa31f85289460acf092954db52543d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b394dfc1c643313f5c10fbcba0c1c1927f5fe4d0943f5f9a4a3c4fed23050620a0a5885dd35fce7849ed8cb340d8fe2b2c13c6dfc98679050b70da04af4c3122
|
7
|
+
data.tar.gz: 6aa3b0f88a8173a953bf31e52de248e64d2f4017898f0e33d89ff1e83b90238480620f096b84eddadbe0143f260312ad990c430abd5e30d96c07aa6cfda6998b
|
data/Gemfile.lock
CHANGED
@@ -7,12 +7,12 @@ module SidekiqJobStats
|
|
7
7
|
class Middleware
|
8
8
|
include Sidekiq::Component
|
9
9
|
|
10
|
-
def call(
|
10
|
+
def call(worker, msg, queue)
|
11
11
|
data = {
|
12
12
|
enqueued_at: msg['enqueued_at'], started_at: Time.now, payload: msg['args'], status: 'success',
|
13
|
-
exception: '', queue: queue
|
13
|
+
exception: '', queue: queue, process: worker._context.config.fetch(:identity), tags: msg['tags']
|
14
14
|
}
|
15
|
-
|
15
|
+
|
16
16
|
begin
|
17
17
|
yield
|
18
18
|
rescue StandardError => e
|
@@ -1,3 +1,24 @@
|
|
1
|
+
<style>
|
2
|
+
table {
|
3
|
+
text-align: left;
|
4
|
+
position: relative;
|
5
|
+
border-collapse: separate;
|
6
|
+
border-spacing: 0;
|
7
|
+
}
|
8
|
+
|
9
|
+
th {
|
10
|
+
position: sticky;
|
11
|
+
top: 0;
|
12
|
+
background-color: #F9F8F8;
|
13
|
+
border-bottom: 1px solid #EB9486;
|
14
|
+
}
|
15
|
+
|
16
|
+
.fixTableHead {
|
17
|
+
max-height: 500px;
|
18
|
+
overflow: auto;
|
19
|
+
}
|
20
|
+
</style>
|
21
|
+
|
1
22
|
<h1>Sidekiq Job Histories</h1>
|
2
23
|
|
3
24
|
<p class="intro">
|
@@ -5,38 +26,51 @@
|
|
5
26
|
</p>
|
6
27
|
<h2><%= @job_class.job_class.to_s %></h2>
|
7
28
|
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
</
|
29
|
+
<div class="fixTableHead">
|
30
|
+
<table class="table table-hover table-bordered table-striped">
|
31
|
+
<thead>
|
32
|
+
<tr>
|
33
|
+
<th class="header">Process</th>
|
34
|
+
<th class="header">Enqueued time</th>
|
35
|
+
<th class="header">Started at</th>
|
36
|
+
<th class="header">Finished at</th>
|
37
|
+
<th class="header">Duration</th>
|
38
|
+
<th class="header">Arguments</th>
|
39
|
+
<th class="header">Success</th>
|
40
|
+
<th class="header">Exception</th>
|
41
|
+
</tr>
|
42
|
+
</thead>
|
43
|
+
<tbody>
|
44
|
+
<% @histories.each do |history| %>
|
45
|
+
<% if history.is_a? Hash %>
|
46
|
+
<tr>
|
47
|
+
<td>
|
48
|
+
<%= history["process"] %>
|
49
|
+
<% Array(history["tags"]).each do |tag| %>
|
50
|
+
<span class="label label-info jobtag"><%= tag %></span>
|
51
|
+
<% end %>
|
52
|
+
</td>
|
53
|
+
<td><span class="time"><%= Time.at(history["enqueued_at"]) %></span></td>
|
54
|
+
<td><span class="time"><%= history["started_at"] %></span></td>
|
55
|
+
<td><span class="time"><%= history["finished_at"]%></span></td>
|
56
|
+
<td><%= history["duration"] %>s</td>
|
57
|
+
<td><div class="args"><%= history["payload"] %></div></td>
|
58
|
+
<td><%= history["status"] %></td>
|
59
|
+
<td><%= history["exception"] if history["exception"] %></td>
|
60
|
+
</tr>
|
61
|
+
<% end %>
|
62
|
+
<% end %>
|
63
|
+
</tbody>
|
64
|
+
</table>
|
65
|
+
</div>
|
32
66
|
|
33
67
|
<%if @start > 0 || @start + @limit <= @size %>
|
34
68
|
<p class='pagination'>
|
35
69
|
<% if @start - @limit >= 0 %>
|
36
|
-
<a href="
|
70
|
+
<a href="<%= root_path %><%= request.path_info %>?start=<%= [0, @start - @limit].max %>&limit=<%= @limit %>" class='less'>« less</a>
|
37
71
|
<% end %>
|
38
72
|
<% if @start + @limit <= @size %>
|
39
|
-
<a href="
|
73
|
+
<a href="<%= root_path %><%= request.path_info %>?start=<%= @start + @limit %>&limit=<%= @limit %>" class='more'>more »</a>
|
40
74
|
<% end %>
|
41
75
|
</p>
|
42
76
|
<%end%>
|
data/lib/web/views/job_stats.erb
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
<style>
|
2
|
+
table {
|
3
|
+
text-align: left;
|
4
|
+
position: relative;
|
5
|
+
border-collapse: separate;
|
6
|
+
border-spacing: 0;
|
7
|
+
}
|
8
|
+
|
9
|
+
th {
|
10
|
+
position: sticky;
|
11
|
+
top: 0;
|
12
|
+
background-color: #F9F8F8;
|
13
|
+
border-bottom: 1px solid #EB9486;
|
14
|
+
}
|
15
|
+
|
16
|
+
.fixTableHead {
|
17
|
+
max-height: 500px;
|
18
|
+
overflow: auto;
|
19
|
+
}
|
20
|
+
</style>
|
1
21
|
|
2
22
|
<h1>Sidekiq Job Stats</h1>
|
3
23
|
|
@@ -28,7 +48,7 @@
|
|
28
48
|
<tr>
|
29
49
|
<td>
|
30
50
|
<%= job.name %>
|
31
|
-
<a href='<%= "
|
51
|
+
<a href='<%= "#{root_path}job_stats/job_history/#{job.name}" %>'>[history]</a>
|
32
52
|
</td>
|
33
53
|
<%= display_stat(job, :jobs_enqueued, :number_display) %>
|
34
54
|
<%= display_stat(job, :jobs_performed_day, :number_display) %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-job-stats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- isliusar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
rubygems_version: 3.
|
93
|
+
rubygems_version: 3.5.11
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Tracks jobs performed, failed, and the duration of the last 100 jobs for
|