mirror of
https://github.com/esphome/esphome.git
synced 2025-08-03 00:47:47 +00:00
Merge remote-tracking branch 'origin/runtime_stats' into integration
This commit is contained in:
commit
671f0d62c7
@ -17,7 +17,7 @@ CONFIG_SCHEMA = cv.Schema(
|
|||||||
{
|
{
|
||||||
cv.GenerateID(): cv.declare_id(RuntimeStatsCollector),
|
cv.GenerateID(): cv.declare_id(RuntimeStatsCollector),
|
||||||
cv.Optional(
|
cv.Optional(
|
||||||
CONF_LOG_INTERVAL, default=60000
|
CONF_LOG_INTERVAL, default="60s"
|
||||||
): cv.positive_time_period_milliseconds,
|
): cv.positive_time_period_milliseconds,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -23,10 +23,10 @@ class ComponentRuntimeStats {
|
|||||||
public:
|
public:
|
||||||
ComponentRuntimeStats()
|
ComponentRuntimeStats()
|
||||||
: period_count_(0),
|
: period_count_(0),
|
||||||
total_count_(0),
|
|
||||||
period_time_ms_(0),
|
period_time_ms_(0),
|
||||||
total_time_ms_(0),
|
|
||||||
period_max_time_ms_(0),
|
period_max_time_ms_(0),
|
||||||
|
total_count_(0),
|
||||||
|
total_time_ms_(0),
|
||||||
total_max_time_ms_(0) {}
|
total_max_time_ms_(0) {}
|
||||||
|
|
||||||
void record_time(uint32_t duration_ms) {
|
void record_time(uint32_t duration_ms) {
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
#include "esphome/core/hal.h"
|
#include "esphome/core/hal.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
|
#ifdef USE_RUNTIME_STATS
|
||||||
|
#include "esphome/components/runtime_stats/runtime_stats.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_STATUS_LED
|
#ifdef USE_STATUS_LED
|
||||||
#include "esphome/components/status_led/status_led.h"
|
#include "esphome/components/status_led/status_led.h"
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
#include "esphome/core/hal.h"
|
#include "esphome/core/hal.h"
|
||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
#include "esphome/core/preferences.h"
|
#include "esphome/core/preferences.h"
|
||||||
#ifdef USE_RUNTIME_STATS
|
|
||||||
#include "esphome/components/runtime_stats/runtime_stats.h"
|
|
||||||
#endif
|
|
||||||
#include "esphome/core/scheduler.h"
|
#include "esphome/core/scheduler.h"
|
||||||
|
|
||||||
#ifdef USE_DEVICES
|
#ifdef USE_DEVICES
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
#include "esphome/core/hal.h"
|
#include "esphome/core/hal.h"
|
||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
|
#ifdef USE_RUNTIME_STATS
|
||||||
|
#include "esphome/components/runtime_stats/runtime_stats.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
|
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "esphome/core/optional.h"
|
#include "esphome/core/optional.h"
|
||||||
#ifdef USE_RUNTIME_STATS
|
|
||||||
#include "esphome/components/runtime_stats/runtime_stats.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
|
|
||||||
|
2
tests/components/runtime_stats/common.yaml
Normal file
2
tests/components/runtime_stats/common.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Test runtime_stats component with default configuration
|
||||||
|
runtime_stats:
|
1
tests/components/runtime_stats/test.esp32-ard.yaml
Normal file
1
tests/components/runtime_stats/test.esp32-ard.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<<: !include common.yaml
|
Loading…
x
Reference in New Issue
Block a user