pub async fn flush(
metrics: &RepoMetrics,
pool: &SqlitePool,
now: i64,
) -> Result<()>Expand description
Write the buffered samples and prune each key back to its window.
Called on a timer and before rendering. Errors are returned rather than logged here so the caller decides: a metrics write failing must never take down the request that produced the sample.