diff options
author | Connor Fawcett <connorfa@uk.ibm.com> | 2024-05-02 01:07:47 +0200 |
---|---|---|
committer | Connor Fawcett <fawcett.connor@gmail.com> | 2024-05-02 14:24:04 +0200 |
commit | 3ce3c8ec8affff613678b310189a134429087087 (patch) | |
tree | 4cbf0d22d40ea012f4b1cb5872c1a2f4e55bae51 /qa/workunits/erasure-code | |
parent | Merge PR #57183 into main (diff) | |
download | ceph-3ce3c8ec8affff613678b310189a134429087087.tar.xz ceph-3ce3c8ec8affff613678b310189a134429087087.zip |
qa/workunits/erasure-code: add bench data tables and graph support for additional jerasure techniques
Signed-off-by: Connor Fawcett <connorfa@uk.ibm.com>
Diffstat (limited to 'qa/workunits/erasure-code')
-rw-r--r-- | qa/workunits/erasure-code/bench.html | 38 | ||||
-rwxr-xr-x | qa/workunits/erasure-code/bench.sh | 80 | ||||
-rw-r--r-- | qa/workunits/erasure-code/examples.css | 20 | ||||
-rw-r--r-- | qa/workunits/erasure-code/plot.js | 65 | ||||
-rw-r--r-- | qa/workunits/erasure-code/tables.js | 28 |
5 files changed, 211 insertions, 20 deletions
diff --git a/qa/workunits/erasure-code/bench.html b/qa/workunits/erasure-code/bench.html index 3b4b6c74c00..7f23912ec15 100644 --- a/qa/workunits/erasure-code/bench.html +++ b/qa/workunits/erasure-code/bench.html @@ -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> @@ -21,12 +22,45 @@ <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> diff --git a/qa/workunits/erasure-code/bench.sh b/qa/workunits/erasure-code/bench.sh index 8e288f053ec..fc75830dfd0 100755 --- a/qa/workunits/erasure-code/bench.sh +++ b/qa/workunits/erasure-code/bench.sh @@ -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() { diff --git a/qa/workunits/erasure-code/examples.css b/qa/workunits/erasure-code/examples.css index ee4724778fc..7d4c2ae1828 100644 --- a/qa/workunits/erasure-code/examples.css +++ b/qa/workunits/erasure-code/examples.css @@ -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; +} diff --git a/qa/workunits/erasure-code/plot.js b/qa/workunits/erasure-code/plot.js index bd2bba5bbad..af91a996389 100644 --- a/qa/workunits/erasure-code/plot.js +++ b/qa/workunits/erasure-code/plot.js @@ -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 index 00000000000..cf224ff4033 --- /dev/null +++ b/qa/workunits/erasure-code/tables.js @@ -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 |