Documentation ¶
Overview ¶
mtr is a package that processes and saves an `mtr --raw` call's output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct { IP net.IP `json:"ip"` Name string `json:"hostname"` Hop int `json:"hop-number"` PacketMicrosecs []int `json:"packet-times"` Sent int `json:"sent"` Received int `json:"received"` Dropped int `json:"dropped"` LostPercent float64 `json:"lost-percent"` // All packet units are in microseconds Mean float64 `json:"mean"` Best int `json:"best"` Worst int `json:"worst"` StandardDev float64 `json:"standard-dev"` MeanJitter float64 `json:"mean-jitter"` WorstJitter int `json:"worst-jitter"` InterarrivalJitter int `json:"interarrival-jitter"` // calculated with rfc3550 A.8 shortcut }
type MTR ¶
type MTR struct { Done chan struct{} OutputRaw []byte Error error PacketsSent int Hosts []*Host `json:"hosts"` }
func New ¶
New runs mtr --raw -c reportCycles hostname args... Thus, you can add more arguments to the default required hostname and report cycles. The MTR call is signified as done when the MTR.Done chan closes. First wait for this, then check the MTR.Error field before looking at the output. Other than that, the fields and json tags document what everything means.
Click to show internal directories.
Click to hide internal directories.