1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
<!DOCTYPE html>
<script src="jquery.js"></script>
<script src="jquery.flot.js"></script>
<script src="jquery.flot.navigate.js"></script>
<script src="data.js"></script>
<script>
var newGraphData = [];
for (var i = 0; i < graphData.length; ++i) {
var d = graphData[i];
if (d.label == "allocated bytes" || d.label == "max nominal heap bytes" || d.label == "max JS_malloc bytes")
d.yaxis = 2;
// Uninteresting:
if (d.label == "max nominal heap bytes" || d.label == "max JS_malloc bytes" || d.label == "number of GCs" || d.label == "allocated bytes")
continue;
// Bogus data:
if (d.label == "unlogged")
continue;
newGraphData.push(d);
}
function showTooltip(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css( {
position: 'absolute',
top: y + 5,
left: x + 5,
border: '1px solid #fdd',
padding: '2px',
'background-color': '#fee',
opacity: 0.80
}).appendTo("body");
}
$(function () {
$.plot($("#placeholder"), newGraphData, {
grid: { hoverable: true },
zoom: { interactive: true },
pan: { interactive: true },
legend: { position: "nw" }
});
$("#placeholder").bind("plothover", function (event, pos, item) {
$("#tooltip").remove();
if (item) {
var x = item.datapoint[0].toFixed(2);
var y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY, item.series.label + " at " + Math.round(x) + ": " + y);
}
});
});
</script>
<div id="placeholder" style="width:1100px; height:600px;"></div>
<p>x axis: turn number / 20
<p>y axis (left): time per frame / msecs
<p>y axis (right): bytes
<p>Drag to pan, mouse-wheel to zoom
|