Usage scenarios

Log all performance measurements of a tool

  • Create a logger

  • Add performance measurements

  • Flush the logger data

te_mi_logger *logger;

CHECK_RC(te_mi_logger_meas_create("mytool", &logger));
for (i = 0; i < 10; i++)
{
   double pps;

   sleep(1);
   pps = tool_get_pps();
   tool_reset_pps();
   te_mi_logger_add_meas(logger, NULL, TE_MI_MEAS_PPS, "pps",
                         TE_MI_MEAS_AGGR_SINGLE, pps,
                         TE_MI_MEAS_MULTIPLIER_PLAIN));
}

te_mi_logger_add_meas_key(logger, NULL, "ver", "%s", tool_get_version_str());
te_mi_logger_add_comment(logger, NULL, "fake", "true");

CHECK_RC(te_mi_logger_flush(logger));