-
Notifications
You must be signed in to change notification settings - Fork 10
/
plot.html
84 lines (73 loc) · 1.55 KB
/
plot.html
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
//var lines = [];
/* var options = {
animationEnabled: true,
theme: "light2",
title: {
text: "Daily Sales Data"
},
axisX: {
//valueFormatString: "DD MMM YYYY",
},
axisY: {
title: "USD",
titleFontSize: 24
},
data: [{
type: "spline",
yValueFormatString: "#.##",
dataPoints: lines
}]
};*/
function addData(data) {
var counter = 0;
var lines = [];
for (var key in data["solr-metrics"]) {
//alert(data["solr-metrics"][key])
line = []
for (var i = 0; i < data["solr-metrics"][key]["jvm/solr.jvm/memory.heap.usage"].length; i++) {
line.push({
x: i*2,
y: data["solr-metrics"][key]["jvm/solr.jvm/memory.heap.usage"][i]
});
}
lines.push(line)
}
var options = {
animationEnabled: false,
theme: "light2",
title: {
text: "Memory consumption"
},
axisX: {
//valueFormatString: "DD MMM YYYY",
},
axisY: {
title: "Heap usage",
titleFontSize: 24
},
data: []
};
for (i=0; i<lines.length; i++) {
options['data'].push({
type: "spline",
yValueFormatString: "#.##",
dataPoints: lines[i]
});
}
$("#chartContainer").CanvasJSChart(options);
}
$.getJSON("results.json", addData);
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<script src="https://canvasjs.com/assets/script/jquery-1.11.1.min.js"></script>
<script src="https://canvasjs.com/assets/script/jquery.canvasjs.min.js"></script>
</body>
</html>