feat(metrics): persist history in sqlite and add AMD memory validate tests

This commit is contained in:
2026-03-29 12:28:06 +03:00
parent 98f0cf0d52
commit e15bcc91c5
10 changed files with 539 additions and 29 deletions

View File

@@ -599,10 +599,9 @@ func (h *handler) handleAPIMetricsStream(w http.ResponseWriter, r *http.Request)
case <-r.Context().Done():
return
case <-ticker.C:
sample := platform.SampleLiveMetrics()
h.feedRings(sample)
if h.metricsDB != nil {
_ = h.metricsDB.Write(sample)
sample, ok := h.latestMetric()
if !ok {
continue
}
b, err := json.Marshal(sample)
if err != nil {