Commit f30202f7 authored by Joanne Hugé's avatar Joanne Hugé

Register jitter values in a histogram on the server

parent 9c0e6694
......@@ -141,6 +141,14 @@ static void *packet_receiving_thread(void *p) {
diff = calcdiff_ns(current, previous);
stats->min_interval = diff < stats->min_interval ? diff : stats->min_interval;
stats->max_interval = diff > stats->max_interval ? diff : stats->max_interval;
if( diff > MAX_HIST_VAL * 1000 ) {
fprintf(stderr, "jitter higher than MAX_HIST_VAL\n");
exit(EXIT_FAILURE);
}
else {
histograms[2][diff / 1000] = diff / 1000;
}
}
previous = current;
......@@ -235,7 +243,7 @@ static void print_histograms() {
duration_hour = duration / NSEC_PER_SEC / 3600;
duration_minutes = duration / NSEC_PER_SEC / 60 - duration_hour * 60;
interval = (param->stats.min_interval + param->stats.max_interval) / 2;
interval = (param->stats.min_interval + param->stats.max_interval) / 2 / 1000;
printf("{\"measure_sets\": [{"
"\"measure_type\": \"packet_recv_timestamps\","
......
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