System load statistics

1. Monthly Tracking

1.1. System load average per hour (for the last month)

USE CASE:

  • Retrieve the system load average value per hour for the last month
SELECT DATE_FORMAT(collection_time, "%Y-%m-%d %H:00:00") as "collection_time",
AVG(total_process_count) as "average_total_process_count"
FROM mysql_processlist_log
WHERE collection_time>NOW() - INTERVAL 30 DAY
GROUP BY 1
1.2. Count of parallel processes per day (for the last month)

USE CASE:

  • Retrieve the daily count (maximum and average) of parallel processes for the last month
SELECT DATE(collection_time), MAX(total_process_count), AVG(total_process_count)
FROM mysql_processlist_log
WHERE collection_time>NOW() - INTERVAL 30 DAY
GROUP BY 1;