From 4ed6967c520536acedcbf070980f62ac9832e8f1 Mon Sep 17 00:00:00 2001 From: Benoit Sigoure Date: Tue, 13 Sep 2011 09:53:22 -0700 Subject: [PATCH] Properly handle config names that contain whitespaces. --- sysbench.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sysbench.html b/sysbench.html index 6fc74f1..ad8e425 100644 --- a/sysbench.html +++ b/sysbench.html @@ -58,7 +58,14 @@ }); configs.sort(); $.each(configs, function (_, config) { - list.append("
" + choice(config, ucfirst(config))); + id = config.replace(/[^-_a-z0-9]+/gi, "_"); + label = ucfirst(config); + list.append("
" + choice(id, label)); + if (id != config) { + results[id] = results[config]; + delete results[config]; + } + results[id].label = label; }); list = $("#test_modes_list"); $.each(TESTS, function (mode, descr) { @@ -229,10 +236,11 @@ var format = series.yaxis.tickFormatter; var yaxis = series.yaxis; var y = format(item.datapoint[1], yaxis); - var values = results[bench.config][bench.mode].results[bench.metric][x]; + var res = results[bench.config]; + var values = res[bench.mode].results[bench.metric][x]; values = $.map(values, function (y, _) { return format(y, yaxis); }); showTooltip(item.pageX, item.pageY, - series.label + " with " + x + " threads = " + y + res.label + " with " + x + " threads = " + y + "
(average of " + values.join(", ") + ")"); curseries = item.seriesIndex; curpoint = item.dataIndex;