mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-15 10:17:33 -05:00
calculate average uploadvolume
This commit is contained in:
@@ -55,7 +55,6 @@ exports.contact_system = async function (req, res) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(user);
|
|
||||||
let message = "Thank you for contributing a feed to OpenMHz. A user has sent in a message about this feed:\n\n-------------------------------\n"
|
let message = "Thank you for contributing a feed to OpenMHz. A user has sent in a message about this feed:\n\n-------------------------------\n"
|
||||||
message = message + "User Name: " + req.body.name + "\n";
|
message = message + "User Name: " + req.body.name + "\n";
|
||||||
message = message + "User Email: " + req.body.email + "\n-------------------------------\n";
|
message = message + "User Email: " + req.body.email + "\n-------------------------------\n";
|
||||||
|
|||||||
@@ -11,11 +11,13 @@ var spots = (24 * 60) / timePeriod; // the number of spots needed to keep track
|
|||||||
|
|
||||||
async function updateActiveSystems() {
|
async function updateActiveSystems() {
|
||||||
// Go through all of the Systems
|
// Go through all of the Systems
|
||||||
|
let siteTotal = 0;
|
||||||
for await (let item of System.find()) {
|
for await (let item of System.find()) {
|
||||||
// go through all the systems
|
// go through all the systems
|
||||||
// if you have received some calls during that last period, make the system active
|
// if you have received some calls during that last period, make the system active
|
||||||
if ((callTotals[item.shortName] != undefined) && (callTotals[item.shortName] > 0)) {
|
if ((callTotals[item.shortName] != undefined) && (callTotals[item.shortName] > 0)) {
|
||||||
item.active = true;
|
item.active = true;
|
||||||
|
siteTotal += callTotals[item.shortName];
|
||||||
item.callAvg = callTotals[item.shortName] / timePeriod;
|
item.callAvg = callTotals[item.shortName] / timePeriod;
|
||||||
item.lastActive = new Date();
|
item.lastActive = new Date();
|
||||||
} else {
|
} else {
|
||||||
@@ -32,6 +34,7 @@ async function updateActiveSystems() {
|
|||||||
}*/
|
}*/
|
||||||
await item.save();
|
await item.save();
|
||||||
};
|
};
|
||||||
|
console.log("Site average uploads per minute: " + siteTotal / timePeriod);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.initStats = async function () {
|
exports.initStats = async function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user