mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added traffic accounting to desktop multiplexor
This commit is contained in:
parent
f61ab701a5
commit
a25ce3c0db
2 changed files with 22 additions and 6 deletions
|
@ -43,14 +43,10 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||
|
||||
// Perform data accounting
|
||||
function dataAccounting() {
|
||||
const datain = (ws._socket.bytesRead - ws._socket.bytesReadEx);
|
||||
const dataout = (ws._socket.bytesWritten - ws._socket.bytesWrittenEx);
|
||||
parent.trafficStats.AgentCtrlIn += (ws._socket.bytesRead - ws._socket.bytesReadEx);
|
||||
parent.trafficStats.AgentCtrlOut += (ws._socket.bytesWritten - ws._socket.bytesWrittenEx);
|
||||
ws._socket.bytesReadEx = ws._socket.bytesRead;
|
||||
ws._socket.bytesWrittenEx = ws._socket.bytesWritten;
|
||||
|
||||
// Add to counters
|
||||
parent.trafficStats.AgentCtrlIn += datain;
|
||||
parent.trafficStats.AgentCtrlOut += dataout;
|
||||
}
|
||||
|
||||
// Send a message to the mesh agent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue