All Moodle site administrators must have faced problems with the cron tasks in their career. Cron is a special PHP script that runs different tasks at differently scheduled intervals. For running your Moodle site properly, you need to configure the cron tasks on your server immediately after installing Moodle. Over a time, some tasks within the cron script starts taking a longer time than usual or starts failing completely. How do you come to know about the statistics for your cron job?
Catalyst IT – Moodle partner from New Zealand, Australia & UK, developed a new Moodle plugin – “Cron lock statistics” to help all Moodle site administrators. Cron lock statistics is a lock statistics admin tool, specifically tailored to report on cron task timings. This plugin can offer a report over which tasks are currently running and where, with a detailed history of how long each task took during previous execution.
Most of the time, most cron tasks are quick and finish in seconds. You may not be interested in knowing the history of these tasks. However, you might like detailed stats for slower, bigger tasks. This plugin compresses the history of all quick tasks so that you will get overall stats for all cron tasks, and detailed stats data for slower bigger tasks without bloating out the database with too much data.
According to the plugin developers:
It implements a proxy lock factory which adds instrumentation around the real lock factory. It will log details about each cron task when a lock is obtained and released.
Available Data:
You can get the following data through this plugin:
- Task name
- Duration
- Hostname
- Time gained
- Time released
- PID
The plugin is also awarded with Reviewers Choice award which is given only to those plugins which are particularly useful, well coded or otherwise interesting plugins. You can download the latest version of Cron lock statistics plugin from Moodle plugins database here. It is supported for Moodle 2.7 version onwards.
If you would like to know the basics of Cron process configuration in Moodle, check out this Moodle documentation page.