Automattic / Cron-Control

A fresh take on running WordPress's cron system, allowing parallel processing

Home Page:https://wordpress.org/plugins/wp-cron-control/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Add run_event hook for possible NewRelic integration to measure execution time

ovidiul opened this issue · comments

Some users might benefit from being able to measure the execution time and status of their scheduled events across a certain date range, and NewRelic could be one tool to help them view this better.

Would it be possible to add a hook for the run_event method where we measure the time the event took to run and the status of it?

Something like:

do_action('cron_control_event_completed', $event->get_action(), maybe_serialize( $event->get_args() ), $return, $execution_time);

added before the return statement.

I understand there are some concerns with the md5 hash encoding of the action, but I think users can further engineer their target events and add the necessary data into the event arguments.

Happy to work on a PR if this can be considered. Thanks.