Automattic / Automattic/Cron-Control

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

Open
#280 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
134
Forks
26
Avg merge
3m
Merged PRs (30d)
1

Description

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](https://github.com/Automattic/Cron-Control/blob/5621149d89db2211f9d2d85d56bbd19353aaddc7/includes/class-events.php#L215) 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.