Added server stats graph breaks.

This commit is contained in:
Ylian Saint-Hilaire 2020-03-21 17:33:09 -07:00
parent afce11060c
commit d4236385cc
2 changed files with 14 additions and 0 deletions

View File

@ -70,6 +70,7 @@ function CreateMeshCentralServer(config, args) {
obj.serverWarnings = []; // List of warnings that should be shown to administrators
obj.cookieUseOnceTable = {}; // List of cookies that are already expired
obj.cookieUseOnceTableCleanCounter = 0; // Clean the cookieUseOnceTable each 20 additions
obj.firstStats = true; // True until this server saves it's not stats to the database
// Server version
obj.currentVer = null;
@ -1272,6 +1273,7 @@ function CreateMeshCentralServer(config, args) {
}
};
if (obj.mpsserver != null) { data.conn.am = Object.keys(obj.mpsserver.ciraConnections).length; }
if (obj.firstStats === true) { delete obj.firstStats; data.first = true; }
obj.db.SetServerStats(data); // Save the stats to the database
obj.DispatchEvent(['*'], obj, { action: 'servertimelinestats', data: data }); // Event the server stats
}, 300000);

View File

@ -10709,6 +10709,12 @@
};
for (var i = 0; i < serverTimelineStats.length; i++) {
var t = new Date(serverTimelineStats[i].time);
if (serverTimelineStats[i].first == true) {
data.datasets[0].data.push({ x: serverTimelineStats[i].time - 1, y: NaN });
data.datasets[1].data.push({ x: serverTimelineStats[i].time - 1, y: NaN });
data.datasets[2].data.push({ x: serverTimelineStats[i].time - 1, y: NaN });
data.datasets[3].data.push({ x: serverTimelineStats[i].time - 1, y: NaN });
}
if (serverTimelineStats[i].conn) {
data.datasets[0].data.push({ x: serverTimelineStats[i].time, y: serverTimelineStats[i].conn.ca });
data.datasets[1].data.push({ x: serverTimelineStats[i].time, y: serverTimelineStats[i].conn.cu });
@ -10729,6 +10735,12 @@
]
};
for (var i = 0; i < serverTimelineStats.length; i++) {
if (serverTimelineStats[i].first == true) {
data.datasets[0].data.push({ x: serverTimelineStats[i].time - 1, y: NaN });
data.datasets[1].data.push({ x: serverTimelineStats[i].time - 1, y: NaN });
data.datasets[2].data.push({ x: serverTimelineStats[i].time - 1, y: NaN });
data.datasets[3].data.push({ x: serverTimelineStats[i].time - 1, y: NaN });
}
data.datasets[0].data.push({ x: serverTimelineStats[i].time, y: serverTimelineStats[i].mem.external / (1024 * 1024) });
data.datasets[1].data.push({ x: serverTimelineStats[i].time, y: serverTimelineStats[i].mem.heapUsed / (1024 * 1024) });
data.datasets[2].data.push({ x: serverTimelineStats[i].time, y: serverTimelineStats[i].mem.heapTotal / (1024 * 1024) });