33 if (it.second.get_period_count() > 0) {
39 "Component Runtime Statistics\n"
40 " Period stats (last %" PRIu32
"ms): %zu active components",
53 for (
const auto &it : this->component_stats_) {
54 if (it.second.get_period_count() > 0) {
55 sorted[idx++] = it.first;
61 return this->component_stats_[a].get_period_time_ms() > this->component_stats_[b].get_period_time_ms();
65 for (
size_t i = 0; i < count; i++) {
66 const auto &stats = this->component_stats_[sorted[i]];
67 ESP_LOGI(TAG,
" %s: count=%" PRIu32
", avg=%.2fms, max=%" PRIu32
"ms, total=%" PRIu32
"ms",
68 LOG_STR_ARG(sorted[i]->get_component_log_str()), stats.get_period_count(), stats.get_period_avg_time_ms(),
69 stats.get_period_max_time_ms(), stats.get_period_time_ms());
73 ESP_LOGI(TAG,
" Total stats (since boot): %zu active components", count);
77 return this->component_stats_[a].get_total_time_ms() > this->component_stats_[b].get_total_time_ms();
80 for (
size_t i = 0; i < count; i++) {
81 const auto &stats = this->component_stats_[sorted[i]];
82 ESP_LOGI(TAG,
" %s: count=%" PRIu32
", avg=%.2fms, max=%" PRIu32
"ms, total=%" PRIu32
"ms",
83 LOG_STR_ARG(sorted[i]->get_component_log_str()), stats.get_total_count(), stats.get_total_avg_time_ms(),
84 stats.get_total_max_time_ms(), stats.get_total_time_ms());