healthcheck latency of the provider is also stored in the extra, without compromising rest api compatibility

This commit is contained in:
tommytag
2023-12-06 17:11:24 +08:00
parent 2d7538aca6
commit f63acc0202
7 changed files with 69 additions and 109 deletions

View File

@@ -147,15 +147,19 @@ type DelayHistory struct {
Delay uint16 `json:"delay"`
}
type ProxyState struct {
Alive bool `json:"alive"`
History []DelayHistory `json:"history"`
}
type DelayHistoryStoreType int
type Proxy interface {
ProxyAdapter
AliveForTestUrl(url string) bool
Alive(url string) bool
DelayHistory() []DelayHistory
ExtraDelayHistory() map[string][]DelayHistory
ExtraDelayHistories() map[string]ProxyState
LastDelayForTestUrl(url string) uint16
OriginalHealthCheckUrl(url string)
URLTest(ctx context.Context, url string, expectedStatus utils.IntRanges[uint16]) (uint16, error)
// Deprecated: use DialContext instead.