Query calculating AVG per minute GROUP BY timestamp
You should use AVG function if you need to get the average
Using MINUTE function will return the minute part from the date. i.e. 10:05:03 and 11:05:33 will give the same result. (It is fine if the interval is less than 60 minutes, however, it is safer to use the following query:)


SELECT left(timestamp, 16) as mtimestamp, avg(vif_2_rx) 
FROM md_metrics_status 
WHERE vm_name = 'r-23-VM' AND TIMESTAMP &gt; NOW() - INTERVAL 15 MINUTE 
GROUP BY mtimestamp