Commit 7aef4f30 authored by Andreas Schmidt's avatar Andreas Schmidt

Expose app-limited. Space calculations.

parent 00c47278
Pipeline #2122 failed with stages
in 21 seconds
......@@ -161,7 +161,8 @@ cdef extern from "proto/socket.h":
bint PrrtSocket_get_bbr_round_start(PrrtSocket *s)
bint PrrtSocket_get_app_limited(PrrtSocket *socket)
uint32_t PrrtSocket_get_bbr_app_limited(PrrtSocket *socket)
bint PrrtSocket_get_bbr_is_app_limited(PrrtSocket *socket)
bint PrrtSocket_enable_thread_pinning(PrrtSocket *socket)
cdef extern from "proto/stores/packetDeliveryStore.h":
......
......@@ -102,8 +102,8 @@ static bool send_packet(PrrtSocket *sock_ptr, PrrtPacket *packet) {
do {
prrtTimeDifference_t now = (prrtTimeDifference_t) PrrtClock_get_current_time_us();
diff = ((prrtTimeDifference_t) sock_ptr->nextSendTime) - now;
prrtByteCount_t cwnd = BBR_getCwnd(sock_ptr->receiver->bbr);
prrtByteCount_t pipe = PrrtReceiver_get_pipe(sock_ptr->receiver);
int64_t cwnd = (int64_t) BBR_getCwnd(sock_ptr->receiver->bbr);
int64_t pipe = (int64_t) PrrtReceiver_get_pipe(sock_ptr->receiver);
space = cwnd - pipe;
debug(DEBUG_DATATRANSMITTER, "C: %u, P: %u, S: %d", cwnd, pipe, space);
if(space < 0) {
......
......@@ -177,7 +177,7 @@ void PrrtReceiver_updateRateSample(PrrtRateSample *rateSample, PrrtPacket *packe
void PrrtReceiver_on_application_write(PrrtReceiver *receiver, uint32_t send_queue_length) {
check(pthread_mutex_lock(&receiver->lock) == 0, "Lock failed.");
PrrtPacketTracking *tracking = receiver->packetTracking;
if(send_queue_length == 0 && tracking->pipe <= receiver->bbr->cwnd) {
if(send_queue_length == 0 && tracking->pipe < BBR_getCwnd(receiver->bbr)) {
tracking->app_limited = (tracking->delivered + tracking->pipe) ? : 1;
}
check(pthread_mutex_unlock(&receiver->lock) == 0, "Unlock failed.");
......
......@@ -656,9 +656,12 @@ uint32_t PrrtSocket_get_cycle_index(PrrtSocket *s) {
return BBR_getCycleIndex(s->receiver->bbr);
}
bool PrrtSocket_get_app_limited(PrrtSocket *s) {
bool PrrtSocket_get_bbr_is_app_limited(PrrtSocket *s) {
return s->receiver->rateSample->is_app_limited;
}
uint32_t PrrtSocket_get_bbr_app_limited(PrrtSocket *s) {
return s->receiver->packetTracking->app_limited;
}
bool PrrtSocket_get_bbr_round_start(PrrtSocket *s) {
return BBR_getRoundStart(s->receiver->bbr);
}
......@@ -140,7 +140,8 @@ prrtDeliveryRate_t PrrtSocket_get_btlbw(PrrtSocket *s);
uint64_t PrrtSocket_get_full_bw(PrrtSocket *s);
bool PrrtSocket_get_filled_pipe(PrrtSocket *s);
uint32_t PrrtSocket_get_bbr_state(PrrtSocket *s);
bool PrrtSocket_get_app_limited(PrrtSocket *s);
uint32_t PrrtSocket_get_bbr_app_limited(PrrtSocket *s);
bool PrrtSocket_get_bbr_is_app_limited(PrrtSocket *s);
uint32_t PrrtSocket_get_cycle_index(PrrtSocket *s);
float PrrtSocket_get_pacing_gain(PrrtSocket *s);
uint32_t PrrtSocket_get_cwnd(PrrtSocket *s);
......
......@@ -259,11 +259,17 @@ cdef class PrrtSocket:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_delivered(self._c_socket)
property app_limited:
property bbr_is_app_limited:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_app_limited(self._c_socket)
return cprrt.PrrtSocket_get_bbr_is_app_limited(self._c_socket)
property bbr_app_limited:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_bbr_app_limited(self._c_socket)
property bbr_round_start:
def __get__(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment