up
This commit is contained in:
@@ -23,6 +23,8 @@ namespace AZ.Compute.Agent
|
||||
NetworkInterface nic;
|
||||
ulong totalNetworkBytes;
|
||||
|
||||
const double nicSpeed = 10 * 1024 * 1024; // 10 MBps
|
||||
|
||||
|
||||
[Export] string id;
|
||||
[Export] string ip;
|
||||
@@ -103,7 +105,9 @@ namespace AZ.Compute.Agent
|
||||
|
||||
var ntb = (ulong)nic.GetIPv4Statistics().BytesReceived + (ulong)nic.GetIPv4Statistics().BytesSent;
|
||||
|
||||
network = (float)(((ntb - totalNetworkBytes) / 5.0) / nic.Speed);
|
||||
network = (float)(((ntb - totalNetworkBytes) / 5.0) / nicSpeed);
|
||||
|
||||
totalNetworkBytes = ntb;
|
||||
|
||||
Cpu = cpuCounter.NextValue();
|
||||
Ram = ramCounter.NextValue();
|
||||
|
||||
Reference in New Issue
Block a user