diff options
author | André Nusser <andre.nusser@googlemail.com> | 2016-01-31 20:48:51 +0100 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2016-01-31 20:48:51 +0100 |
commit | 007bface04f6bd11f3149fcf5ced79f100f9db95 (patch) | |
tree | b01157d29a58158e8d6305e28229533088622264 /tools | |
parent | 469f2c84d8c7416056655be79edfe8f7bff4ab1f (diff) |
Performance test: Fix bugs with older top version and label axes in plots.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/performance_test/performance_test | 4 | ||||
-rw-r--r-- | tools/performance_test/performance_test.gnuplot | 3 |
2 files changed, 5 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)) } 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 |