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

@@ -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
}