sidekiq 2.2.1 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq might be problematic. Click here for more details.

Files changed (87) hide show
  1. data/Changes.md +9 -0
  2. data/Gemfile +1 -2
  3. data/README.md +2 -2
  4. data/examples/sinkiq.rb +2 -2
  5. data/lib/sidekiq.rb +2 -0
  6. data/lib/sidekiq/cli.rb +4 -0
  7. data/lib/sidekiq/client.rb +13 -3
  8. data/lib/sidekiq/exception_handler.rb +1 -1
  9. data/lib/sidekiq/manager.rb +1 -2
  10. data/lib/sidekiq/middleware/server/logging.rb +1 -1
  11. data/lib/sidekiq/middleware/server/retry_jobs.rb +3 -3
  12. data/lib/sidekiq/processor.rb +12 -15
  13. data/lib/sidekiq/stats.rb +36 -0
  14. data/lib/sidekiq/testing/inline.rb +6 -6
  15. data/lib/sidekiq/util.rb +2 -2
  16. data/lib/sidekiq/version.rb +1 -1
  17. data/lib/sidekiq/web.rb +21 -8
  18. data/sidekiq.gemspec +3 -2
  19. data/test/helper.rb +2 -0
  20. data/test/test_client.rb +7 -0
  21. data/test/test_exception_handler.rb +1 -1
  22. data/test/test_stats.rb +47 -8
  23. data/test/test_testing.rb +7 -0
  24. data/test/test_testing_inline.rb +4 -4
  25. data/web/assets/images/bootstrap/glyphicons-halflings-white.png +0 -0
  26. data/web/assets/images/bootstrap/glyphicons-halflings.png +0 -0
  27. data/web/assets/javascripts/application.js +7 -0
  28. data/web/assets/javascripts/vendor/bootstrap.js +2027 -12
  29. data/web/assets/stylesheets/layout.css +5 -1
  30. data/web/assets/stylesheets/vendor/bootstrap-responsive.css +841 -368
  31. data/web/assets/stylesheets/vendor/bootstrap.css +3565 -1306
  32. data/web/views/_summary.slim +6 -6
  33. data/web/views/index.slim +6 -5
  34. data/web/views/layout.slim +1 -1
  35. data/web/views/queues.slim +2 -2
  36. metadata +21 -55
  37. data/myapp/.gitignore +0 -15
  38. data/myapp/Capfile +0 -5
  39. data/myapp/Gemfile +0 -19
  40. data/myapp/Rakefile +0 -7
  41. data/myapp/app/controllers/application_controller.rb +0 -3
  42. data/myapp/app/controllers/work_controller.rb +0 -38
  43. data/myapp/app/helpers/application_helper.rb +0 -2
  44. data/myapp/app/mailers/.gitkeep +0 -0
  45. data/myapp/app/mailers/user_mailer.rb +0 -9
  46. data/myapp/app/models/.gitkeep +0 -0
  47. data/myapp/app/models/post.rb +0 -5
  48. data/myapp/app/views/layouts/application.html.erb +0 -14
  49. data/myapp/app/views/user_mailer/greetings.html.erb +0 -3
  50. data/myapp/app/views/work/index.html.erb +0 -1
  51. data/myapp/app/workers/hard_worker.rb +0 -10
  52. data/myapp/config.ru +0 -4
  53. data/myapp/config/application.rb +0 -59
  54. data/myapp/config/boot.rb +0 -6
  55. data/myapp/config/database.yml +0 -25
  56. data/myapp/config/deploy.rb +0 -15
  57. data/myapp/config/environment.rb +0 -5
  58. data/myapp/config/environments/development.rb +0 -38
  59. data/myapp/config/environments/production.rb +0 -67
  60. data/myapp/config/environments/test.rb +0 -37
  61. data/myapp/config/initializers/backtrace_silencers.rb +0 -7
  62. data/myapp/config/initializers/inflections.rb +0 -15
  63. data/myapp/config/initializers/mime_types.rb +0 -5
  64. data/myapp/config/initializers/secret_token.rb +0 -7
  65. data/myapp/config/initializers/session_store.rb +0 -8
  66. data/myapp/config/initializers/sidekiq.rb +0 -6
  67. data/myapp/config/initializers/wrap_parameters.rb +0 -14
  68. data/myapp/config/locales/en.yml +0 -5
  69. data/myapp/config/routes.rb +0 -10
  70. data/myapp/db/migrate/20120123214055_create_posts.rb +0 -10
  71. data/myapp/db/seeds.rb +0 -7
  72. data/myapp/lib/assets/.gitkeep +0 -0
  73. data/myapp/lib/tasks/.gitkeep +0 -0
  74. data/myapp/log/.gitkeep +0 -0
  75. data/myapp/script/rails +0 -6
  76. data/web/assets/javascripts/vendor/bootstrap/bootstrap-alert.js +0 -91
  77. data/web/assets/javascripts/vendor/bootstrap/bootstrap-button.js +0 -98
  78. data/web/assets/javascripts/vendor/bootstrap/bootstrap-carousel.js +0 -154
  79. data/web/assets/javascripts/vendor/bootstrap/bootstrap-collapse.js +0 -136
  80. data/web/assets/javascripts/vendor/bootstrap/bootstrap-dropdown.js +0 -92
  81. data/web/assets/javascripts/vendor/bootstrap/bootstrap-modal.js +0 -210
  82. data/web/assets/javascripts/vendor/bootstrap/bootstrap-popover.js +0 -95
  83. data/web/assets/javascripts/vendor/bootstrap/bootstrap-scrollspy.js +0 -125
  84. data/web/assets/javascripts/vendor/bootstrap/bootstrap-tab.js +0 -130
  85. data/web/assets/javascripts/vendor/bootstrap/bootstrap-tooltip.js +0 -270
  86. data/web/assets/javascripts/vendor/bootstrap/bootstrap-transition.js +0 -51
  87. data/web/assets/javascripts/vendor/bootstrap/bootstrap-typeahead.js +0 -271
