bool opt_wait_for_queue_is_full; /* Don't gather any statistics until any queue is full */
bool some_queue_is_full = false;
+struct timespec reset_timestamp;
/* Locked when some queue is full to prevent multiple resets of
statstics. */
{
int i;
/* Mutexes??? */
- printf("Reseting\n");
for (i = 0; i < nr_streams; i++) {
streams[i].sent = 0;
streams[i].received = 0;
}
memset(delay_stats, 0, sizeof(delay_stats));
+ clock_gettime(CLOCK_MONOTONIC, &reset_timestamp);
}
void* receiver(void* queue)
unsigned int ac, rem_addr_length;
unsigned long int trans_time_usec;
unsigned long int min_trans_time;
- struct timespec send_timestamp,recv_timestamp, trans_time;
+ struct timespec send_timestamp,recv_timestamp, trans_time, time_from_reset;
fd_set fdset;
min_trans_time = ~0;
}
clock_gettime(CLOCK_MONOTONIC,&recv_timestamp);
send_timestamp = msg.send_timestamp;
-
+
+ /* Check whether this message was sent after reset_statistics() */
+ timespec_sub(&time_from_reset, &send_timestamp, &reset_timestamp);
+ if (time_from_reset.tv_sec < 0) {
+ printf("ted\n");
+ continue; /* If so, don't count it */
+ }
timespec_sub(&trans_time,&recv_timestamp ,&send_timestamp);
trans_time_usec = (trans_time.tv_sec * SEC_TO_USEC + \
trans_time.tv_nsec / USEC_TO_NSEC) /2;