generate all plots
authorLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 9 Oct 2025 16:21:17 +0000 (18:21 +0200)
committerLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 9 Oct 2025 16:21:17 +0000 (18:21 +0200)
candles.gp [new file with mode: 0644]
generatecandle.sh [new file with mode: 0755]
generateplot.sh [new file with mode: 0755]
histogram.gp [new file with mode: 0644]
rawmeasures.gp [new file with mode: 0644]
resync.sh

diff --git a/candles.gp b/candles.gp
new file mode 100644 (file)
index 0000000..b35579f
--- /dev/null
@@ -0,0 +1,24 @@
+# -- gnuplot --
+# Plot statistic candles
+
+reset
+
+data = 'DATA'
+
+set title "Test NAME - Dedicated core(s) (CORE)"
+set xlabel 'load (%)'
+set ylabel 'latency (µs)'
+set format y "%.1f"
+set key left top
+
+set errorbars 4.0
+set style fill empty
+plot [-5:105] [0:] data using 1:6:2:4:8 with candlesticks lw 2 title "Quartiles", \
+     data using 1:7:7:7:7 with candlesticks lt -1 lw 2 title "Median"
+
+pause 5 "please wait 5s"
+
+#set term png medium
+#set term png font "arial"
+set term pdfcairo font "Arial"
+replot
diff --git a/generatecandle.sh b/generatecandle.sh
new file mode 100755 (executable)
index 0000000..bd8d584
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+tmp=$(mktemp)
+
+for csv; do
+  core="any core"
+  sed 1d $csv | cut -d, -f1 | sort | uniq | while IFS=$'\n' read name; do
+    output=$(echo $name| awk '{ print tolower($1) }').pdf
+    awk -F, '$1 == "'"$name"'" { sub (/[^,]*,/, ""); gsub (/,/, " "); print }' $csv > $tmp
+
+    cat candles.gp | \
+      m4 -D CORE="$core" -D DATA="$tmp" -D NAME="$name" | \
+      gnuplot > "$output"
+  done
+done
+
+rm -f $tmp
diff --git a/generateplot.sh b/generateplot.sh
new file mode 100755 (executable)
index 0000000..6af786f
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+for data; do
+  log=$(echo $data | sed 's/\.dat/.log/')
+
+  name=$(awk '/Test:/ { sub(/[^:]*: /, ""); print}' $log)
+  core=$(awk -F: '/Dedicated core/ { print  ($2 == 0) ? "any core" : $2 " core" ($2 > 1 ? "s" : "") }' $log)
+  load=$(echo $data | sed 's/.*-\([0-9]*\)%.*/\1%/')
+
+  output=$(echo $data | sed 's/\.dat/-raw.pdf/')
+  cat rawmeasures.gp | \
+    m4 -D CORE="$core" -D DATA="$data" -D LOAD="$load" -D NAME="$name" | \
+    gnuplot > $output
+
+  output=$(echo $data | sed 's/\.dat/-hist.pdf/')
+  cat histogram.gp | \
+    m4 -D CORE="$core" -D DATA="$data" -D LOAD="$load" -D NAME="$name" | \
+    gnuplot > $output
+done
diff --git a/histogram.gp b/histogram.gp
new file mode 100644 (file)
index 0000000..ef285e8
--- /dev/null
@@ -0,0 +1,24 @@
+# -- gnuplot --
+# Plot histogram
+
+data = 'DATA'
+
+stats data nooutput
+nb = STATS_records
+f(x) = x / 1000.
+
+set title "Test NAME - Load LOAD - Dedicated core(s) (CORE)"
+set xlabel 'latency (µs)'
+set ylabel '# of tests (%)'
+set format x "%.1f"
+
+set style histogram rowstacked gap 0
+set style fill solid 0.5 border lt -1
+plot [0:] data using (f($1)):(100./nb) smooth freq with boxes notitle
+
+pause 5 "please wait 5s"
+
+#set term png medium
+#set term png font "arial"
+set term pdfcairo font "Arial"
+replot
diff --git a/rawmeasures.gp b/rawmeasures.gp
new file mode 100644 (file)
index 0000000..b2e2770
--- /dev/null
@@ -0,0 +1,23 @@
+# -- gnuplot --
+# Plot raw measures
+
+reset
+
+data = 'DATA'
+
+set title "Test NAME - Load LOAD - Dedicated core(s) (CORE)"
+set xlabel 'tests'
+set ylabel 'latency (µs)'
+set format y "%.1f"
+
+f(x) = x / 1000
+
+set style data line
+plot [:] [0:] data using (f($1)) notitle
+
+pause 5 "please wait 5s"
+
+#set term png medium
+#set term png font "arial"
+set term pdfcairo font "Arial"
+replot
index 3c1ecb668c2d3cc1f01eba7db8bea95f5d4382d9..9b9c81c6d7b6874e373c206d20174750b199bda7 100755 (executable)
--- a/resync.sh
+++ b/resync.sh
@@ -4,3 +4,4 @@ date=$(date +'%Y%m%d-%H%M')
 tar cvzf result-$date.tgz *.dat *.log
 ./gettable.sh > result-$date.csv
 scp result-$date.tgz result-$date.csv mazet@192.168.1.1:smile
+ssh mazet@192.168.1.1 sh -c "LC_ALL=C libreoffice --convert-to xlsx $smile/result-$date.csv"