1
0
Fork 0

cluster view charts update

This commit is contained in:
hkernbach 2016-05-24 11:20:28 +02:00
parent 1290c1230c
commit 5cf1c1aa3c
3 changed files with 23 additions and 10 deletions

View File

@ -54,7 +54,7 @@
<div class="pure-u-1-1 pure-u-md-12-24 pure-u-lg-6-24"> <div class="pure-u-1-1 pure-u-md-12-24 pure-u-lg-6-24">
<div class="graphWrapper"> <div class="graphWrapper">
<div id='clusterAverage'></div> <div id='clusterAverage'></div>
<div class="graphLabel">TRANSFER SIZE</div> <div class="graphLabel">AVG Request Time</div>
</div> </div>
</div> </div>

View File

@ -284,7 +284,7 @@
self.chartsOptions[1].options[0].values.push({x:time, y: self.calcTotalHttp(data.http, key)}); self.chartsOptions[1].options[0].values.push({x:time, y: self.calcTotalHttp(data.http, key)});
//AVERAGE //AVERAGE
self.chartsOptions[2].options[0].values.push({x:time, y: data.avgRequestTime[key]}); self.chartsOptions[2].options[0].values.push({x:time, y: data.avgRequestTime[key] / self.coordinators.length});
}); });
self.historyInit = true; self.historyInit = true;
} }
@ -308,16 +308,16 @@
//AVERAGE //AVERAGE
self.chartsOptions[2].options[0].values.push({ self.chartsOptions[2].options[0].values.push({
x: data.times[data.times.length - 1], x: data.times[data.times.length - 1],
y: data.avgRequestTime[data.bytesSentPerSecond.length - 1] y: data.avgRequestTime[data.bytesSentPerSecond.length - 1] / self.coordinators.length
}); });
} }
}, },
chartsOptions: [ chartsOptions: [
{ {
id: "#clusterData", id: "#clusterData",
type: 'bytes',
count: 2, count: 2,
options: [ options: [
{ {
@ -340,6 +340,7 @@
}, },
{ {
id: "#clusterHttp", id: "#clusterHttp",
type: 'bytes',
options: [{ options: [{
area: true, area: true,
values: [], values: [],
@ -351,10 +352,11 @@
{ {
id: "#clusterAverage", id: "#clusterAverage",
data: [], data: [],
type: 'seconds',
options: [{ options: [{
area: true, area: true,
values: [], values: [],
key: "Bytes", key: "Seconds",
color: "rgb(243, 156, 18)", color: "rgb(243, 156, 18)",
fillOpacity: 0.1 fillOpacity: 0.1
}] }]
@ -392,11 +394,22 @@
self.charts[c.id].yAxis self.charts[c.id].yAxis
.axisLabel('') .axisLabel('')
.tickFormat(function(d) { .tickFormat(function(d) {
var formatted;
if (c.type === 'bytes') {
if (d === null) { if (d === null) {
return 'N/A'; return 'N/A';
} }
var formatted = parseFloat(d3.format(".2f")(d)); formatted = parseFloat(d3.format(".2f")(d));
return prettyBytes(formatted); return prettyBytes(formatted);
}
else if (c.type === 'seconds') {
if (d === null) {
return 'N/A';
}
formatted = parseFloat(d3.format(".2f")(d));
return formatted;
}
}); });
var data, lines = self.returnGraphOptions(c.id); var data, lines = self.returnGraphOptions(c.id);

View File

@ -49,7 +49,7 @@
}.bind(this); }.bind(this);
var cb = function() { var cb = function() {
console.log("node complete"); console.log("");
}; };
if (!this.initCoordDone) { if (!this.initCoordDone) {