connectivity

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	AddressInternal string
	ClientVersion   string
	Count           int
	Debug           bool

	Delay    time.Duration
	Interval time.Duration
	Timeout  time.Duration
}

type StatCollector

type StatCollector interface {
	Interval() time.Duration
	Collect(context.Context, []string) []Statistics
	DetectDowntime([]Statistics) (bool, int)
}

func NewDialerCollector

func NewDialerCollector(opts Options) StatCollector

func NewPingCollector

func NewPingCollector(opts Options) StatCollector

type Statistics

type Statistics struct {
	PingAddress     string        `json:"pingAddress,omitempty"`
	Success         bool          `json:"success,omitempty"`
	PacketsRecv     int           `json:"packetsRecv,omitempty"`
	PacketsSent     int           `json:"packetsSent,omitempty"`
	PacketLoss      float64       `json:"packetLoss,omitempty"`
	MinRtt          time.Duration `json:"minRtt,omitempty"`
	MaxRtt          time.Duration `json:"maxRtt,omitempty"`
	AvgRtt          time.Duration `json:"avgRtt,omitempty"`
	StdDevRtt       time.Duration `json:"stdDevRtt,omitempty"`
	TimeStamp       int64         `json:"timestamp,omitempty"`
	ClientVersion   string        `json:"clientVersion,omitempty"`
	OS              string        `json:"operatingSystem,omitempty"`
	EndpointType    string        `json:"endpointType,omitempty"`
	SuccessInternal bool          `json:"successInternal,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