feat: maintain in-memory tier stats for the last 24hrs (#13782)

This commit is contained in:
Krishnan Parthasarathi
2022-01-26 14:33:10 -08:00
committed by GitHub
parent f4e373e0d2
commit d2e5f01542
9 changed files with 255 additions and 24 deletions

View File

@@ -227,7 +227,11 @@ func (api adminAPIHandlers) TierStatsHandler(w http.ResponseWriter, r *http.Requ
return
}
data, err := json.Marshal(dui.tierStats())
tierStats := dui.tierStats()
dailyStats := globalNotificationSys.GetLastDayTierStats(ctx)
tierStats = dailyStats.addToTierInfo(tierStats)
data, err := json.Marshal(tierStats)
if err != nil {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
return