30 ESP_LOGI(TAG,
"Component Runtime Statistics");
31 ESP_LOGI(TAG,
"Period stats (last %" PRIu32
"ms):", this->
log_interval_);
34 std::vector<ComponentStatPair> stats_to_display;
41 stats_to_display.push_back(pair);
46 std::sort(stats_to_display.begin(), stats_to_display.end(), std::greater<ComponentStatPair>());
49 for (
const auto &it : stats_to_display) {
50 ESP_LOGI(TAG,
" %s: count=%" PRIu32
", avg=%.2fms, max=%" PRIu32
"ms, total=%" PRIu32
"ms",
51 LOG_STR_ARG(it.component->get_component_log_str()), it.stats->get_period_count(),
52 it.stats->get_period_avg_time_ms(), it.stats->get_period_max_time_ms(), it.stats->get_period_time_ms());
56 ESP_LOGI(TAG,
"Total stats (since boot):");
59 std::sort(stats_to_display.begin(), stats_to_display.end(),
61 return a.stats->get_total_time_ms() > b.stats->get_total_time_ms();
64 for (
const auto &it : stats_to_display) {
65 ESP_LOGI(TAG,
" %s: count=%" PRIu32
", avg=%.2fms, max=%" PRIu32
"ms, total=%" PRIu32
"ms",
66 LOG_STR_ARG(it.component->get_component_log_str()), it.stats->get_total_count(),
67 it.stats->get_total_avg_time_ms(), it.stats->get_total_max_time_ms(), it.stats->get_total_time_ms());