]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/erasure-code: add bench data tables and graph support for additional... 57235/head
authorConnor Fawcett <connorfa@uk.ibm.com>
Wed, 1 May 2024 23:07:47 +0000 (23:07 +0000)
committerConnor Fawcett <fawcett.connor@gmail.com>
Thu, 2 May 2024 12:24:04 +0000 (13:24 +0100)
Signed-off-by: Connor Fawcett <connorfa@uk.ibm.com>
qa/workunits/erasure-code/bench.html
qa/workunits/erasure-code/bench.sh
qa/workunits/erasure-code/examples.css
qa/workunits/erasure-code/plot.js
qa/workunits/erasure-code/tables.js [new file with mode: 0644]

index 3b4b6c74c00276df3b636998ffdd8700a97426e1..7f23912ec151792953648676a4ee586d79fb4396 100644 (file)
@@ -9,6 +9,7 @@
     <script language="javascript" type="text/javascript" src="jquery.flot.categories.js"></script>
     <script language="javascript" type="text/javascript" src="bench.js"></script>
     <script language="javascript" type="text/javascript" src="plot.js"></script>
+    <script language="javascript" type="text/javascript" src="tables.js"></script>
   </head>
   <body>
 
       <div class="demo-container">
        <div id="encode" class="demo-placeholder"></div>
       </div>
-      <p>encode: Y = GB/s, X = K/M</p>
+      <h2>Encode:</h2>
+      <p>Y = GB/s, X = K/M</p>
+      <details>
+        <summary>Bench Data</summary>
+        <table id="encode-table">
+          <tr>
+            <th>Plugin</th>
+            <th>Technique</th>
+            <th>Time</th>
+            <th>Total Size</th>
+            <th>k</th>
+            <th>m</th>
+            <th>Iteration</th>
+            <th>Packet Size</th>
+          </tr>
+        </table>
+      </details>
 
       <div class="demo-container">
        <div id="decode" class="demo-placeholder"></div>
       </div>
-      <p>decode: Y = GB/s, X = K/M/erasures</p>
+      <h2>Decode:</h2>
+      <p>Y = GB/s, X = K/M/erasures</p>
+      <details>
+        <summary>Bench Data</summary>
+        <table id="decode-table">
+          <tr>
+            <th>Plugin</th>
+            <th>Technique</th>
+            <th>Time</th>
+            <th>Total Size</th>
+            <th>k</th>
+            <th>m</th>
+            <th>Iteration</th>
+            <th>Packet Size</th>
+            <th>Erasures</th>
+          </tr>
+        </table>
+      </details>
 
     </div>
 
index 8e288f053eca5d05822f764b7e7944a93e76405a..fc75830dfd014c5ce85b2cee002f0ea8dcf36fc7 100755 (executable)
@@ -50,11 +50,25 @@ export PATH=/sbin:$PATH
 : ${CEPH_ERASURE_CODE_BENCHMARK:=ceph_erasure_code_benchmark}
 : ${PLUGIN_DIRECTORY:=/usr/lib/ceph/erasure-code}
 : ${PLUGINS:=isa jerasure}
-: ${TECHNIQUES:=vandermonde cauchy}
+: ${TECHNIQUES:=vandermonde cauchy liberation reed_sol_r6_op blaum_roth liber8tion}
 : ${TOTAL_SIZE:=$((1024 * 1024))}
 : ${SIZE:=4096}
 : ${PARAMETERS:=--parameter jerasure-per-chunk-alignment=true}
 
+declare -rA isa_techniques=(
+    [vandermonde]="reed_sol_van"
+    [cauchy]="cauchy"
+)
+
+declare -rA jerasure_techniques=(
+    [vandermonde]="reed_sol_van"
+    [cauchy]="cauchy_good"
+    [reed_sol_r6_op]="reed_sol_r6_op"
+    [blaum_roth]="blaum_roth"
+    [liberation]="liberation"
+    [liber8tion]="liber8tion"
+)
+
 function bench_header() {
     echo -e "seconds\tKB\tplugin\tk\tm\twork.\titer.\tsize\teras.\tcommand."
 }
@@ -100,6 +114,25 @@ function packetsize() {
     echo $p
 }
 
