Skip to content

Instantly share code, notes, and snippets.

@romanlehnert
Created September 11, 2013 11:51
Show Gist options
  • Save romanlehnert/6522520 to your computer and use it in GitHub Desktop.
Save romanlehnert/6522520 to your computer and use it in GitHub Desktop.
measuring delayed_job speed
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