Commit 6cd25a19 authored by Miguel Jimenez Lopez's avatar Miguel Jimenez Lopez

irq-demo: Improve log messages in stats-engine

parent 2df08f0f
......@@ -17,6 +17,7 @@
#define MAX_TS 1000
#define NS_IN_A_SEC 1000000000
#define MAX_TMP_BUF 1024
#define METRICS_UNIT "s"
struct ts_stats {
double mean;
......@@ -136,28 +136,30 @@ static void log_stats_engine(stats_engine engine, int verbose)
LOG(engine, "\n===================== STATS ENGINE LOG =====================\n");
if(verbose) {
LOG(engine, "n_ts: %d", engine->n_ts);
LOG(engine, "next_ts: %d\n", engine->next_ts);
LOG(engine, "Iterations: %d\n", engine->n_iter);
LOG(engine, "Timestamps in buffer: %d", engine->n_ts);
LOG(engine, "Next timestamp (index): %d\n", engine->next_ts);
for(int i = 0 ; i < engine->n_ts ; i++) {
LOG(engine, "\tsys_ts[%d]: sec %ld, nsec %ld",
i, engine->sys_ts[i].tv_sec,
LOG(engine, "\twr_ts[%d]: sec %ld, nsec %ld [ls_valid: %d, ls: %d, l59: %d, l61: %d]",
LOG(engine, "\tusr_ts[%d]: sec %ld, nsec %ld [ls_valid: %d, ls: %d, l59: %d, l61: %d]",
i, engine->usr_ts[i].t.tv_sec,
LOG(engine, "\tdiff[%d]: diff %f",
i, engine->diff_ts[i]);
LOG(engine, "\tdiff[%d]: %f %s",
i, engine->diff_ts[i], METRICS_UNIT);
LOG(engine, "\nMetrics => nts: %d, nts_per_sec: %d\nmean: %f, stdev: %f",
engine->stats.ts_total, engine->stats.ts_per_second, engine->stats.mean, engine->stats.std);
LOG(engine, "\nMetrics => Total timestamps: %d, Timestamps per second: %d\n"
"mean: %f %s, stdev: %f %s",
engine->stats.ts_total, engine->stats.ts_per_second, engine->stats.mean,
METRICS_UNIT, engine->stats.std, METRICS_UNIT);
LOG(engine, "\n============================================================\n");
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