Skip to content

Instantly share code, notes, and snippets.

@ericbisme
Created January 29, 2025 21:25
Show Gist options
  • Select an option

  • Save ericbisme/e48650e9cc34b36df251e83d13d48970 to your computer and use it in GitHub Desktop.

Select an option

Save ericbisme/e48650e9cc34b36df251e83d13d48970 to your computer and use it in GitHub Desktop.
Cloudwatch Lambda stats
fields @timestamp, @initDuration, @message, @logStream, @log
| sort @timestamp desc
| limit 1000
| filter @type = "REPORT"
| stats
count(@type) as countInvocations ,
count(@initDuration) as countColdStarts , (count(@initDuration)/count(@type))*100 as percentageColdStarts,
max(@initDuration) as maxColdStartTime,
avg(@duration) as averageDuration,
max(@duration) as maxDuration,
min(@duration) as minDuration,
avg(@maxMemoryUsed) as averageMemoryUsed,
max(@memorySize) as memoryAllocated, (avg(@maxMemoryUsed)/max(@memorySize))*100 as percentageMemoryUsed
by bin(1h) as timeFrame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment