steampipe
steampipe copied to clipboard
Add acceptance test to check `memory consumption` while running steampipe
An acceptance test to check memory consumption
while running steampipe.
FINDINGS:
CPU Utilization
top -l 2 | grep -E "^CPU" | tail -1 | awk '{ print $3 + $5"%" }'
shows the current CPU Utilization %
Memory usage
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | grep steampipe
shows the RSS (Resident Set Size) and VSZ (Virtual Memory Size) columns.
RSS is Resident Set Size. This is the size of memory that a process has currently used to load all of its pages. VSZ is Virtual Memory Size. This is the size of memory that Linux has given to a process, but it doesn’t necessarily mean that the process is using all of that memory.
top -o mem -pid <processID>
gives the mem usage of a particular pid.
top -o mem -pid 8458 > top.txt
writes the top output to the file for a given period of time.
Here is an example output:
top.txt
Here 8458
is the PID for the steampipe query
process which takes about 18-19M of memory for the time period between 2022/04/07 12:00:13
and 2022/04/07 12:00:26
, after which it was stopped.