From: Kevin Webb Date: Thu, 20 Nov 2008 23:46:19 +0000 (+0000) Subject: Added timestamps to the logs. X-Git-Tag: DistributedRateLimiting-0.1-0~38 X-Git-Url: http://git.onelab.eu/?p=distributedratelimiting.git;a=commitdiff_plain;h=fa999b096a66f3b3547652d123d1b7185f2f9cbe Added timestamps to the logs. --- diff --git a/drl/estimate.c b/drl/estimate.c index 8b3bb9a..047d5f3 100644 --- a/drl/estimate.c +++ b/drl/estimate.c @@ -237,7 +237,13 @@ static uint32_t allocate_fps(identity_t *ident, double total_weight) { } if (printcounter <= 0) { - printlog(LOG_WARN, "%d %.2f %.2f %.2f %d %d %d %d %d %d ", local_rate, idealweight, + struct timeval tv; + double time_now; + + gettimeofday(&tv, NULL); + time_now = (double) tv.tv_sec + (double) ((double) tv.tv_usec / (double) 1000000); + + printlog(LOG_WARN, "%.2f %d %.2f %.2f %.2f %d %d %d %d %d %d ", time_now, local_rate, idealweight, ident->localweight, total_weight, ftable->num_flows, ftable->num_flows_5k, ftable->num_flows_10k, ftable->num_flows_20k, ftable->num_flows_50k, ftable->avg_rate); printcounter = PRINT_COUNTER_RESET;