+function get_technique_name()
+{
+    local plugin=$1
+    local technique=$2
+
+    declare -n techniques="${plugin}_techniques"
+    echo ${techniques["$technique"]}
+}
+
+function technique_is_raid6() {
+    local technique=$1
+    local r6_techniques="liberation reed_sol_r6_op blaum_roth liber8tion"
+
+    if [[ $r6_techniques =~ $technique ]]; then
+        return 0
+    fi
+    return 1
+}
+
 function bench_run() {
     local plugin=jerasure
     local w=8
@@ -111,31 +144,31 @@ function bench_run() {
     k2ms[4]="2 3"
     k2ms[6]="2 3 4"
     k2ms[10]="3 4"
-    local isa2technique_vandermonde='reed_sol_van'
-    local isa2technique_cauchy='cauchy'
-    local jerasure2technique_vandermonde='reed_sol_van'
-    local jerasure2technique_cauchy='cauchy_good'
+
     for technique in ${TECHNIQUES} ; do
         for plugin in ${PLUGINS} ; do
-            eval technique_parameter=\$${plugin}2technique_${technique}
+            technique_parameter=$(get_technique_name $plugin $technique)
+            if [[ -z $technique_parameter ]]; then continue; fi
             echo "serie encode_${technique}_${plugin}"
             for k in $ks ; do
                 for m in ${k2ms[$k]} ; do
+                    if [ $m -ne 2 ] && technique_is_raid6 $technique; then continue; fi
                     bench $plugin $k $m encode $(($TOTAL_SIZE / $SIZE)) $SIZE 0 \
                         --parameter packetsize=$(packetsize $k $w $VECTOR_WORDSIZE $SIZE) \
                         ${PARAMETERS} \
                         --parameter technique=$technique_parameter
-
                 done
             done
         done
     done
     for technique in ${TECHNIQUES} ; do
         for plugin in ${PLUGINS} ; do
-            eval technique_parameter=\$${plugin}2technique_${technique}
+            technique_parameter=$(get_technique_name $plugin $technique)
+            if [[ -z $technique_parameter ]]; then continue; fi
             echo "serie decode_${technique}_${plugin}"
             for k in $ks ; do
                 for m in ${k2ms[$k]} ; do
+                    if [ $m -ne 2 ] && technique_is_raid6 $technique; then continue; fi
                     echo
                     for erasures in $(seq 1 $m) ; do
                         bench $plugin $k $m decode $(($TOTAL_SIZE / $SIZE)) $SIZE $erasures \
@@ -150,27 +183,42 @@ function bench_run() {
 }
 
 function fplot() {
-    local serie
-    bench_run | while read seconds total plugin k m workload iteration size erasures rest ; do 
+    local serie=""
+    local plot=""
+    local encode_table="var encode_table = [\n"
+    local decode_table="var decode_table = [\n"
+    while read seconds total plugin k m workload iteration size erasures rest ; do
         if [ -z $seconds ] ; then
-            echo null,
+            plot="$plot  null,\n"
         elif [ $seconds = serie ] ; then
             if [ "$serie" ] ; then
-                echo '];'
+                echo -e "$plot];\n"
             fi
             local serie=`echo $total | sed 's/cauchy_\([0-9]\)/cauchy_good_\1/g'`
-            echo "var $serie = ["
+            plot="var $serie = [\n"
         else
             local x
+            local row
+            local technique=`echo $rest | grep -Po "(?<=technique=)\w*"`
+            local packetsize=`echo $rest | grep -Po "(?<=packetsize=)\w*"`
             if [ $workload = encode ] ; then
                 x=$k/$m
+                row="[ '$plugin', '$technique', $seconds, $total, $k, $m, $iteration, $packetsize ],"
+                encode_table="$encode_table  $row\n"
+
             else
                 x=$k/$m/$erasures
+                row="[ '$plugin', '$technique', $seconds, $total, $k, $m, $iteration, $packetsize, $erasures ],"
+                decode_table="$decode_table  $row\n"
             fi
-            echo "[ '$x', " $(echo "( $total / 1024 / 1024 ) / $seconds" | bc -ql) " ], "
+            local out_time="$(echo "( $total / 1024 / 1024 ) / $seconds" | bc -ql)"
+            plot="$plot  [ '$x', $out_time ],\n"
         fi
-    done
-    echo '];'
+    done < <(bench_run)
+
+    echo -e "$plot];\n"
+    echo -e "$encode_table];\n"
+    echo -e "$decode_table];\n"
 }
 
 function main() {
index ee4724778fcf61ff6698c675d64a94015353d89a..7d4c2ae182848bb5878efa19c04c6a9c2107cdf6 100644 (file)
@@ -94,4 +94,22 @@ input[type=checkbox] {
 
 .legend table {
        border-spacing: 5px;
-}
\ No newline at end of file
+}
+
+#encode-table, #decode-table {
+  margin: 0px 0px 15px 15px;
+  font-size: 12px;
+  border-collapse: collapse;
+  width: 100%;
+}
+
+#encode-table td, #decode-table td, #encode-table th, #decode-table th {
+  border: 1px solid #ddd;
+  padding: 4px;
+}
+
+#encode-table th, #decode-table th {
+  padding-top: 4px;
+  padding-bottom: 4px;
+  text-align: left;
+}
index bd2bba5bbadae3af8c59176092642a863b5513fa..af91a99638918df154a4b56aa946c073eb94a3ab 100644 (file)
@@ -32,6 +32,38 @@ $(function() {
            lines: { show: true },
        });
     }
