sidekiq-job-stats 0.1.3 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a9c59fdf15817dade5f214b29918eea19c39f00aa8cbb845d0d9dd3d9ddbf69
4
- data.tar.gz: f9a6a773c72aaa741448634cd1fb32c182c450edc0abd01c903b46493e37a038
3
+ metadata.gz: 53b68fe03b60e6aaa250f2e53e5a5a0e85ec00b76f89c29c8b772afe0105b8b6
4
+ data.tar.gz: 50c97eb9b3039c04df331d798a74e5b42732d7adcfed0a5e5ddb0ac9bbc8bde5
5
5
  SHA512:
6
- metadata.gz: 1f69e4a9832aabcfd8cf0c8ee096f6ee00efb39a897ff9966142088284489f14269cb75402f8dcbf4c8b1ae60b39ae5b4c20ad927658b8b698cabe95f3283d4f
7
- data.tar.gz: 70d698eede5595eed2e0e7aab0794e11becc7744359d00c9e84106fae389fb63cddc005e97c32929c63d64107e7e5b4c885c555898a28fe008d5c71af963fe3d
6
+ metadata.gz: 40bdebcc0a1ec348cb690b5b20bd5c873ff670bd93f31e234773def70ca0c693fabfac9e231c204bb161be7279713ec2013beed3a0773deced2c765cae0a3d7c
7
+ data.tar.gz: 26689b7507f9fef00d53e2b4478951a85420f78ff84a41b947255fa0637c926747b6334ed0ede85b9844a83c1fd45eaa81e646362a332e59c1faa9eec16fd938
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sidekiq-job-stats (0.1.3)
4
+ sidekiq-job-stats (0.1.5)
5
5
  get_process_mem
6
6
  sidekiq (>= 6)
7
7
 
@@ -7,12 +7,12 @@ module SidekiqJobStats
7
7
  class Middleware
8
8
  include Sidekiq::Component
9
9
 
10
- def call(_worker, msg, queue)
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,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqJobStats
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.5"
5
5
  end
@@ -16,8 +16,9 @@ module SidekiqJobStats
16
16
  end
17
17
 
18
18
  app.get '/job_stats/job_history/:job_class' do
19
- @job_class = SidekiqJobStats::Statistic.find_all.find { |j| j.job_class.to_s == params[:job_class] }
20
-
19
+ klass = params[:job_class] || route_params(:job_class)
20
+ @job_class = SidekiqJobStats::Statistic.find_all.find { |j| j.job_class.to_s == klass }
21
+
21
22
  @start = 0
22
23
  @start = params[:start].to_i if params[:start]
23
24
  @limit = 100
@@ -28,8 +29,6 @@ module SidekiqJobStats
28
29
 
29
30
  render(:erb, File.read("#{ROOT}/views/job_histories.erb"))
30
31
  end
31
-
32
- app.settings.locales << File.expand_path('locales', ROOT)
33
32
  end
34
33
  end
35
34
  end
@@ -19,5 +19,20 @@ module Sidekiq
19
19
  end
20
20
  end
21
21
 
22
- Sidekiq::Web.register(SidekiqJobStats::WebExtension)
23
- Sidekiq::Web.tabs['Job stats'] = 'job_stats'
22
+ if Sidekiq::MAJOR >= 8
23
+ Sidekiq::Web.configure do |config|
24
+ config.register_extension(
25
+ SidekiqJobStats::WebExtension,
26
+ name: "job_stats",
27
+ tab: ["Job stats"],
28
+ index: "job_stats"
29
+ )
30
+ end
31
+ else
32
+ Sidekiq::Web.register(SidekiqJobStats::WebExtension)
33
+ Sidekiq::Web.tabs['Job stats'] = 'job_stats'
34
+ end
35
+
36
+
37
+
38
+
@@ -30,6 +30,7 @@
30
30
  <table class="table table-hover table-bordered table-striped">
31
31
  <thead>
32
32
  <tr>
33
+ <th class="header">Process</th>
33
34
  <th class="header">Enqueued time</th>
34
35
  <th class="header">Started at</th>
35
36
  <th class="header">Finished at</th>
@@ -43,11 +44,17 @@
43
44
  <% @histories.each do |history| %>
44
45
  <% if history.is_a? Hash %>
45
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>
46
53
  <td><span class="time"><%= Time.at(history["enqueued_at"]) %></span></td>
47
54
  <td><span class="time"><%= history["started_at"] %></span></td>
48
55
  <td><span class="time"><%= history["finished_at"]%></span></td>
49
56
  <td><%= history["duration"] %>s</td>
50
- <td><%= history["payload"] %></td>
57
+ <td><div class="args"><%= history["payload"] %></div></td>
51
58
  <td><%= history["status"] %></td>
52
59
  <td><%= history["exception"] if history["exception"] %></td>
53
60
  </tr>
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.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - isliusar
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-10 00:00:00.000000000 Z
11
+ date: 2025-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -75,7 +75,7 @@ metadata:
75
75
  homepage_uri: https://github.com/sliusar-ihor/sidekiq-job-stats
76
76
  source_code_uri: https://github.com/sliusar-ihor/sidekiq-job-stats
77
77
  changelog_uri: https://github.com/sliusar-ihor/sidekiq-job-stats
78
- post_install_message:
78
+ post_install_message:
79
79
  rdoc_options: []
80
80
  require_paths:
81
81
  - lib
@@ -90,8 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubygems_version: 3.5.11
94
- signing_key:
93
+ rubygems_version: 3.0.3.1
94
+ signing_key:
95
95
  specification_version: 4
96
96
  summary: Tracks jobs performed, failed, and the duration of the last 100 jobs for
97
97
  each job type.