@@ -1,8 +1,8 @@
1
1
  .hero-unit
2
2
  h1 Sidekiq is #{current_status}
3
- p Processed: #{processed}
4
- p Failed: #{failed}
5
- p Busy Workers: #{workers.size}
6
- p Scheduled: #{zcard('schedule')}
7
- p Retries Pending: #{zcard('retry')}
8
- p Queue Backlog: #{backlog}
3
+ p Processed: #{number_with_delimiter(processed)}
4
+ p Failed: #{number_with_delimiter(failed)}
5
+ p Busy Workers: #{number_with_delimiter(workers.size)}
6
+ p Scheduled: #{number_with_delimiter(zcard('schedule'))}
7
+ p Retries Pending: #{number_with_delimiter(zcard('retry'))}
8
+ p Queue Backlog: #{number_with_delimiter(backlog)}
@@ -1,10 +1,11 @@
1
1
  == slim :_summary
2
2
 
3
- .poll
4
- a*{name: 'poll'} href='#{{root_path}}poll' Live Poll
5
- span class="poll-status"
3
+ .actions
4
+ form.pull-left action="#{root_path}reset" method="post"
5
+ button.btn.btn-small type="submit" title="If you kill -9 Sidekiq, this table can fill up with old data." Clear worker list
6
+ .pull-right
7
+ span.poll-status
8
+ a.btn.btn-small name='poll' href='#{{root_path}}poll' Live Poll
6
9
 
7
10
  == slim :_workers
8
11
 
9
- form action="#{root_path}reset" method="post"
10
- button.btn type="submit" title="If you kill -9 Sidekiq, this table can fill up with old data." Clear worker list
@@ -4,7 +4,7 @@ html
4
4
  link href='#{{root_path}}assets/application.css' media='screen' rel='stylesheet' type='text/css'
5
5
  title Sidekiq
6
6
  body
7
- .navbar.navbar-fixed-top
7
+ .navbar.navbar-fixed-top.navbar-inverse
8
8
  .navbar-inner
9
9
  .container
