view

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context added in v1.2.1

type Context struct {
	Cmd       string
	Target    string
	From      string
	Limit     int  // Number of probes to use
	CIMode    bool // Determine whether the output should be in a format that is easy to parse by a CI tool
	ToJSON    bool // Determines whether the output should be in JSON format.
	ToLatency bool // Determines whether the output should be only the stats of a measurement
	Share     bool // Display share message

	Packets   int // Number of packets to send
	Port      int
	Protocol  string
	Resolver  string
	QueryType string
	Host      string
	Path      string
	Query     string
	Method    string
	Headers   []string
	Trace     bool
	Full      bool // Full output
	Infinite  bool // Infinite flag

	APIMinInterval time.Duration // Minimum interval between API calls

	Area            *pterm.AreaPrinter
	Hostname        string
	MStartedAt      time.Time // Time when the measurement started
	CompletedStats  []MeasurementStats
	InProgressStats []MeasurementStats
	CallCount       int      // Number of measurements created
	MaxHistory      int      // Maximum number of measurements to keep in history
	History         *Rbuffer // History of measurements
}

type HTTPOpts added in v1.2.1

type HTTPOpts struct {
	Path     string
	Query    string
	Host     string
	Method   string
	Protocol string
	Port     int
	Resolver string
	Headers  []string
}

type MeasurementStats added in v1.2.1

type MeasurementStats struct {
	Sent  int     // Number of packets sent
	Rcv   int     // Number of packets received
	Lost  int     // Number of packets lost
	Loss  float64 // Percentage of packets lost
	Last  float64 // Last RTT
	Min   float64 // Minimum RTT
	Avg   float64 // Average RTT
	Max   float64 // Maximum RTT
	Mdev  float64 // Mean deviation of RTT
	Time  float64 // Total time of measurement, in milliseconds
	Tsum  float64 // Total sum of RTT
	Tsum2 float64 // Total sum of RTT squared
}

func NewMeasurementStats added in v1.2.1

func NewMeasurementStats() MeasurementStats

type ParsedPingOutput added in v1.2.1

type ParsedPingOutput struct {
	Hostname       string
	Address        string
	BytesOfData    string
	RawPacketLines []string
	Timings        []globalping.PingTiming
	Stats          *MeasurementStats
	Time           float64 // Total time, in milliseconds
}

type Printer added in v1.2.1

type Printer struct {
	InReader  io.Reader
	OutWriter io.Writer
	ErrWriter io.Writer
}

func NewPrinter added in v1.2.1

func NewPrinter(
	inReader io.Reader,
	outWriter io.Writer,
	errWriter io.Writer,
) *Printer

func (*Printer) Print added in v1.2.1

func (p *Printer) Print(a ...any)

func (*Printer) Printf added in v1.2.1

func (p *Printer) Printf(format string, a ...any)

func (*Printer) Println added in v1.2.1

func (p *Printer) Println(a ...any)

type Rbuffer added in v1.2.1

type Rbuffer struct {
	Index int
	Slice []string
}

func NewRbuffer added in v1.2.1

func NewRbuffer(size int) *Rbuffer

func (*Rbuffer) Push added in v1.2.1

func (q *Rbuffer) Push(id string)

func (*Rbuffer) ToString added in v1.2.1

func (q *Rbuffer) ToString(sep string) string

type Viewer added in v1.2.1

type Viewer interface {
	Output(id string, m *globalping.MeasurementCreate) error
	OutputInfinite(id string) error
	OutputSummary()
}

func NewViewer added in v1.2.1

func NewViewer(
	ctx *Context,
	printer *Printer,
	time utils.Time,
	globalpingClient globalping.Client,
) Viewer

Jump to

Keyboard shortcuts

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