Add GetAverageResponseTimeByKey method on store for response time badges

This commit is contained in:
TwinProduction
2021-08-21 10:59:09 -04:00
committed by Chris
parent e8adc75afe
commit 75d8b40327
3 changed files with 84 additions and 0 deletions

View File

@ -24,6 +24,9 @@ type Store interface {
// GetUptimeByKey returns the uptime percentage during a time range
GetUptimeByKey(key string, from, to time.Time) (float64, error)
// GetAverageResponseTimeByKey returns the average response time in milliseconds (value) during a time range
GetAverageResponseTimeByKey(key string, from, to time.Time) (int, error)
// GetHourlyAverageResponseTimeByKey returns a map of hourly (key) average response time in milliseconds (value) during a time range
GetHourlyAverageResponseTimeByKey(key string, from, to time.Time) (map[int64]int, error)