Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultTestSize = 5 * 1024 * 1024
DefaultTestSize is the default amount of data to transfer (5MB)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPSpeedTester ¶
type HTTPSpeedTester struct {
URL string
}
func NewHTTPSpeedTester ¶
func NewHTTPSpeedTester(url string) *HTTPSpeedTester
func (*HTTPSpeedTester) Run ¶
func (h *HTTPSpeedTester) Run() (*SpeedResult, error)
type HopInfo ¶
type HopInfo struct {
Hop int
IP string
Latency time.Duration
City string
Country string
ISP string
Loss float64
}
HopInfo represents a single hop in a traceroute
type ICMPPinger ¶
type ICMPPinger struct {
Target string
Count int
Interval time.Duration
Timeout time.Duration
Privileged bool // Set to true if running as root/sudo
}
func NewICMPPinger ¶
func NewICMPPinger(target string, count int) *ICMPPinger
func (*ICMPPinger) Run ¶
func (p *ICMPPinger) Run() (*PingResult, error)
type IperfProber ¶
func NewIperfProber ¶
func NewIperfProber(target string, port int) *IperfProber
func (*IperfProber) Run ¶
func (p *IperfProber) Run() (*SpeedResult, error)
type MTRRunner ¶
func NewMTRRunner ¶
type MetricType ¶
type MetricType string
MetricType defines the type of network metric
const ( MetricLatency MetricType = "latency" MetricPacketLoss MetricType = "packet_loss" MetricBandwidth MetricType = "bandwidth" MetricTraceroute MetricType = "traceroute" )
type PingResult ¶
type PingResult struct {
PacketsSent int
PacketsRecv int
MinRtt time.Duration
MaxRtt time.Duration
AvgRtt time.Duration
LossRate float64 // Percentage 0.0 - 100.0
Timestamp time.Time
}
PingResult holds the result of an ICMP ping series
type SSHSpeedTester ¶
type SSHSpeedTester struct {
// contains filtered or unexported fields
}
SSHSpeedTester handles the SSH connection and speed measurement
func NewSSHSpeedTester ¶
func NewSSHSpeedTester(cfg SSHConfig) *SSHSpeedTester
func (*SSHSpeedTester) Run ¶
func (s *SSHSpeedTester) Run() (*SpeedResult, error)
type SpeedResult ¶
type SpeedResult struct {
UploadSpeed float64 // Mbps
DownloadSpeed float64 // Mbps
Latency time.Duration
Timestamp time.Time
}
SpeedResult holds the result of a bandwidth test
type TraceResult ¶
TraceResult holds the result of a traceroute
type TracerouteRunner ¶
type TracerouteRunner struct {
Target string
MaxHops int
CountPerHop int // Number of probes per hop (typically 3)
Timeout time.Duration
}
func NewTracerouteRunner ¶
func NewTracerouteRunner(target string) *TracerouteRunner
func (*TracerouteRunner) Run ¶
func (t *TracerouteRunner) Run() (*TraceResult, error)
Run executes a traceroute
Click to show internal directories.
Click to hide internal directories.