diff options
| author | Joseph Henry <josephjah@gmail.com> | 2018-06-14 16:48:35 -0700 |
|---|---|---|
| committer | Joseph Henry <josephjah@gmail.com> | 2018-06-14 16:48:35 -0700 |
| commit | 52264d5e284c49817fa0a4dd4f1f0c9feeced41d (patch) | |
| tree | 3d4dccf63294927c5da15bde1f90e36cb395dcd6 /node/Peer.cpp | |
| parent | 17fbb020e733fab8d8be933bb4981927015a10f5 (diff) | |
| download | infinitytier-52264d5e284c49817fa0a4dd4f1f0c9feeced41d.tar.gz infinitytier-52264d5e284c49817fa0a4dd4f1f0c9feeced41d.zip | |
Fixed aggregateLinkLatency(). Also changed unit for throughput from byte to bit
Diffstat (limited to 'node/Peer.cpp')
| -rw-r--r-- | node/Peer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index 0f471b07..1d581ab8 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -349,12 +349,14 @@ float Peer::computeAggregateLinkPacketDelayVariance() float Peer::computeAggregateLinkMeanLatency() { float ml = 0.0; + int pathCount = 0; for(unsigned int i=0;i<ZT_MAX_PEER_NETWORK_PATHS;++i) { if (_paths[i].p) { + pathCount++; ml += _paths[i].p->relativeQuality() * _paths[i].p->meanLatency(); } } - return ml; + return ml / pathCount; } int Peer::aggregateLinkPhysicalPathCount() |