10
10
  a.btn.btn-navbar data-toggle="collapse" data-target=".nav-collapse"
@@ -10,10 +10,10 @@ h1 Queues
10
10
  tr
11
11
  td
12
12
  a href="#{root_path}queues/#{queue}" #{queue}
13
- td= size
13
+ td= number_with_delimiter(size)
14
14
  td
15
15
  form action="#{root_path}queues/#{queue}" method="post"
16
- input.btn.btn-danger type="submit" name="delete" value="Delete"
16
+ input.btn.btn-danger type="submit" name="delete" value="Delete" data-confirm="Are you sure you want to delete the #{queue} queue?"
17
17
  - else
18
18
  p No queues found.
19
19
  a href="#{root_path}" Back
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-23 00:00:00.000000000 Z
12
+ date: 2012-09-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 0.11.1
69
+ version: 0.12.0
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: 0.11.1
77
+ version: 0.12.0
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: multi_json
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -187,6 +187,22 @@ dependencies:
187
187
  - - ~>
188
188
  - !ruby/object:Gem::Version
189
189
  version: '3'
190
+ - !ruby/object:Gem::Dependency
191
+ name: pry
192
+ requirement: !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ! '>='
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
190
206
  description: Simple, efficient message processing for Ruby
191
207
  email:
192
208
  - mperham@gmail.com
@@ -244,6 +260,7 @@ files:
244
260
  - lib/sidekiq/rails.rb
245
261
  - lib/sidekiq/redis_connection.rb
246
262
  - lib/sidekiq/scheduled.rb
263
+ - lib/sidekiq/stats.rb
247
264
  - lib/sidekiq/testing.rb
248
265
  - lib/sidekiq/testing/inline.rb
249
266
  - lib/sidekiq/util.rb
@@ -251,45 +268,6 @@ files:
251
268
  - lib/sidekiq/web.rb
252
269
  - lib/sidekiq/worker.rb
253
270
  - lib/sidekiq/yaml_patch.rb
254
- - myapp/.gitignore
255
- - myapp/Capfile
256
- - myapp/Gemfile
257
- - myapp/Rakefile
258
- - myapp/app/controllers/application_controller.rb
259
- - myapp/app/controllers/work_controller.rb
260
- - myapp/app/helpers/application_helper.rb
261
- - myapp/app/mailers/.gitkeep
262
- - myapp/app/mailers/user_mailer.rb
263
- - myapp/app/models/.gitkeep
264
- - myapp/app/models/post.rb
265
- - myapp/app/views/layouts/application.html.erb
266
- - myapp/app/views/user_mailer/greetings.html.erb
267
- - myapp/app/views/work/index.html.erb
268
- - myapp/app/workers/hard_worker.rb
269
- - myapp/config.ru
270
- - myapp/config/application.rb
271
- - myapp/config/boot.rb
272
- - myapp/config/database.yml
273
- - myapp/config/deploy.rb
274
- - myapp/config/environment.rb
275
- - myapp/config/environments/development.rb
276
- - myapp/config/environments/production.rb
277
- - myapp/config/environments/test.rb
278
- - myapp/config/initializers/backtrace_silencers.rb
279
- - myapp/config/initializers/inflections.rb
280
- - myapp/config/initializers/mime_types.rb
281
- - myapp/config/initializers/secret_token.rb
282
- - myapp/config/initializers/session_store.rb
283
- - myapp/config/initializers/sidekiq.rb
284
- - myapp/config/initializers/wrap_parameters.rb
285
- - myapp/config/locales/en.yml
286
- - myapp/config/routes.rb
287
- - myapp/db/migrate/20120123214055_create_posts.rb
288
- - myapp/db/seeds.rb
289
- - myapp/lib/assets/.gitkeep
290
- - myapp/lib/tasks/.gitkeep
291
- - myapp/log/.gitkeep
292
- - myapp/script/rails
293
271
  - sidekiq.gemspec
294
272
  - test/config.yml
295
273
  - test/fake_env.rb
@@ -311,18 +289,6 @@ files:
311
289
  - web/assets/images/bootstrap/glyphicons-halflings.png
