add observePeriod option for observer

This commit is contained in:
ginuerzh
2024-06-13 21:22:29 +08:00
parent 784e4b2b01
commit 6d819a0c06
13 changed files with 105 additions and 101 deletions

View File

@ -452,7 +452,11 @@ func (h *httpHandler) observeStats(ctx context.Context) {
return
}
ticker := time.NewTicker(5 * time.Second)
d := h.md.observePeriod
if d < time.Millisecond {
d = 5 * time.Second
}
ticker := time.NewTicker(d)
defer ticker.Stop()
for {