I have a bash command which gives me the highest value in the 9th column of a file:
cat "log.txt" | grep 1923 | awk '{print $9}' | sort -n | tail -1
log.txt is a log of CPU usage for process 1923 & is measured 10 times per second.
I need to verify that process 1923 never exceeds a certain threshold for more than one second.
Could someone please help me formulate an awk command that:
- Calculates a rolling 1-second average
- Tells me the peak value it finds
Many thanks, Fidel
ulimit
to prevent the command from exceeding a threshold?