light cca refator and expose some cca values to the outside

This commit is contained in:
2024-07-12 13:14:24 +02:00
parent 1d97dbe73d
commit 6e681aa3fd
9 changed files with 110 additions and 36 deletions

View File

@@ -30,6 +30,7 @@ void FlowOnly::updateWindow(void) {
}
void FlowOnly::updateCongestion(void) {
updateWindow();
const auto tmp_window = getWindow();
// packet window * 0.3
// but atleast 4
@@ -57,8 +58,7 @@ void FlowOnly::updateCongestion(void) {
}
}
float FlowOnly::getWindow(void) {
updateWindow();
float FlowOnly::getWindow(void) const {
return _fwnd;
}
@@ -102,11 +102,18 @@ int64_t FlowOnly::inFlightCount(void) const {
return _in_flight.size();
}
int64_t FlowOnly::inFlightBytes(void) const {
return _in_flight_bytes;
}
void FlowOnly::onSent(SeqIDType seq, size_t data_size) {
if constexpr (true) {
size_t sum {0u};
for (const auto& it : _in_flight) {
assert(it.id != seq);
sum += it.bytes;
}
assert(_in_flight_bytes == sum);
}
const auto& new_entry = _in_flight.emplace_back(