Versions in this module Expand all Collapse all v1 v1.0.0 Jun 10, 2026 Changes in this version + const DEFAULT_CHANNEL_SIZE + const DefaultAddrStr + const DefaultCacheCleanRate + const DefaultCacheTimeout + const DefaultRcvBuff + const DefaultReadTimeout + const DefaultTos + const ExpireNow + func CalcCounts(results []*Result, summary *Summary) + func CalcLoss(summary *Summary) + func CalcRTT(results []*Result, summary *Summary) + func EmitMetricsFromSummaries(summaries []*Summary, t TagSet, setter MetricSetter) + func EnableTimestamps(conn *net.UDPConn) + func FileCloseHandler(f *os.File) + func GetTos(conn *net.UDPConn) byte + func HandleError(err error) + func HandleFatalError(err error) + func HandleFatalErrorMsg(err error, msg string) + func HandleMinorError(err error) + func HandleMinorErrorMsg(err error, msg string) + func IDToBytes(id string) [10]byte + func LocalUDPAddr(conn *net.UDPConn) (*net.UDPAddr, string, error) + func LogInfo(msg string) + func LogWarning(msg string) + func NewID() string + func NowUint64() uint64 + func NsToMs(ns float64) float64 + func RTT(probe *InFlightProbe, result *Result) error + func Receive(data []byte, oob []byte, conn *net.UDPConn) ([]byte, []byte, *net.UDPAddr, error) + func Reflect(ctx context.Context, conn *net.UDPConn, rl *rate.Limiter) + func RegisterPrometheus() + func RegisterReflectorPrometheus() + func Send(data []byte, tos byte, conn *net.UDPConn, addr *net.UDPAddr) error + func SetRecvBufferSize(conn *net.UDPConn, size int) + func SetTos(conn *net.UDPConn, tos byte) + type API struct + func NewAPI(s *Summarizer, t TagSet, addr string) *API + func (api *API) MergeUpdateTagSet(t TagSet) + func (api *API) PromHandler() http.Handler + func (api *API) Run() + func (api *API) RunForever() + func (api *API) StatusHandler(rw http.ResponseWriter, request *http.Request) + func (api *API) Stop() + type APIConfig struct + Bind string + type Collector struct + func (c *Collector) LoadConfig() + func (c *Collector) Reload() + func (c *Collector) Run() + func (c *Collector) Setup() + func (c *Collector) SetupAPI() + func (c *Collector) SetupSummarizer() + func (c *Collector) SetupTagSet() + func (c *Collector) SetupTestRunner(test TestConfig) + func (c *Collector) SetupTestRunners() + func (c *Collector) Stop() + type CollectorConfig struct + API APIConfig + PortGroups PortGroupsConfig + Ports PortsConfig + RateLimits RateLimitsConfig + SrcHostname string + Summarization SummarizationConfig + Targets TargetsConfig + Tests TestsConfig + func NewCollectorConfig(data []byte) (*CollectorConfig, error) + func NewDefaultCollectorConfig() (*CollectorConfig, error) + type InFlightProbe struct + CRcvd uint64 + CSent uint64 + Pd *PathDist + ReflectorRcvd uint64 + Tos byte + func IfaceToInFlightProbe(iface interface{}) (*InFlightProbe, error) + type LegacyCollectorConfig map[string]map[string]string + func NewLegacyCollectorConfig(data []byte) (*LegacyCollectorConfig, error) + func (legacy *LegacyCollectorConfig) ToDefaultCollectorConfig(port int64) (*CollectorConfig, error) + type MetricSetter interface + SetPacketLoss func(labels map[string]string, value float64) + SetPacketsLost func(labels map[string]string, value float64) + SetPacketsSent func(labels map[string]string, value float64) + SetRTT func(labels map[string]string, value float64) + type PathDist struct + DstIP net.IP + DstPort int + Proto string + SrcIP net.IP + SrcPort int + type Port struct + func NewDefault(tosend chan *net.UDPAddr, stop chan bool, cbc chan *InFlightProbe) *Port + func NewPort(conn *net.UDPConn, tosend chan *net.UDPAddr, stop chan bool, ...) *Port + func (p *Port) Recv() + func (p *Port) Send() + func (p *Port) Tos() byte + type PortConfig struct + IP string + Port int64 + Timeout int64 + Tos int64 + type PortGroup struct + func NewPortGroup(stop chan bool, cbc chan *InFlightProbe, tosend chan *net.UDPAddr) *PortGroup + func (pg *PortGroup) Add(p *Port, c chan *net.UDPAddr) + func (pg *PortGroup) AddNew(portStr string, tos byte, cTimeout time.Duration, cCleanRate time.Duration, ...) (*Port, chan *net.UDPAddr) + func (pg *PortGroup) Del(p *Port) + func (pg *PortGroup) Run() + func (pg *PortGroup) Stop() + type PortGroupConfig struct + Count int64 + Port string + type PortGroupsConfig map[string][]PortGroupConfig + func (pgc PortGroupsConfig) Exists(name string) bool + type PortsConfig map[string]PortConfig + func (pc PortsConfig) Exists(name string) bool + type PrometheusMetricSetter struct + func (p *PrometheusMetricSetter) SetPacketLoss(labels map[string]string, value float64) + func (p *PrometheusMetricSetter) SetPacketsLost(labels map[string]string, value float64) + func (p *PrometheusMetricSetter) SetPacketsSent(labels map[string]string, value float64) + func (p *PrometheusMetricSetter) SetRTT(labels map[string]string, value float64) + type RateLimitConfig struct + CPS float64 + type RateLimitsConfig map[string]RateLimitConfig + func (rlc RateLimitsConfig) Exists(name string) bool + type ReflectorAPI struct + func NewReflectorAPI(bind string) *ReflectorAPI + func (api *ReflectorAPI) PromHandler() http.Handler + func (api *ReflectorAPI) Run() + func (api *ReflectorAPI) StatusHandler(w http.ResponseWriter, r *http.Request) + func (api *ReflectorAPI) Stop() + type Result struct + Done uint64 + Lost bool + Pd *PathDist + RTT uint64 + Tos byte + func Process(probe *InFlightProbe) *Result + type ResultHandler struct + func NewResultHandler(in chan *InFlightProbe, out chan *Result) *ResultHandler + func (rh *ResultHandler) Run() + func (rh *ResultHandler) Stop() + type SummarizationConfig struct + Handlers int64 + Interval int64 + type Summarizer struct + CMutex sync.RWMutex + Cache []*Summary + func NewSummarizer(in chan *Result, interval time.Duration) *Summarizer + func (s *Summarizer) Run() + func (s *Summarizer) Stop() + type Summary struct + Loss float64 + Lost int + Pd *PathDist + RTTAvg float64 + RTTMax float64 + RTTMin float64 + Sent int + TS time.Time + Tos byte + type TagSet map[string]Tags + func (ts TagSet) Get(key string) Tags + func (ts TagSet) Set(key, tag, value string) + type Tags = map[string]string + type TargetConfig struct + IP string + Port int64 + Tags Tags + func (tc *TargetConfig) AddrString() string + func (tc *TargetConfig) ResolveUDPAddr() (*net.UDPAddr, error) + type TargetSet []TargetConfig + func (ts TargetSet) IntoTagSet(tagset TagSet, srcHostname string, targetSetName string) + func (ts TargetSet) ListResolvedTargets() ([]*net.UDPAddr, error) + func (ts TargetSet) ListTargets() []string + func (ts TargetSet) TagSet(srcHostname string) TagSet + type TargetsConfig map[string]TargetSet + func (tc TargetsConfig) Exists(name string) bool + func (tc TargetsConfig) IntoTagSet(ts TagSet, srcHostname string) + func (tc TargetsConfig) TagSet(srcHostname string) TagSet + type TestConfig struct + PortGroup string + RateLimit string + Targets string + type TestRunner struct + func NewTestRunner(cbc chan *InFlightProbe, rl *rate.Limiter) *TestRunner + func (tr *TestRunner) Add(addrs ...*net.UDPAddr) + func (tr *TestRunner) AddNewPort(portStr string, tos byte, cTimeout time.Duration, cCleanRate time.Duration, ...) + func (tr *TestRunner) Del(addr *net.UDPAddr) + func (tr *TestRunner) Run() + func (tr *TestRunner) Set(targets []*net.UDPAddr) + func (tr *TestRunner) Stop() + type TestsConfig []TestConfig