2012-02-20 09:46:28 -08:00
|
|
|
Sidekiq.configure_client do |config|
|
2013-01-26 11:26:10 -08:00
|
|
|
config.redis = { :size => 2, :namespace => 'foo' }
|
2012-02-20 09:46:28 -08:00
|
|
|
end
|
|
|
|
Sidekiq.configure_server do |config|
|
2015-10-07 12:21:10 -07:00
|
|
|
config.redis = { :namespace => 'foo' }
|
2015-09-21 14:50:00 -07:00
|
|
|
config.on(:startup) { }
|
|
|
|
config.on(:quiet) { }
|
|
|
|
config.on(:shutdown) do
|
|
|
|
#result = RubyProf.stop
|
|
|
|
|
|
|
|
## Write the results to a file
|
|
|
|
## Requires railsexpress patched MRI build
|
|
|
|
# brew install qcachegrind
|
|
|
|
#File.open("callgrind.profile", "w") do |f|
|
|
|
|
#RubyProf::CallTreePrinter.new(result).print(f, :min_percent => 1)
|
|
|
|
#end
|
|
|
|
end
|
2012-02-19 13:02:32 -08:00
|
|
|
end
|
2013-04-26 09:00:03 -07:00
|
|
|
|
2014-08-01 23:40:42 +00:00
|
|
|
require 'sidekiq/web'
|
|
|
|
Sidekiq::Web.app_url = '/'
|
|
|
|
|
2013-04-26 09:00:03 -07:00
|
|
|
class EmptyWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
|
|
|
def perform
|
|
|
|
end
|
|
|
|
end
|
2015-10-08 10:19:55 -07:00
|
|
|
|
|
|
|
class TimedWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
|
|
|
def perform(start)
|
|
|
|
now = Time.now.to_f
|
|
|
|
puts "Latency: #{now - start} sec"
|
|
|
|
end
|
|
|
|
end
|