mirror of
https://github.com/optim-enterprises-bv/nDPId.git
synced 2025-10-29 01:12:22 +00:00
Generate global stats with microseconds precision.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -1786,9 +1786,19 @@ static int write_global_flow_stats(void)
|
|||||||
}
|
}
|
||||||
buf[-1] = '\n';
|
buf[-1] = '\n';
|
||||||
|
|
||||||
time_t timestamp = time(NULL);
|
struct timeval tval;
|
||||||
fprintf(stats_csv_fp, "%lld,%s", (long long int)timestamp, output_buffer);
|
if (gettimeofday(&tval, NULL) == 0)
|
||||||
rc = 0;
|
{
|
||||||
|
unsigned long long int sec = tval.tv_sec;
|
||||||
|
unsigned long long int usec = tval.tv_usec;
|
||||||
|
unsigned long long int timestamp = usec + sec * 1000 * 1000;
|
||||||
|
fprintf(stats_csv_fp, "%llu,%s", timestamp, output_buffer);
|
||||||
|
rc = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf(stats_csv_fp, "0,%s", output_buffer);
|
||||||
|
}
|
||||||
failure:
|
failure:
|
||||||
// reset all counters until the analysed timer is ready again
|
// reset all counters until the analysed timer is ready again
|
||||||
memset(&analysed_statistics.counters, 0, sizeof(analysed_statistics.counters));
|
memset(&analysed_statistics.counters, 0, sizeof(analysed_statistics.counters));
|
||||||
|
|||||||
Reference in New Issue
Block a user