20#include <unordered_map>
101 [[nodiscard]] virtual auto
to_json() const -> std::
string = 0;
111 [[nodiscard]] virtual auto
name() const -> std::string_view = 0;
124 .component_name = std::string(
name()),
125 .timestamp = std::chrono::system_clock::now(),
Interface for components that expose statistics.
virtual ~IStats()=default
virtual auto to_json() const -> std::string=0
Get statistics as JSON string.
virtual auto name() const -> std::string_view=0
Get component name for identification.
virtual auto get_snapshot() const -> stats_snapshot
Get a complete statistics snapshot with metadata.
virtual auto get_stats() const -> std::unordered_map< std::string, stats_value >=0
Get current statistics as key-value pairs.
std::variant< std::int64_t, double, std::string, bool > stats_value
Type-safe value type for statistics.
Value type for statistics snapshots.
Point-in-time snapshot of component statistics.