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