+    if (typeof encode_reed_sol_r6_op_jerasure != 'undefined') {
+        encode.push({
+            data: encode_reed_sol_r6_op_jerasure,
+            label: "Jerasure, Reed Solomon RAID6",
+            points: { show: true },
+            lines: { show: true },
+      });
+  }
+    if (typeof encode_liberation_jerasure != 'undefined') {
+        encode.push({
+            data: encode_liberation_jerasure,
+            label: "Jerasure, Liberation",
+            points: { show: true },
+            lines: { show: true },
+        });
+    }
+    if (typeof encode_liber8tion_jerasure != 'undefined') {
+        encode.push({
+            data: encode_liber8tion_jerasure,
+            label: "Jerasure, Liber8tion",
+            points: { show: true },
+            lines: { show: true },
+        });
+    }
+    if (typeof encode_blaum_roth_jerasure != 'undefined') {
+        encode.push({
+            data: encode_blaum_roth_jerasure,
+            label: "Jerasure, Blaum Roth",
+            points: { show: true },
+            lines: { show: true },
+      });
+    }
     $.plot("#encode", encode, {
        xaxis: {
            mode: "categories",
@@ -72,11 +104,42 @@ $(function() {
            lines: { show: true },
        });
     }
+    if (typeof decode_reed_sol_r6_op_jerasure != 'undefined') {
+        decode.push({
+            data: decode_reed_sol_r6_op_jerasure,
+            label: "Jerasure, Reed Solomon RAID6",
+            points: { show: true },
+            lines: { show: true },
+        });
+    }
+    if (typeof decode_liberation_jerasure != 'undefined') {
+        decode.push({
+            data: decode_liberation_jerasure,
+            label: "Jerasure, Liberation",
+            points: { show: true },
+            lines: { show: true },
+        });
+    }
+    if (typeof decode_liber8tion_jerasure != 'undefined') {
+        decode.push({
+            data: decode_liber8tion_jerasure,
+            label: "Jerasure, Liber8tion",
+            points: { show: true },
+            lines: { show: true },
+        });
+    }
+    if (typeof decode_blaum_roth_jerasure != 'undefined') {
+        decode.push({
+            data: decode_blaum_roth_jerasure,
+            label: "Jerasure, Blaum Roth",
+            points: { show: true },
+            lines: { show: true },
+        });
+    }
     $.plot("#decode", decode, {
        xaxis: {
            mode: "categories",
            tickLength: 0
        },
     });
-
 });
diff --git a/qa/workunits/erasure-code/tables.js b/qa/workunits/erasure-code/tables.js
new file mode 100644 (file)
index 0000000..cf224ff
--- /dev/null
@@ -0,0 +1,28 @@
+$(function() {
+    if (typeof encode_table != 'undefined') {
+        let table_rows = '';
+        for (let row of encode_table) {
+            table_rows += `<tr>`
+            for (let cell of row)
+            {
+                table_rows += `<td>${cell}</td>`
+            }
+            table_rows += `</tr>`;
+            console.log(table_rows);
+        }
+        $('#encode-table').append(table_rows);
+    }
+
+    if (typeof decode_table != 'undefined') {
+        let table_rows = '';
+        for (let row of decode_table) {
+            table_rows += `<tr>`
+            for (let cell of row)
+            {
+                table_rows += `<td>${cell}</td>`
+            }
+            table_rows += `</tr>`;
+        }
+        $('#decode-table').append(table_rows);
+    }
+});
\ No newline at end of file