Skip to content

Instantly share code, notes, and snippets.

@lefred
Created February 28, 2016 19:12
Show Gist options
  • Save lefred/a1a8b96246828900b1fa to your computer and use it in GitHub Desktop.
Save lefred/a1a8b96246828900b1fa to your computer and use it in GitHub Desktop.
SELECT ROUND(SUM(bytes)/1024/1024*60) AS megabytes_per_hour
FROM (
SELECT SUM(VARIABLE_VALUE) * -1 AS bytes
FROM information_schema.GLOBAL_STATUS
WHERE VARIABLE_NAME IN ('wsrep_received_bytes', 'wsrep_replicated_bytes')
UNION ALL SELECT sleep(60) AS bytes
UNION ALL SELECT SUM(VARIABLE_VALUE) AS bytes
FROM information_schema.GLOBAL_STATUS
WHERE VARIABLE_NAME IN ('wsrep_received_bytes',
'wsrep_replicated_bytes')
) AS COUNTED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment