|
|
@ -16,7 +16,7 @@ type stat struct {
|
|
|
|
Summary check.Result `json:"summary"`
|
|
|
|
Summary check.Result `json:"summary"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var dayAggregation map[string]map[time.Time]stat
|
|
|
|
var dayAggregation = make(map[string]map[time.Time]stat)
|
|
|
|
|
|
|
|
|
|
|
|
func convertToResult(successCount, totalCount int) check.Result {
|
|
|
|
func convertToResult(successCount, totalCount int) check.Result {
|
|
|
|
if successCount >= totalCount*99/100 {
|
|
|
|
if successCount >= totalCount*99/100 {
|
|
|
@ -29,6 +29,9 @@ func convertToResult(successCount, totalCount int) check.Result {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func getDay(serviceName string, day time.Time) stat {
|
|
|
|
func getDay(serviceName string, day time.Time) stat {
|
|
|
|
|
|
|
|
if _, ok := dayAggregation[serviceName]; !ok {
|
|
|
|
|
|
|
|
dayAggregation[serviceName] = make(map[time.Time]stat)
|
|
|
|
|
|
|
|
}
|
|
|
|
if cached, ok := dayAggregation[serviceName][day]; ok {
|
|
|
|
if cached, ok := dayAggregation[serviceName][day]; ok {
|
|
|
|
return cached
|
|
|
|
return cached
|
|
|
|
}
|
|
|
|
}
|
|
|
|