Feature: add meanDelay on URLTest

This commit is contained in:
Dreamacro
2023-02-27 19:13:26 +08:00
parent 8173d6681b
commit f78a7cb2cb
3 changed files with 19 additions and 8 deletions

View File

@ -101,8 +101,9 @@ type ProxyAdapter interface {
}
type DelayHistory struct {
Time time.Time `json:"time"`
Delay uint16 `json:"delay"`
Time time.Time `json:"time"`
Delay uint16 `json:"delay"`
MeanDelay uint16 `json:"meanDelay"`
}
type Proxy interface {
@ -110,7 +111,7 @@ type Proxy interface {
Alive() bool
DelayHistory() []DelayHistory
LastDelay() uint16
URLTest(ctx context.Context, url string) (uint16, error)
URLTest(ctx context.Context, url string) (uint16, uint16, error)
// Deprecated: use DialContext instead.
Dial(metadata *Metadata) (Conn, error)