312
290
  - web/assets/javascripts/application.js
313
291
  - web/assets/javascripts/vendor/bootstrap.js
314
- - web/assets/javascripts/vendor/bootstrap/bootstrap-alert.js
315
- - web/assets/javascripts/vendor/bootstrap/bootstrap-button.js
316
- - web/assets/javascripts/vendor/bootstrap/bootstrap-carousel.js
317
- - web/assets/javascripts/vendor/bootstrap/bootstrap-collapse.js
318
- - web/assets/javascripts/vendor/bootstrap/bootstrap-dropdown.js
319
- - web/assets/javascripts/vendor/bootstrap/bootstrap-modal.js
320
- - web/assets/javascripts/vendor/bootstrap/bootstrap-popover.js
321
- - web/assets/javascripts/vendor/bootstrap/bootstrap-scrollspy.js
322
- - web/assets/javascripts/vendor/bootstrap/bootstrap-tab.js
323
- - web/assets/javascripts/vendor/bootstrap/bootstrap-tooltip.js
324
- - web/assets/javascripts/vendor/bootstrap/bootstrap-transition.js
325
- - web/assets/javascripts/vendor/bootstrap/bootstrap-typeahead.js
326
292
  - web/assets/javascripts/vendor/jquery.js
327
293
  - web/assets/javascripts/vendor/jquery.timeago.js
328
294
  - web/assets/stylesheets/application.css
@@ -1,15 +0,0 @@
1
- # See http://help.github.com/ignore-files/ for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile ~/.gitignore_global
6
-
7
- # Ignore bundler config
8
- /.bundle
9
-
10
- # Ignore the default SQLite database.
11
- /db/*.sqlite3
12
-
13
- # Ignore all logfiles and tempfiles.
14
- /log/*.log
15
- /tmp
@@ -1,5 +0,0 @@
1
- load 'deploy'
2
- # Uncomment if you are using Rails' asset pipeline
3
- # load 'deploy/assets'
4
- Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
5
- load 'config/deploy' # remove this line to skip loading any of the default tasks
@@ -1,19 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- platforms :ruby do
4
- gem 'sqlite3'
5
- end
6
-
7
- platforms :jruby do
8
- gem 'jruby-openssl'
9
- gem 'activerecord-jdbcsqlite3-adapter'
10
- end
11
-
12
- gem 'rails', '3.2.6'
13
- gem 'sidekiq', :path => '..'
14
- gem 'capistrano'
15
-
16
- # sidekiq-web dependencies
17
- gem 'slim'
18
- gem 'sinatra'
19
- gem 'sprockets'
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env rake
2
- # Add your own tasks in files placed in lib/tasks ending in .rake,
3
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
-
5
- require File.expand_path('../config/application', __FILE__)
6
-
7
- Myapp::Application.load_tasks
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
- end
@@ -1,38 +0,0 @@
1
- class WorkController < ApplicationController
2
- def index
3
- @count = rand(100)
4
- puts "Adding #{@count} jobs"
5
- @count.times do |x|
6
- HardWorker.perform_async('bubba', 0.01, x)
7
- end
8
- end
9
-
10
- def email
11
- UserMailer.delay_for(30.seconds).greetings(Time.now)
12
- render :nothing => true
13
- end
14
-
15
- def long
16
- 50.times do |x|
17
- HardWorker.perform_async('bob', 10, x)
18
- end
19
- render :text => 'enqueued'
20
- end
21
-
22
- def crash
23
- HardWorker.perform_async('crash', 1, Time.now.to_f)
24
- render :text => 'enqueued'
25
- end
26
-
27
- def delayed_post
28
- p = Post.first
29
- unless p
30
- p = Post.create!(:title => "Title!", :body => 'Body!')
31
- p2 = Post.create!(:title => "Other!", :body => 'Second Body!')
32
- else
33
- p2 = Post.second
34
- end
35
- p.delay.long_method(p2)
36
- render :nothing => true
37
- end
38
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
File without changes
@@ -1,9 +0,0 @@
1
- class UserMailer < ActionMailer::Base
2
- default from: "sidekiq@example.com"
3
-
4
- def greetings(now)
5
- @now = now
6
- @hostname = `hostname`.strip
7
- mail(:to => 'mperham@gmail.com', :subject => 'Ahoy Matey!')
8
- end
9
- end
File without changes
@@ -1,5 +0,0 @@
1
- class Post < ActiveRecord::Base
2
- def long_method(other_post)
3
- puts "Running long method with #{self.id} and #{other_post.id}"
4
- end
5
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Myapp</title>
5
- <%= stylesheet_link_tag "application", :media => "all" %>
6
- <%= javascript_include_tag "application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,3 +0,0 @@
1
- <p>
2
- Hi Mike, it's <%= @now %> and I'm at <%= @hostname %>.
3
- </p>
@@ -1 +0,0 @@
1
- Added <%= @count %> jobs!
@@ -1,10 +0,0 @@
1
- class HardWorker
2
- include Sidekiq::Worker
3
- sidekiq_options :timeout => 20, :backtrace => 5
4
-
5
- def perform(name, count, salt)
6
- raise name if name == 'crash'
7
- logger.info Time.now
8
- sleep count
9
- end
10
- end
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Myapp::Application
@@ -1,59 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- if defined?(Bundler)
6
- # If you precompile assets before deploying to production, use this line
7
- Bundler.require(*Rails.groups(:assets => %w(development test)))
8
- # If you want your assets lazily compiled in production, use this line
9
- # Bundler.require(:default, :assets, Rails.env)
10
- end
11
-
12
- module Myapp
13
- class Application < Rails::Application
14
- # Settings in config/environments/* take precedence over those specified here.
15
- # Application configuration should go into files in config/initializers
16
- # -- all .rb files in that directory are automatically loaded.
17
-
18
- # Custom directories with classes and modules you want to be autoloadable.
19
- # config.autoload_paths += %W(#{config.root}/extras)
20
-
21
- # Only load the plugins named here, in the order given (default is alphabetical).
22
- # :all can be used as a placeholder for all plugins not explicitly named.
23
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
-
25
- # Activate observers that should always be running.
26
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
-
28
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
- # config.time_zone = 'Central Time (US & Canada)'
31
-
32
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
- # config.i18n.default_locale = :de
35
-
36
- # Configure the default encoding used in templates for Ruby 1.9.
37
- config.encoding = "utf-8"
38
-
39
- # Configure sensitive parameters which will be filtered from the log file.
40
- config.filter_parameters += [:password]
41
-
42
- # Use SQL instead of Active Record's schema dumper when creating the database.
43
- # This is necessary if your schema can't be completely dumped by the schema dumper,
44
- # like if you have constraints or database-specific column types
45
- # config.active_record.schema_format = :sql
46
-
47
- # Enforce whitelist mode for mass assignment.
48
- # This will create an empty whitelist of attributes available for mass-assignment for all models
49
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
50
- # parameters by using an attr_accessible or attr_protected declaration.
51
- # config.active_record.whitelist_attributes = true
52
-
53
- # Enable the asset pipeline
54
- config.assets.enabled = true
55
-
56
- # Version of your assets, change this if you want to expire all your assets
57
- config.assets.version = '1.0'
58
- end
59
- end
@@ -1,6 +0,0 @@
1
- require 'rubygems'
2
-
3
- # Set up gems listed in the Gemfile.
4
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
-
6
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
- test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -1,15 +0,0 @@
1
- require 'bundler/capistrano'
2
- require 'sidekiq/capistrano'
3
-
4
- set :scm, :git
5
- set :repository, 'git@github.com:mperham/sidekiq'
6
- ssh_options[:forward_agent] = true
7
-
8
- default_run_options[:pty] = true # needed to run sudo
9
- set :user, 'mperham'
10
- set :application, "myapp"
11
- set :deploy_via, :remote_cache
12
-
13
- role :web, "localhost"
14
- role :app, "localhost"
15
- role :db, "localhost", :primary => true