mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Add concurrency option for outbound observation
Add `enableConcurrency` option, false by default. If it's set as `true`, start probing outbounds concurrently in every circle of observation. Wait `probeInterval` between observation circles.
This commit is contained in:
parent
abb8ba8b0e
commit
28b17b529d
2 changed files with 38 additions and 14 deletions
|
@ -2,17 +2,18 @@ package conf
|
|||
|
||||
import (
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
|
||||
"github.com/xtls/xray-core/app/observatory"
|
||||
"github.com/xtls/xray-core/infra/conf/cfgcommon/duration"
|
||||
)
|
||||
|
||||
type ObservatoryConfig struct {
|
||||
SubjectSelector []string `json:"subjectSelector"`
|
||||
ProbeURL string `json:"probeURL"`
|
||||
ProbeInterval duration.Duration `json:"probeInterval"`
|
||||
SubjectSelector []string `json:"subjectSelector"`
|
||||
ProbeURL string `json:"probeURL"`
|
||||
ProbeInterval duration.Duration `json:"probeInterval"`
|
||||
EnableConcurrency bool `json:"enableConcurrency"`
|
||||
}
|
||||
|
||||
func (o *ObservatoryConfig) Build() (proto.Message, error) {
|
||||
return &observatory.Config{SubjectSelector: o.SubjectSelector, ProbeUrl: o.ProbeURL, ProbeInterval: int64(o.ProbeInterval)}, nil
|
||||
return &observatory.Config{SubjectSelector: o.SubjectSelector, ProbeUrl: o.ProbeURL, ProbeInterval: int64(o.ProbeInterval), EnableConcurrency: o.EnableConcurrency}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue