mtr

package
v0.0.0-...-0d1ffaa Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteMetricsHelpType

func WriteMetricsHelpType(w io.Writer)

Types

type Hub

type Hub struct {
	Count MtrNumber `json:"count"`
	Host  string    `json:"host"`
	Loss  float64   `json:"Loss%"`
	Snt   int64     `json:"Snt"`
	Last  float64   `json:"Last"`
	Avg   float64   `json:"Avg"`
	Best  float64   `json:"Best"`
	Wrst  float64   `json:"Wrst"`
	StDev float64   `json:"StDev"`
}

func (*Hub) WriteMetrics

func (hub *Hub) WriteMetrics(w io.Writer, labels string, ts int64)

type Mtr

type Mtr struct {
	Src        string    `json:"src"`
	Dst        string    `json:"dst"`
	Tos        MtrNumber `json:"tos"`
	PSize      string    `json:"psize"`
	BitPattern string    `json:"bitpattern"`
	Tests      MtrNumber `json:"tests"`
}

func (*Mtr) Labels

func (mtr *Mtr) Labels() map[string]string

type MtrNumber

type MtrNumber int64

MtrNumber helps with JSON flavours used by <= mtr:0.93 and => mtr:0.94 which changed the type of the field see https://github.com/traviscross/mtr/pull/355

func (*MtrNumber) UnmarshalJSON

func (n *MtrNumber) UnmarshalJSON(b []byte) error

type Report

type Report struct {
	Mtr      Mtr    `json:"mtr"`
	Hubs     []Hub  `json:"hubs"`
	ErrorMsg string // carrying the error message of mtr
}

func (*Report) Decode

func (report *Report) Decode(r io.Reader) error

func (*Report) Empty

func (report *Report) Empty() bool

type Result

type Result struct {
	Report Report `json:"report"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL