Administration tool that exposes, through a web service, the system metrics of the host running Moodle (CPU, memory, load average). It is designed to correlate, during a load test, the measured HTTP response times with the actual consumption of the server. It also provides the Moodle-side entry point of the MoodleLoad load testing platform, which lets you prepare and drive tests on a dedicated instance.
tool_moodleload_get_metrics: accessible through REST, restricted to a dedicated token and to the tool/moodleload:readmetrics capability.moodleload_monitor), to be assigned to a technical user.moodleload and of a service token, valid for three months.| Metric | Source | Remarks |
|---|---|---|
| CPU usage (%) | /proc/stat, delta between two snapshots | Value -1 on the first call: two calls spaced about 5 seconds apart are needed. |
| Total, available, used memory | /proc/meminfo | In bytes; -1 if unreadable. |
| Load average (1, 5, 15 min) | sys_getloadavg() | null on Windows. |
The host system must be Linux, with a readable /proc file system, for the CPU and memory measurements.
GET /webservice/rest/server.php ?wstoken=<TOKEN> &wsfunction=tool_moodleload_get_metrics &moodlewsrestformat=json
The token must never appear in a shared URL or in a document. It must be generated for the technical user moodleload or for a dedicated user, and revoked if needed in Site administration / Server / Web services / Manage tokens.
| Technical sheet | |
|---|---|
| Component type | Administration tool (admin/tool) |
| Name | Moodle Load Monitor |
| Technical name | tool_moodleload |
| Supported versions | |
| Distribution | Moodle Marketplace |
| Availability | Alpha (MATURITY_ALPHA): for test use, not intended for production |
| GDPR compliance | Yes |
| Dependencies | No plugin dependency. Web services and REST protocol enabled. PHP 8.1 or higher. |
Note: a “Failing” status does not necessarily mean that the plugin does not work. This status reflects the result of automated tests checking the code against Moodle's strict standards. We are continuously working on bringing all supported plugins progressively into compliance with these development rules.
| Branch | Continuous integration tests |
|---|---|
| 405 |
|
| 501 |
|
Developed by Valery Frémaux (ActiveProLearn) for the MoodleLoad tool on the Moogwai platform.