Skip to content

Instantly share code, notes, and snippets.

@brianfoody
Created November 4, 2021 12:54
Show Gist options
  • Save brianfoody/dcee9a3ed48a4a7aa68ddad75cf6326b to your computer and use it in GitHub Desktop.
Save brianfoody/dcee9a3ed48a4a7aa68ddad75cf6326b to your computer and use it in GitHub Desktop.
Cloudwatch Insights
// Get memory stats and see if any are overprovisioned
filter @type = "REPORT"
| stats max(@memorySize / 1000 / 1000) as provisonedMemoryMB,
min(@maxMemoryUsed / 1000 / 1000) as smallestMemoryRequestMB,
avg(@maxMemoryUsed / 1000 / 1000) as avgMemoryUsedMB,
max(@maxMemoryUsed / 1000 / 1000) as maxMemoryUsedMB,
provisonedMemoryMB - maxMemoryUsedMB as overProvisionedMB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment