fclose(opt.f_msgs);
if (opt.f_stat) {
+ struct histogram_stats hs;
fprintf(opt.f_stat, "cmdline='");
for (i=0; i<argc; i++)
fprintf(opt.f_stat, "%s%s", argv[i], i < argc-1 ? " " : "");
timespec_subtract(&diff, &stats.tac, &stats.tic);
fprintf(opt.f_stat, "duration=%s # seconds\n", tstamp_str(NULL, &diff));
-
+
fprintf(opt.f_stat, "sent=%d\n", count);
fprintf(opt.f_stat, "overrun=%d\n", stats.overrun);
if (stats.overrun && !opt.quiet)
if (stats.timeouts && !opt.quiet)
printf("invalid_frame=%d\n", stats.timeouts);
+ histogram_stats(&histogram_gw, &hs);
+ double avg = hs.count ? (double)hs.sum/hs.count : 0;
+ fprintf(opt.f_stat, "avg=%g\n", avg);
+ for (i = 0; i <= 20; i++)
+ fprintf(opt.f_stat, "percentile%d=%d\n", i*5, hs.percentile[i*5]);
+
fclose(opt.f_stat);
}