summaryrefslogtreecommitdiff
path: root/tools/performance_test/performance_test
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2016-01-31 20:48:51 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2016-01-31 20:48:51 +0100
commit007bface04f6bd11f3149fcf5ced79f100f9db95 (patch)
treeb01157d29a58158e8d6305e28229533088622264 /tools/performance_test/performance_test
parent469f2c84d8c7416056655be79edfe8f7bff4ab1f (diff)
Performance test: Fix bugs with older top version and label axes in plots.
Diffstat (limited to 'tools/performance_test/performance_test')
-rwxr-xr-xtools/performance_test/performance_test4
1 files changed, 2 insertions, 2 deletions
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))
}