Last active
September 20, 2024 19:06
-
-
Save zyqxd/bbd41f10c8c03af42d584ec09c8749e3 to your computer and use it in GitHub Desktop.
cloudwatch_insights
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse @message /Query_time:\s*(?<Query_time>[0-9]+(?:\.[0-9]+)?)\s*Lock_time:\s*(?<Lock_time>[0-9]+(?:\.[0-9]+)?)[\s\S]*?;/ | |
| parse @message /SET timestamp=\d+;\n(?<RawQuery>[^;]*)/ | |
| stats count() as QueryCount, avg(Query_time) as AvgQueryTime, avg(Query_time) as AvgLockTime by RawQuery | |
| sort AvgQueryTime desc | |
| limit 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment