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

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

No files matched your search

+15
View File
@@ -1075,3 +1075,18 @@ func (client *peerRESTClient) ReloadSiteReplicationConfig(ctx context.Context) e
defer http.DrainBody(respBody)
return nil
}
func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (dailyAllTierStats, error) {
var result map[string]lastDayTierStats
respBody, err := client.callWithContext(context.Background(), peerRESTMethodGetLastDayTierStats, nil, nil, -1)
if err != nil {
return result, err
}
defer http.DrainBody(respBody)
err = gob.NewDecoder(respBody).Decode(&result)
if err != nil {
return dailyAllTierStats{}, err
}
return dailyAllTierStats(result), nil
}