gathering statistics

54 views
Skip to first unread message

Michael Richardson

unread,
Sep 7, 2017, 5:15:00 PM9/7/17
to delayed_job
I started this process with the simple question: how many jobs are in the queue.
I then realized I wanted to know more... how many have run, how many completed with throwing an exception (or vv), how long did each job take (minimums, maximums, mode and average period).
How long does each job wait before it starts...  

Much of this data would be easy to get from the delayed_jobs table; it's clear that the data gets cleaned up.
It seems that if I could hook into that process, I could move the data to another table, and then run some statistics on it before deleting it.
Has anyone else looked doing this kind of thing?  

Matt Griffin

unread,
Sep 7, 2017, 5:30:38 PM9/7/17
to delayed_job
Newrelic does a lot of this and you can look at how they implemented it. There's also many lifecycle hooks available that you can use in a plugin to do tracking. (https://github.com/collectiveidea/delayed_job/blob/master/lib/delayed/lifecycle.rb)

-M

--

---
You received this message because you are subscribed to the Google Groups "delayed_job" group.
To unsubscribe from this group and stop receiving emails from it, send an email to delayed_job...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Richardson

unread,
Sep 8, 2017, 4:12:04 PM9/8/17
to delayed_job
Looking at: https://newrelic.com/plugins  I found a plugin for sidekiq, but not delayed_job.  Are you suggesting that I could adapt the sidekiq one because the lifecycle stuff is common across ActiveJob plugins?
Or was I just unable to see the right plugin :-)

On Thursday, September 7, 2017 at 5:30:38 PM UTC-4, Matt Griffin wrote:
Newrelic does a lot of this and you can look at how they implemented it. There's also many lifecycle hooks available that you can use in a plugin to do tracking. (https://github.cohttps://newrelic.com/pluginsm/collectiveidea/delayed_job/blob/master/lib/delayed/lifecycle.rb)

Matt Griffin

unread,
Sep 8, 2017, 4:40:30 PM9/8/17
to delayed_job
DJ instrumentation is built directly into the newrelic gem. No plugin needed :)
Reply all
Reply to author
Forward
0 new messages