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 ++-- tools/performance_test/performance_test.gnuplot | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'tools') 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)) } diff --git a/tools/performance_test/performance_test.gnuplot b/tools/performance_test/performance_test.gnuplot index 900a1d0..a145100 100644 --- a/tools/performance_test/performance_test.gnuplot +++ b/tools/performance_test/performance_test.gnuplot @@ -1,6 +1,9 @@ set style line 1 lc rgb '#0060ad' lt 1 lw 2 pt 7 ps 1.5 set terminal png size 400,300 enhanced font "Helvetica,10" +set xlabel "time" set output 'cpu_data.png' +set ylabel "CPU usage in %" plot 'cpu_data.dat' with linespoints ls 1 set output 'ram_data.png' +set ylabel "RAM usage in %" plot 'ram_data.dat' with linespoints ls 1 -- cgit v1.2.3