Initial implementation of results parser
This commit is contained in:
21
benchmark/website/index.html
Normal file
21
benchmark/website/index.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Benchmark Results</title>
|
||||
<script src="source/chart.bundle.js"></script>
|
||||
<script src="source/utils.js"></script>
|
||||
<script src="dataset/latest_snapshot.js"></script>
|
||||
<link rel="stylesheet" href="style/main.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<canvas id="canvas"></canvas>
|
||||
</div>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var ctx = document.getElementById("canvas").getContext("2d");
|
||||
buildChart(ctx, data);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
17220
benchmark/website/source/chart.bundle.js
Normal file
17220
benchmark/website/source/chart.bundle.js
Normal file
File diff suppressed because it is too large
Load Diff
48
benchmark/website/source/utils.js
Normal file
48
benchmark/website/source/utils.js
Normal file
@@ -0,0 +1,48 @@
|
||||
// Generate unique looking color for a given bar index.
|
||||
function generateBarColor(index) {
|
||||
var builtin_colors = [[255, 99, 132],
|
||||
[255, 159, 64],
|
||||
[255, 205, 86],
|
||||
[75, 192, 192],
|
||||
[54, 162, 235],
|
||||
[153, 102, 255],
|
||||
[201, 203, 207],
|
||||
[48, 103, 204],
|
||||
[220, 56, 18],
|
||||
[254, 155, 0],
|
||||
[15, 147, 25]];
|
||||
var color = [0, 0, 0];
|
||||
if (index >= 0 && index < builtin_colors.length) {
|
||||
color = builtin_colors[index];
|
||||
}
|
||||
return "rgb(" + color[0].toString() + ", " +
|
||||
color[1].toString() + ", " +
|
||||
color[2].toString() + ")";
|
||||
}
|
||||
|
||||
function buildChart(ctx, data) {
|
||||
var max_value = 0;
|
||||
for (dataset of data.datasets) {
|
||||
for (value of dataset.data) {
|
||||
max_value = Math.max(max_value, value);
|
||||
}
|
||||
}
|
||||
window.myBar = new Chart(
|
||||
ctx,
|
||||
{
|
||||
type: 'bar',
|
||||
data: data,
|
||||
options: { responsive: true,
|
||||
legend: {position: 'top'},
|
||||
title: {display: true,
|
||||
text: 'Benchmark Results'},
|
||||
scales: {xAxes: [{display: true,
|
||||
scaleLabel: {display: true,
|
||||
labelString: 'Scene'}}],
|
||||
yAxes: [{display: true,
|
||||
scaleLabel: {display: true,
|
||||
labelString: 'Render time (sec)'},
|
||||
ticks: {min: 0,
|
||||
max: Math.ceil(max_value * 1.25)}}]}}
|
||||
});
|
||||
}
|
9
benchmark/website/style/main.css
Normal file
9
benchmark/website/style/main.css
Normal file
@@ -0,0 +1,9 @@
|
||||
canvas {
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 75%;
|
||||
}
|
Reference in New Issue
Block a user