RamSailopal / YottaDB-dashboard

A YottaDB performance metric dashboard that utilises Prometheus and Grafana. Now also includes a browser based Eclipse Theia IDE for routine viewing/amendment/compilation and a web based global viewer.
4 stars 2 forks source link

wrong vmem statistics using ps -eo #6

Open lbast3 opened 1 month ago

lbast3 commented 1 month ago

'ps -eo pid,comm' sometimes starts with leading space so that vmem == 0 This happens when you have a lot of processes and varying number of digits per process.

Proposal:
In ydbdash.py: trim leading/trailing spaces with awk '{$1=$1};1'

while read proc;do cat "/proc/$proc/stat";done <<< "$(ps -eo pid,comm | grep yottadb | awk '{$1=$1};1' | cut -d ' ' -f 1)" | awk '{ vtot+=$23 } END { print vtot }'

RamSailopal commented 1 month ago

Hi, thanks for your input. Would be easier if you could please add a pull request.