Created
September 11, 2013 11:51
-
-
Save romanlehnert/6522520 to your computer and use it in GitHub Desktop.
measuring delayed_job speed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def current_job_speed(time = 5) | |
start_time = Time.now | |
start_count = Delayed::Job.count | |
sleep time | |
end_time = Time.now | |
end_count = Delayed::Job.count | |
t = end_time - start_time | |
c = start_count - end_count | |
return "#{c} jobs in #{t} seconds. => #{c/t} jobs per second" | |
end | |
puts current_job_speed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment