Improve output of bond list command
This commit is contained in:
parent
718039561e
commit
0797adf223
5 changed files with 70 additions and 32 deletions
|
@ -1159,16 +1159,17 @@ void Bond::estimatePathQuality(int64_t now)
|
|||
// Compute/Smooth average of real-world observations
|
||||
_paths[i].latencyMean = _paths[i].latencySamples.mean();
|
||||
_paths[i].latencyVariance = _paths[i].latencySamples.stddev();
|
||||
//_paths[i].packetErrorRatio = 1.0 - (_paths[i].packetValiditySamples.count() ? _paths[i].packetValiditySamples.mean() : 1.0);
|
||||
|
||||
if (userHasSpecifiedLinkSpeeds()) {
|
||||
// Use user-reported metrics
|
||||
SharedPtr<Link> link = RR->bc->getLinkBySocket(_policyAlias, _paths[i].p->localSocket());
|
||||
if (link) {
|
||||
_paths[i].throughputMean = link->speed();
|
||||
_paths[i].throughputVariance = 0;
|
||||
}
|
||||
}
|
||||
// Write values to external path object so that it can be propagated to the user
|
||||
_paths[i].p->_latencyMean = _paths[i].latencyMean;
|
||||
_paths[i].p->_latencyVariance = _paths[i].latencyVariance;
|
||||
_paths[i].p->_packetLossRatio = _paths[i].packetLossRatio;
|
||||
_paths[i].p->_packetErrorRatio = _paths[i].packetErrorRatio;
|
||||
_paths[i].p->_bonded = _paths[i].bonded;
|
||||
_paths[i].p->_givenLinkSpeed = 0;//_paths[i].givenLinkSpeed;
|
||||
_paths[i].p->_allocation = _paths[i].allocation;
|
||||
|
||||
//_paths[i].packetErrorRatio = 1.0 - (_paths[i].packetValiditySamples.count() ? _paths[i].packetValiditySamples.mean() : 1.0);
|
||||
|
||||
// Drain unacknowledged QoS records
|
||||
int qosRecordTimeout = (_qosSendInterval * 3);
|
||||
|
@ -1184,7 +1185,7 @@ void Bond::estimatePathQuality(int64_t now)
|
|||
}
|
||||
}
|
||||
if (numDroppedQosOutRecords) {
|
||||
log("Dropped %d QOS out-records", numDroppedQosOutRecords);
|
||||
debug("Dropped %d QOS out-records", numDroppedQosOutRecords);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1159,8 +1159,9 @@ class Bond {
|
|||
std::vector<SharedPtr<Path> > pp;
|
||||
Mutex::Lock _l(_paths_m);
|
||||
for (unsigned int i = 0; i < ZT_MAX_PEER_NETWORK_PATHS; ++i) {
|
||||
if (! _paths[i].p)
|
||||
break;
|
||||
if (! _paths[i].p) {
|
||||
continue;
|
||||
}
|
||||
pp.push_back(_paths[i].p);
|
||||
}
|
||||
return pp;
|
||||
|
@ -1258,9 +1259,6 @@ class Bond {
|
|||
, latencyVariance(0)
|
||||
, packetLossRatio(0)
|
||||
, packetErrorRatio(0)
|
||||
, throughputMean(0)
|
||||
, throughputMax(0)
|
||||
, throughputVariance(0)
|
||||
, allocation(0)
|
||||
, byteLoad(0)
|
||||
, relativeByteLoad(0)
|
||||
|
@ -1394,9 +1392,6 @@ class Bond {
|
|||
float latencyVariance; // Packet delay variance (computed from a sliding window.)
|
||||
float packetLossRatio; // The ratio of lost packets to received packets.
|
||||
float packetErrorRatio; // The ratio of packets that failed their MAC/CRC checks to those that did not.
|
||||
uint64_t throughputMean; // The estimated mean throughput of this path.
|
||||
uint64_t throughputMax; // The maximum observed throughput of this path.
|
||||
float throughputVariance; // The variance in the estimated throughput of this path.
|
||||
uint8_t allocation; // The relative quality of this path to all others in the bond, [0-255].
|
||||
uint64_t byteLoad; // How much load this path is under.
|
||||
uint8_t relativeByteLoad; // How much load this path is under (relative to other paths in the bond.)
|
||||
|
|
|
@ -280,6 +280,41 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Mean latency as reported by the bonding layer
|
||||
*/
|
||||
inline unsigned int latencyMean() const { return _latencyMean; }
|
||||
|
||||
/**
|
||||
* @return Latency variance as reported by the bonding layer
|
||||
*/
|
||||
inline unsigned int latencyVariance() const { return _latencyVariance; }
|
||||
|
||||
/**
|
||||
* @return Packet Loss Ratio as reported by the bonding layer
|
||||
*/
|
||||
inline unsigned int packetLossRatio() const { return _packetLossRatio; }
|
||||
|
||||
/**
|
||||
* @return Packet Error Ratio as reported by the bonding layer
|
||||
*/
|
||||
inline unsigned int packetErrorRatio() const { return _packetErrorRatio; }
|
||||
|
||||
/**
|
||||
* @return Whether this path is bonded as reported by the bonding layer
|
||||
*/
|
||||
inline unsigned int bonded() const { return _bonded; }
|
||||
|
||||
/**
|
||||
* @return Given link speed as reported by the bonding layer
|
||||
*/
|
||||
inline unsigned int givenLinkSpeed() const { return _givenLinkSpeed; }
|
||||
|
||||
/**
|
||||
* @return Traffic allocation as reported by the bonding layer
|
||||
*/
|
||||
inline unsigned int allocation() const { return _allocation; }
|
||||
|
||||
void *_bondingMetricPtr;
|
||||
|
||||
private:
|
||||
|
@ -288,9 +323,18 @@ private:
|
|||
volatile int64_t _lastIn;
|
||||
volatile int64_t _lastTrustEstablishedPacketReceived;
|
||||
|
||||
volatile float _latencyMean;
|
||||
volatile float _latencyVariance;
|
||||
volatile float _packetLossRatio;
|
||||
volatile float _packetErrorRatio;
|
||||
volatile bool _bonded;
|
||||
volatile int64_t _givenLinkSpeed;
|
||||
volatile int8_t _allocation;
|
||||
|
||||
int64_t _lastEchoRequestReceived;
|
||||
|
||||
int64_t _localSocket;
|
||||
|
||||
volatile unsigned int _latency;
|
||||
InetAddress _addr;
|
||||
InetAddress::IpScope _ipScope; // memoize this since it's a computed value checked often
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue