resque-job-stats 0.4.2 → 0.5.0

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
- SHA1:
3
- metadata.gz: 6341d0bd166660770021824e10df1940fb9b3ed7
4
- data.tar.gz: 46ae0994cb18ce6fb0cf5b74af9b93bd6dd73813
2
+ SHA256:
3
+ metadata.gz: 87f8558af0c719b163d22a7ae47f71e55c77ce1b742b885afdf398a126049aa8
4
+ data.tar.gz: '093e20951a75bbd4277af4843eb5153080e67197d1f097c4feee9bc7f99a2ed4'
5
5
  SHA512:
6
- metadata.gz: 16716c3f7ca43d582a9027ca550acf3f520f959be34ba1c9f3120e2cac5036651a608c8f01c2a650950f8354d89d9c29bbaf31c9125f7da214506205a7cd15ce
7
- data.tar.gz: 4f2bd3ab45e390ecd191521b1d3473cf85e80dee6bbf616c48d827fa524c298bcf291e59deeaa717509fdc0c2986afd74492522d22422a650fb4088af4a6de0c
6
+ metadata.gz: 61803f7ab5fdbfe1c61fbc4e390ee86bbffb98779cc715d2c55e684b08854d3c11e705b575a7bef980bef74488964520f9e256f33791adf45ed90c98ea6b1429
7
+ data.tar.gz: c3f52a315adef6403e3bfa9b3f839d6e4fdaf1b8068c247cd1ba2f71f7f6cd142c8baae3619a5d3506cbd81fa56e67fba5291aef0cbc9625efbe45746d3e2b00
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ ## Master
4
+
5
+ ## 0.5.0
6
+
7
+ * Add example app (#27, 158f466)
8
+ * Remove support for ruby 1.9 and 2.1 (#36, 3cf0aab)
9
+ * Support Resque 2 (#35, 3e30e9c)
10
+
11
+ ## 0.4.2
12
+
13
+ * Fix missing ERB files in gemspec (e30e599)
14
+
15
+ ## 0.4.1
16
+
17
+ * Remove `date` from gemspec (31e054b)
18
+
19
+ ## 0.4.0
20
+
21
+ * Add stats and UI for individual job histories (#24, f10d9b6) -- @emilong
22
+ * Modernize the gem, and add Travis CI testing for newer rubies (#23, cbac34d)
23
+
24
+ Changelog started on Oct 20, 2016.
@@ -1,6 +1,6 @@
1
- = resque-job-stats
1
+ # resque-job-stats
2
2
 
3
- {<img src="https://secure.travis-ci.org/alanpeabody/resque-job-stats.png?branch=master" />}[http://travis-ci.org/alanpeabody/resque-job-stats]
3
+ [![Build Status](https://travis-ci.org/alanpeabody/resque-job-stats.svg)](http://travis-ci.org/alanpeabody/resque-job-stats)
4
4
 
5
5
  Job centric stats for Resque.
6
6
 
@@ -21,96 +21,119 @@ This information can be used to help track performance and diagnose specific bot
21
21
 
22
22
  We are sending this information to Nagios for graphing and alerts (via a custom rake task).
23
23
 
24
- == Installation
24
+ ## Installation
25
25
 
26
- Requires resque '~> 1.17.0'
26
+ Requires resque '>= 1.17', '< 3'
27
27
 
28
28
  In your Gemfile add:
29
29
 
30
- gem 'resque-job-stats'
30
+ ```ruby
31
+ gem 'resque-job-stats'
32
+ ```
31
33
 
32
- == Usage
34
+ ## Usage
33
35
 
34
36
  Simply extend your class
35
37
 
36
- class MyJob
37
- extend Resque::Plugins::JobStats
38
+ ```ruby
39
+ class MyJob
40
+ extend Resque::Plugins::JobStats
38
41
 
39
- @queue = :my_job
40
- def self.perform(*args)
41
- # ..
42
- end
42
+ @queue = :my_job
43
+ def self.perform(*args)
44
+ # ..
43
45
  end
46
+ end
47
+ ```
44
48
 
45
- And you will have a set of keys starting with 'stats:jobs:my_job' inside your Resque redis namespace.
49
+ And you will have a set of keys starting with `'stats:jobs:my_job'` inside your Resque redis namespace.
46
50
 
47
51
  Alternatively you can include just the metric you wish to record.
48
52
 
49
- class MyVerboseJob
50
- extend Resque::Plugins::JobStats::Performed
51
- extend Resque::Plugins::JobStats::Enqueued
52
- extend Resque::Plugins::JobStats::Failed
53
- extend Resque::Plugins::JobStats::Duration
54
- extend Resque::Plugins::JobStats::Timeseries::Enqueued
55
- extend Resque::Plugins::JobStats::Timeseries::Performed
56
-
57
- @queue = :my_job
58
- def self.perform(*args)
59
- # ...
60
- end
53
+ ```ruby
54
+ class MyVerboseJob
55
+ extend Resque::Plugins::JobStats::Performed
56
+ extend Resque::Plugins::JobStats::Enqueued
57
+ extend Resque::Plugins::JobStats::Failed
58
+ extend Resque::Plugins::JobStats::Duration
59
+ extend Resque::Plugins::JobStats::Timeseries::Enqueued
60
+ extend Resque::Plugins::JobStats::Timeseries::Performed
61
+
62
+ @queue = :my_job
63
+ def self.perform(*args)
64
+ # ...
61
65
  end
66
+ end
67
+ ```
62
68
 
63
- === Duration module
69
+ ### Duration module
64
70
 
65
71
  The duration module provides two metrics, the longest job and the job rolling avg.
66
72
 
67
- These are accessible via two singleton methods, MyJob.job_rolling_avg and MyJob.longest_job.
73
+ These are accessible via two singleton methods, `MyJob.job_rolling_avg` and `MyJob.longest_job`.
68
74
 
69
75
  By default the last 100 jobs durations are stored and used to provide the above metrics.
70
76
 
71
- You may set the number of jobs to include by setting the @durations_recorded variable.
77
+ You may set the number of jobs to include by setting the `@durations_recorded` variable.
72
78
 
73
79
 
74
- class MyJob
75
- extend Resque::Plugins::JobStats::Duration
80
+ ```ruby
81
+ class MyJob
82
+ extend Resque::Plugins::JobStats::Duration
76
83
 
77
- @queue = :my_job
78
- @durations_recorded = 1000
84
+ @queue = :my_job
85
+ @durations_recorded = 1000
79
86
 
80
- def self.perform(*payload)
81
- # ...
82
- end
87
+ def self.perform(*payload)
88
+ # ...
83
89
  end
90
+ end
91
+ ```
84
92
 
85
- === Timeseries module
93
+ ### Timeseries module
86
94
 
87
95
  The timeseries module provides timeseries counts of jobs performed. The metrics are rolling and kept for a period of time before being expired.
88
96
  The timestamp used for the timeseries data is UTC.
89
97
 
90
- == Resque Web Tab
98
+ ## Resque Web Tab
91
99
 
92
100
  The Resque web page for showing the statistics will only display jobs that extend Resque::Plugins::JobStats (in other words, just
93
101
  the jobs that include all of the metrics):
94
102
 
95
- class MyJob
96
- extend Resque::Plugins::JobStats
97
- ...
98
- end
103
+ ```ruby
104
+ class MyJob
105
+ extend Resque::Plugins::JobStats
106
+ ...
107
+ end
108
+ ```
99
109
 
100
110
  The interface can be included in your app like this:
101
111
 
102
- require 'resque-job-stats/server'
112
+ ```ruby
113
+ require 'resque-job-stats/server'
114
+ ```
103
115
 
104
116
  If you wish to display only certain metrics, you can filter the metrics accordingly. The default metrics can be found in Resque::Plugins::JobStats::Statistic.
105
117
 
118
+ ```ruby
106
119
  Resque::Server.job_stats_to_display = [:jobs_enqueued, :job_rolling_avg]
120
+ ```
121
+
122
+ ## Screenshots
123
+
124
+ ### Overview
125
+
126
+ ![overview stats](docs/images/stats-overview.png)
127
+
128
+ ### Individual Job Histories
129
+
130
+ ![individual stats](docs/images/stats-individual.png)
107
131
 
108
- == TODO
132
+ ## TODO
109
133
 
110
134
  * Find clean way to add queue wait time stats.
111
- * Screen shot of interface with lots of stats
112
135
 
113
- == Contributing to resque-job-stats
136
+ ## Contributing to resque-job-stats
114
137
 
115
138
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
116
139
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
@@ -120,12 +143,13 @@ If you wish to display only certain metrics, you can filter the metrics accordin
120
143
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
121
144
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
122
145
 
123
- == Contributers
146
+ ## Contributers
124
147
 
125
- * {damonmorgan}[https://github.com/damonmorgan]
126
- * {unclebilly}[https://github.com/unclebilly]
148
+ * [damonmorgan](https://github.com/damonmorgan)
149
+ * [unclebilly](https://github.com/unclebilly)
150
+ * [jesperronn](https://github.com/jesperronn)
127
151
 
128
- == Copyright
152
+ ## Copyright
129
153
 
130
154
  Copyright (c) 2011-2012 Alan Peabody. See LICENSE.txt for further details.
131
155
 
@@ -1,7 +1,7 @@
1
1
  module Resque
2
2
  module Plugins
3
3
  module JobStats
4
- VERSION = '0.4.2'
4
+ VERSION = '0.5.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-job-stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - alanpeabody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-20 00:00:00.000000000 Z
11
+ date: 2019-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: resque
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.17'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.17'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -87,10 +93,11 @@ executables: []
87
93
  extensions: []
88
94
  extra_rdoc_files:
89
95
  - LICENSE.txt
90
- - README.rdoc
96
+ - README.md
91
97
  files:
98
+ - CHANGELOG.md
92
99
  - LICENSE.txt
93
- - README.rdoc
100
+ - README.md
94
101
  - lib/resque-job-stats.rb
95
102
  - lib/resque-job-stats/server.rb
96
103
  - lib/resque-job-stats/server/views/job_histories.erb
@@ -116,15 +123,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
123
  requirements:
117
124
  - - ">="
118
125
  - !ruby/object:Gem::Version
119
- version: 1.9.2
126
+ version: '2.2'
120
127
  required_rubygems_version: !ruby/object:Gem::Requirement
121
128
  requirements:
122
129
  - - ">="
123
130
  - !ruby/object:Gem::Version
124
131
  version: '0'
125
132
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.2.2
133
+ rubygems_version: 3.0.1
128
134
  signing_key:
129
135
  specification_version: 4
130
136
  summary: Job-centric stats for Resque