add 99% percentile
authorLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 23 Oct 2025 09:08:36 +0000 (11:08 +0200)
committerLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 23 Oct 2025 10:19:05 +0000 (12:19 +0200)
generatecandle.sh
generatedoc.sh
gettable.awk
stat.c

index 666de86ddc3acd8e4a7518539dbac7d27403f403..50453221c9dc6e06ef974de0af993346f8b3902e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 base=$(cd $(dirname $0); pwd)
 
index 538752f2c09ceaaeef15c6aa1f6a39eae92be5ed..bb6e0f79afa7404a8015c5baffc4b2ee5625cac7 100755 (executable)
@@ -22,20 +22,24 @@ for tab; do
 
   echo "<h3>Statistic summary</h3>"
 
+  echo "<div style=\"table\">"
   echo "<table border=\"1\" cellpadding=\"5\" cellspacing=\"2\" width=\"100%\">"
-  echo "<thead><tr><th width=\"12%\">Load<br>(%)</th><th width=\"12%\">Minimum<br>(µs)</th><th width=\"12%\">Average<br>(µs)</th><th width=\"12%\">Maximum<br>(µs)</th><th width=\"12%\">Standard Dev.<br>(µs)</th><th width=\"12%\">25th %<br>(µs)</th><th width=\"12%\">Median<br>(µs)</th><th width=\"12%\">75th %<br>(µs)</th></tr></thead>"
+  echo "<thead><tr><th>Load<br>(%)</th><th>Min.<br>(µs)</th><th>Avg.<br>(µs)</th><th>Max.<br>(µs)</th><th>Std. Dev.<br>(µs)</th><th>25th %<br>(µs)</th><th>Median<br>(µs)</th><th>75th %<br>(µs)</th><th>99th %<br>(µs)</th></tr></thead>"
   echo "<tbody>"
   awk '{ printf "<tr>"; for (i=0; i<NF; i++) printf "<td>%s</td>", $(i+1); printf "</tr>\n" }' $tab
   echo "</tbody>"
   echo "</table>"
+  echo "</div>"
 
+  echo "<div style=\"figure\">"
   echo "<div><a href=\"$test-${dcore}k.pdf\"><img src=\"$test-${dcore}k.png\" width=\"80%\"/></a></div>"
+  echo "</div>"
 
   for load in $(cat $tab | sed 's/%.*//'); do
     echo "<h3>Measures with load of $load%</h3>"
-    echo "<div>"
-    echo "<a href=\"$test-${dcore}k-${load}%-raw.pdf\"><img src=\"$test-${dcore}k-${load}%-raw.png\" width=\"49%\"/></a>"
-    echo "<a href=\"$test-${dcore}k-${load}%-hist.pdf\"><img src=\"$test-${dcore}k-${load}%-hist.png\" width=\"49%\"/></a>"
+    echo "<div style=\"figure\">"
+    echo "<img src=\"$test-${dcore}k-${load}%-raw.png\" width=\"45%\"/>"
+    echo "<img src=\"$test-${dcore}k-${load}%-hist.png\" width=\"45%\"/>"
     echo "</div>"
   done
 
index cb6b5d02ebb2729a045ce452336bf452602ff398..943b5c087727e846b15f15d1ae90e8d4afcd6b41 100755 (executable)
@@ -3,7 +3,7 @@
 BEGIN {
     OFS=","
     if (!nohead) {
-        print "Test", "Dedicated core(s)", "Load (%)", "Minimum (µs)", "Average (µs)", "Maximum (µs)", "Standard Dev. (µs)", "25th % (µs)", "Median (µs)", "75th % (µs)"
+        print "Test", "Dedicated core(s)", "Load (%)", "Minimum (µs)", "Average (µs)", "Maximum (µs)", "Standard Dev. (µs)", "25th % (µs)", "Median (µs)", "75th % (µs)", "99th % (µs)"
     }
 }
 
@@ -24,7 +24,8 @@ BEGIN {
 /25th/ { p25=$4 }
 /Median/ { med=$3 }
 /75th/ { p75=$4 }
+/99th/ { p99=$4 }
 
 /Histogram/ {
-    print test, dcore, load, min, avg, max, std, p25, med, p75
+    print test, dcore, load, min, avg, max, std, p25, med, p75, p99
 }
diff --git a/stat.c b/stat.c
index c0ec4917413022a9753280224b45a787c78a5f66..b6928174444a86b9d2a4d31b3cf4e50732ab063d 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -76,10 +76,15 @@ void compute_statistics (dts_t *points, int nb, int bins)
     if (((3 * nb) % 4 == 0) && (nb >= 4)) {
         p75 = (p75 + points[(3 * nb) / 4 - 1]) / 2;
     }
+    double p99 =  points[(99 * nb) / 100];
+    if (((99 * nb) % 100 == 0) && (nb >= 100)) {
+        p75 = (p75 + points[(99 * nb) / 100 - 1]) / 2;
+    }
 
     printf ("25th %% = %.2lfus\n", p25 / 1000);
     printf ("Median = %.2lfus\n", med / 1000);
     printf ("75th %% = %.2lfus\n", p75 / 1000);
+    printf ("99th %% = %.2lfus\n", p99 / 1000);
 
     /* compute histogram */