Merge remote-tracking branch 'origin/runtime_stats' into integration

This commit is contained in:
J. Nick Koston 2025-07-12 07:21:51 -10:00
commit 671f0d62c7
No known key found for this signature in database
8 changed files with 12 additions and 9 deletions

View File

@ -17,7 +17,7 @@ CONFIG_SCHEMA = cv.Schema(
{
cv.GenerateID(): cv.declare_id(RuntimeStatsCollector),
cv.Optional(
CONF_LOG_INTERVAL, default=60000
CONF_LOG_INTERVAL, default="60s"
): cv.positive_time_period_milliseconds,
}
)

View File

@ -23,10 +23,10 @@ class ComponentRuntimeStats {
public:
ComponentRuntimeStats()
: period_count_(0),
total_count_(0),
period_time_ms_(0),
total_time_ms_(0),
period_max_time_ms_(0),
total_count_(0),
total_time_ms_(0),
total_max_time_ms_(0) {}
void record_time(uint32_t duration_ms) {

View File

@ -4,6 +4,9 @@
#include "esphome/core/hal.h"
#include <algorithm>
#include <ranges>
#ifdef USE_RUNTIME_STATS
#include "esphome/components/runtime_stats/runtime_stats.h"
#endif
#ifdef USE_STATUS_LED
#include "esphome/components/status_led/status_led.h"

View File

@ -9,9 +9,6 @@
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
#include "esphome/core/preferences.h"
#ifdef USE_RUNTIME_STATS
#include "esphome/components/runtime_stats/runtime_stats.h"
#endif
#include "esphome/core/scheduler.h"
#ifdef USE_DEVICES

View File

@ -9,6 +9,9 @@
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#ifdef USE_RUNTIME_STATS
#include "esphome/components/runtime_stats/runtime_stats.h"
#endif
namespace esphome {

View File

@ -6,9 +6,6 @@
#include <string>
#include "esphome/core/optional.h"
#ifdef USE_RUNTIME_STATS
#include "esphome/components/runtime_stats/runtime_stats.h"
#endif
namespace esphome {

View File

@ -0,0 +1,2 @@
# Test runtime_stats component with default configuration
runtime_stats:

View File

@ -0,0 +1 @@
<<: !include common.yaml