sidekiq-job-stats 0.1.1 → 0.1.2

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: 4f64a36ba3d536394e382f3548ac1141465f0b95ecfaa0d808a98ab58f7ed815
4
- data.tar.gz: f77329570bfcf310494f71f3a8cc9a35ab4e85b4ef98d1f5a2c8d71ae5838562
3
+ metadata.gz: ba3ca2f5a5fbb009d7998c4a5524f1e392d3efa5ed6a954973e27a9f957b9797
4
+ data.tar.gz: 04d71dcdb1b0a6ccaa0e14ae5bd110b2ea2310002045dbd712bbeadb66462d7e
5
5
  SHA512:
6
- metadata.gz: eced075ff890513cc03b6449c0c7dc95e4129cd48ed805d235f8e09713bf6ee9d245594187db84aa6fc54638acdffdc576304b39d8c312213a9a1756a5f3fe6c
7
- data.tar.gz: 52eaa24c7d5521aba6912a2660a5cefc7e83accc77474de705f5d7f3fca3206e1a0424683368c014e73e015a3e4f2bd15635b87f83204cd70be016a675452a15
6
+ metadata.gz: d061774049fc6fa164211fe9a5b56fc2986f9e5167a38631f83c11f870f4d6a876bfc0de964c0d25b67e9b16d255b216b98c4533981ed449564093200dbe25f8
7
+ data.tar.gz: 58830a7f4304614adf938d17c966e803b7319b504d3c5e8c83ee2ce0efca6f41bd7b8ae474e87f3220a226386eabced60c03aebff6e3d563d10b7f1f0e212195
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sidekiq-job-stats (0.1.0)
4
+ sidekiq-job-stats (0.1.2)
5
5
  get_process_mem
6
6
  sidekiq (>= 6)
7
7
 
@@ -33,11 +33,11 @@ module SidekiqJobStats
33
33
  end
34
34
 
35
35
  def push_history(job_data)
36
- return if Sidekiq.history_max_count.zero?
36
+ return if Sidekiq.job_stats_max_count.zero?
37
37
 
38
38
  Sidekiq.redis do |conn|
39
39
  conn.lpush(job_history_key, job_data.to_json)
40
- conn.ltrim(job_history_key, 0, Sidekiq.history_max_count)
40
+ conn.ltrim(job_history_key, 0, Sidekiq.job_stats_max_count)
41
41
  end
42
42
  end
43
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqJobStats
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -9,13 +9,13 @@ module SidekiqJobStats
9
9
  def self.registered(app)
10
10
  app.helpers Helpers::Stats
11
11
 
12
- app.get '/history' do
12
+ app.get '/job_stats' do
13
13
  @jobs = SidekiqJobStats::Statistic.find_all.sort
14
14
 
15
15
  render(:erb, File.read("#{ROOT}/views/job_stats.erb"))
16
16
  end
17
17
 
18
- app.get '/history/job_history/:job_class' do
18
+ app.get '/job_stats/job_history/:job_class' do
19
19
  @job_class = SidekiqJobStats::Statistic.find_all.find { |j| j.job_class.to_s == params[:job_class] }
20
20
 
21
21
  @start = 0
@@ -10,14 +10,14 @@ require_relative "sidekiq_job_stats/history"
10
10
  require 'sidekiq/web'
11
11
 
12
12
  module Sidekiq
13
- def self.history_max_count=(value)
14
- @history_max_count = value
13
+ def self.job_stats_max_count=(value)
14
+ @job_stats_max_count = value
15
15
  end
16
16
 
17
- def self.history_max_count
18
- @history_max_count || 1000
17
+ def self.job_stats_max_count
18
+ @job_stats_max_count || 1000
19
19
  end
20
20
  end
21
21
 
22
22
  Sidekiq::Web.register(SidekiqJobStats::WebExtension)
23
- Sidekiq::Web.tabs['History'] = 'history'
23
+ Sidekiq::Web.tabs['Job stats'] = 'job_stats'
@@ -33,10 +33,10 @@
33
33
  <%if @start > 0 || @start + @limit <= @size %>
34
34
  <p class='pagination'>
35
35
  <% if @start - @limit >= 0 %>
36
- <a href="<%= current_page %>?start=<%= [0, @start - @limit].max %>&limit=<%= @limit %>" class='less'>&laquo; less</a>
36
+ <a href="/sidekiq<%= request.path_info %>?start=<%= [0, @start - @limit].max %>&limit=<%= @limit %>" class='less'>&laquo; less</a>
37
37
  <% end %>
38
38
  <% if @start + @limit <= @size %>
39
- <a href="<%= current_page %>?start=<%= @start + @limit %>&limit=<%= @limit %>" class='more'>more &raquo;</a>
39
+ <a href="/sidekiq<%= request.path_info %>?start=<%= @start + @limit %>&limit=<%= @limit %>" class='more'>more &raquo;</a>
40
40
  <% end %>
41
41
  </p>
42
42
  <%end%>
@@ -28,7 +28,7 @@
28
28
  <tr>
29
29
  <td>
30
30
  <%= job.name %>
31
- <a href='<%= "/sidekiq/history/job_history/#{job.name}" %>'>[history]</a>
31
+ <a href='<%= "/sidekiq/job_stats/job_history/#{job.name}" %>'>[history]</a>
32
32
  </td>
33
33
  <%= display_stat(job, :jobs_enqueued, :number_display) %>
34
34
  <%= display_stat(job, :jobs_performed_day, :number_display) %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-job-stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - isliusar
@@ -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.2.22
93
+ rubygems_version: 3.4.10
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