From 007bface04f6bd11f3149fcf5ced79f100f9db95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sun, 31 Jan 2016 20:48:51 +0100 Subject: Performance test: Fix bugs with older top version and label axes in plots. --- tools/performance_test/performance_test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/performance_test/performance_test') diff --git a/tools/performance_test/performance_test b/tools/performance_test/performance_test index dadd5bc..b14e240 100755 --- a/tools/performance_test/performance_test +++ b/tools/performance_test/performance_test @@ -71,7 +71,7 @@ function logData { pid=$1 - top_output="$(top -b -n 1 -p $pid | tail -n 1)" + top_output="$(top -b -n 1 -p $pid | grep "^ *$pid")" top_arr=($top_output) cpu_usage="${top_arr[6]}" @@ -80,7 +80,7 @@ function logData cpu_data="${cpu_data}${data_count} ${cpu_usage}\n" ram_data="${ram_data}${data_count} ${ram_usage}\n" - avg_cpu_usage="$(ps -p $pid -o %cpu | tail -n 1)" + avg_cpu_usage="$(ps -p $pid -o %cpu | grep "^ *[0-9]*\.[0-9]*")" data_count=$((data_count+1)) } -- cgit v1.2.3