diff options
| author | Joseph Henry <josephjah@gmail.com> | 2018-06-12 16:30:46 -0700 |
|---|---|---|
| committer | Joseph Henry <josephjah@gmail.com> | 2018-06-12 16:30:46 -0700 |
| commit | 0faa655b834be45d379c84769604b5c43f734650 (patch) | |
| tree | 18fa39de247e0989ddddfbe54d9a74d9e80548b2 /node/Path.hpp | |
| parent | 6fddf31db31a6f3d0f9c6dd7e611543f56d6fc2f (diff) | |
| download | infinitytier-0faa655b834be45d379c84769604b5c43f734650.tar.gz infinitytier-0faa655b834be45d379c84769604b5c43f734650.zip | |
Reduced how often relative path qualities and aggregate link allocations are computed
Diffstat (limited to 'node/Path.hpp')
| -rw-r--r-- | node/Path.hpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/node/Path.hpp b/node/Path.hpp index 71615d50..e0426323 100644 --- a/node/Path.hpp +++ b/node/Path.hpp @@ -119,7 +119,8 @@ public: _packetErrorRatio(0.0), _packetLossRatio(0), _lastComputedStability(0.0), - _lastComputedRelativeQuality(0) + _lastComputedRelativeQuality(0), + _lastAllocation(0.0) { prepareBuffers(); } @@ -149,7 +150,8 @@ public: _packetErrorRatio(0.0), _packetLossRatio(0), _lastComputedStability(0.0), - _lastComputedRelativeQuality(0) + _lastComputedRelativeQuality(0), + _lastAllocation(0.0) { prepareBuffers(); _phy->getIfName((PhySocket *)((uintptr_t)_localSocket), _ifname, 16); @@ -519,6 +521,18 @@ public: inline float relativeQuality() { return _lastComputedRelativeQuality; } /** + * Assign a new allocation value for this path in the aggregate link + * + * @param allocation Percentage of traffic to be sent over this path to a peer + */ + inline void updateComponentAllocationOfAggregateLink(float allocation) { _lastAllocation = allocation; } + + /** + * @return Percentage of traffic allocated to this path in the aggregate link + */ + inline float allocation() { return _lastAllocation; } + + /** * @return Stability estimates can become expensive to compute, we cache the most recent result. */ inline float lastComputedStability() { return _lastComputedStability; } @@ -682,6 +696,7 @@ private: // cached estimates float _lastComputedStability; float _lastComputedRelativeQuality; + float _lastAllocation; // cached human-readable strings for tracing purposes char _ifname[16]; |
