Commit 9584020d authored by Andreas Schmidt's avatar Andreas Schmidt

Log network pace.

parent 45325c31
......@@ -564,6 +564,12 @@ uint32_t PrrtSocket_get_sock_opt(PrrtSocket *s, const char *name) {
return s->send_peer_btl_pace;
} else if (strcmp(name, "recv_peer_btl_pace") == 0) {
return s->recv_peer_btl_pace;
} else if (strcmp(name, "nw_pace") == 0) {
double pacingRate = PrrtReceiver_get_BBR_pacingRate(s->receiver);
if (pacingRate == 0) {
return 0;
}
return (prrtTimedelta_t) round(((1000 * 1000 * ((double) s->maximum_payload_size)) / pacingRate));
} else if (strcmp(name, "connected") == 0) {
return (s->receiver != NULL) ? 1 : 0;
} else if (strcmp(name, "maximum_payload_size") == 0) {
......
......@@ -128,6 +128,10 @@ static inline long long int _recv_peer_btl_pace(socket_t conn) {
return 0;
}
static inline long long int _nw_pace(socket_t conn) {
return 0;
}
static inline long long int _app_send_pace_max(socket_t conn) {
return 0;
}
......@@ -215,6 +219,10 @@ static inline long long int _recv_peer_btl_pace(socket_t conn) {
return PrrtSocket_get_sock_opt(conn, "recv_peer_btl_pace");
}
static inline long long int _nw_pace(socket_t conn) {
return PrrtSocket_get_sock_opt(conn, "nw_pace");
}
static inline long long int _app_send_pace_max(socket_t conn) {
return PrrtSocket_get_sock_opt(conn, "app_send_max_pace");
}
......
......@@ -131,6 +131,7 @@ int main(int argc, char **argv) {
long long int *trans_transmit_pace_max = calloc((size_t) rounds, sizeof(long long int));
long long int *trans_transmit_pace_eff = calloc((size_t) rounds, sizeof(long long int));
long long int *recv_peer_btl_pace = calloc((size_t) rounds, sizeof(long long int));
long long int *nw_pace = calloc((size_t) rounds, sizeof(long long int));
struct timespec prev;
clock_gettime(CLOCK_REALTIME, &prev);
......@@ -146,6 +147,7 @@ int main(int argc, char **argv) {
trans_transmit_pace_max[round] = _trans_transmit_pace_max(s);
trans_transmit_pace_eff[round] = _trans_transmit_pace_eff(s);
recv_peer_btl_pace[round] = _recv_peer_btl_pace(s);
nw_pace[round] = _nw_pace(s);
sprintf(buf, "%10d", round);
memcpy(buf + 20, &now, sizeof(struct timespec));
_send(s, buf, buffer_size * sizeof(char));
......@@ -160,8 +162,8 @@ int main(int argc, char **argv) {
int i;
for (i = 1; i < rounds; i++) {
fprintf(out_desc, "%u, %lli, %lli, %lli, %lli, %lli, %lli, %lli\n",
i, sendt[i], ipts[i], app_send_pace_max[i], app_send_pace_eff[i], trans_transmit_pace_max[i], trans_transmit_pace_eff[i], recv_peer_btl_pace[i]);
fprintf(out_desc, "%u, %lli, %lli, %lli, %lli, %lli, %lli, %lli, %lli\n",
i, sendt[i], ipts[i], app_send_pace_max[i], app_send_pace_eff[i], trans_transmit_pace_max[i], trans_transmit_pace_eff[i], recv_peer_btl_pace[i], nw_pace[i]);
}
if (file_output) {
......@@ -177,6 +179,7 @@ int main(int argc, char **argv) {
free(trans_transmit_pace_eff);
free(trans_transmit_pace_max);
free(recv_peer_btl_pace);
free(nw_pace);
free(buf);
return 0;
}
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