:orphan: .. index:: pair: page; Usage scenarios .. _doxid-group__te__tools__te__mi__log__meas_te_tools_te_mi_log_scenarios: Usage scenarios =============== Log all performance measurements of a tool ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Create a logger * Add performance measurements * Flush the logger data .. ref-code-block:: cpp :ref:`te_mi_logger ` *logger; :ref:`CHECK_RC `(:ref:`te_mi_logger_meas_create `("mytool", &logger)); for (i = 0; i < 10; i++) { double pps; sleep(1); pps = tool_get_pps(); tool_reset_pps(); :ref:`te_mi_logger_add_meas `(logger, NULL, :ref:`TE_MI_MEAS_PPS `, "pps", :ref:`TE_MI_MEAS_AGGR_SINGLE `, pps, :ref:`TE_MI_MEAS_MULTIPLIER_PLAIN `)); } :ref:`te_mi_logger_add_meas_key `(logger, NULL, "ver", "%s", tool_get_version_str()); :ref:`te_mi_logger_add_comment `(logger, NULL, "fake", "true"); :ref:`CHECK_RC `(:ref:`te_mi_logger_flush `(logger));