feat: auto-flush stats timer, .env.json defaults, expose round-trip+timer tests

This commit is contained in:
2026-10-24 00:36:36 +02:00
parent 0bd9dcd584
commit 7d968fb7a0
5 changed files with 48 additions and 1 deletions
+2 -1
View File
@@ -83,7 +83,8 @@ ExitCode RunExposeServe(const ParsedArgs& args, Output& out) {
auto& sc = realtime::expose::StatsCollector::Global();
sc.Configure(realtime::expose::MakeStatsStore(""));
std::string serr;
(void)sc.Flush(serr); // ensure schema exists; batch flushes follow on timer
(void)sc.Flush(serr); // ensure schema exists
sc.StartAutoFlush(); // time-based persisted flush (STATS_FLUSH_SECS, default 5s)
molo::app::views::View::SetObserver([](const std::string& m, std::uint64_t bi,
std::uint64_t bo, std::uint64_t us) {
realtime::expose::StatsCollector::Global().Note(m, bi, bo, us);