|
|
|
@ -31,6 +31,8 @@ const maxEntries= client.preloadCycles;
|
|
|
|
|
var cycleTableRollover = null;
|
|
|
|
|
var sessionAverageRollover = null;
|
|
|
|
|
|
|
|
|
|
var cyTotal=0;
|
|
|
|
|
|
|
|
|
|
function setStatus(str)
|
|
|
|
|
{
|
|
|
|
|
$('#status').text(str);
|
|
|
|
@ -74,7 +76,7 @@ function createNewCandle(charts, close)
|
|
|
|
|
|
|
|
|
|
function createNewLinePoint(charts, data)
|
|
|
|
|
{
|
|
|
|
|
if(charts.agline.data.datasets[0].data[charts.agline.data.datasets[0].data.length-1]) {
|
|
|
|
|
if(charts.agline.data.datasets[0].data[charts.agline.data.datasets[0].data.length-1] !==undefined) {
|
|
|
|
|
charts.agline.data.datasets[0].data[charts.agline.data.datasets[0].data.length-1] = data.number;
|
|
|
|
|
charts.agline.data.datasets[1].data[charts.agline.data.datasets[0].data.length-1] = data.number/data._cycles;
|
|
|
|
|
}
|
|
|
|
@ -305,12 +307,18 @@ function graphCycle(data, charts,update=true)
|
|
|
|
|
//Line
|
|
|
|
|
|
|
|
|
|
//Total posts
|
|
|
|
|
if(charts.agline.data.datasets[0].data[charts.agline.data.datasets[0].data.length-1]) {
|
|
|
|
|
charts.agline.data.datasets[0].data[charts.agline.data.datasets[0].data.length-1] += data.number;
|
|
|
|
|
if(client.superBuffer.length>0)
|
|
|
|
|
charts.agline.data.datasets[1].data[charts.agline.data.datasets[0].data.length-1] = charts.agline.data.datasets[0].data[charts.agline.data.datasets[0].data.length-1] /client.superBuffer[client.superBuffer.length-1]._cycles;
|
|
|
|
|
if(update)
|
|
|
|
|
var lgc = charts.agline.data.datasets[0].data[charts.agline.data.datasets[0].data.length-1];
|
|
|
|
|
//console.log(lgc+" "+data.number);
|
|
|
|
|
if(lgc || lgc===0) {
|
|
|
|
|
charts.agline.data.datasets[0].data[charts.agline.data.datasets[0].data.length-1]= lgc+ data.number;
|
|
|
|
|
if(cyTotal>0)
|
|
|
|
|
{
|
|
|
|
|
charts.agline.data.datasets[1].data[charts.agline.data.datasets[1].data.length-1] = (lgc+ data.number)/cyTotal;
|
|
|
|
|
}
|
|
|
|
|
if(update) {
|
|
|
|
|
charts.agline.update();
|
|
|
|
|
//console.log("Update to "+charts.agline.data.datasets[0].data[charts.agline.data.datasets[0].data.length-1]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -782,13 +790,15 @@ function begin() {
|
|
|
|
|
|
|
|
|
|
client.superGrapher = function(data) {
|
|
|
|
|
//TODO: new supercycle
|
|
|
|
|
//add_new_candle(g_chartsSuper(), data);
|
|
|
|
|
//add_new_candle(g_chartsSuper(), data)
|
|
|
|
|
cyTotal = 0;
|
|
|
|
|
createNewCandle(g_chartsSuper(), data._candle.number.c);
|
|
|
|
|
createNewLinePoint(g_chartsSuper(), data);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
client.start(function(data) {
|
|
|
|
|
//on message function
|
|
|
|
|
cyTotal += 1;
|
|
|
|
|
updateAllTime(g_charts(),data);
|
|
|
|
|
|
|
|
|
|
graphCycle(data, g_chartsSession());
|
|
|
|
@ -797,7 +807,7 @@ function begin() {
|
|
|
|
|
$('#interval').text(client.info.interval+" ms");
|
|
|
|
|
$('#binterval').text(client.info.backendInterval+" s");
|
|
|
|
|
$('#pinterval').text((client.info.purgeInterval/1000/60).toFixed(2)+" m");
|
|
|
|
|
$('#spinterval').text((client.info.superPurgeInterval/1000/60/60).toFixed(2)+" h");
|
|
|
|
|
$('#spinterval').text( (((client.info.purgeInterval/1000/60)*client.info.superPurgeInterval)/60).toFixed(2)+" h");
|
|
|
|
|
$('#board').text(client.info.board);
|
|
|
|
|
$('#uptime').text(fixtime2(new Date(client.info.upSince)));
|
|
|
|
|
$('#s_started').text(fixtime2(new Date()));
|
|
|
|
@ -902,6 +912,7 @@ function begin() {
|
|
|
|
|
|
|
|
|
|
chartAGLine.data.labels.shift();
|
|
|
|
|
chartAGLine.data.datasets[0].data.shift();
|
|
|
|
|
chartAGLine.data.datasets[1].data.shift();
|
|
|
|
|
chartAGLine.update();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|