model

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REDIS_KEEP_TTL = -1
)

Variables

View Source
var (
	GlobalJson jsoniter.API
)

Functions

func RecordObserver

func RecordObserver(record bool, statistics StatisticsRecord)

Observer Mode redis key is time,value is ping data

Types

type StatisticsRecord

type StatisticsRecord struct {
	PacketRecv int           `json:"packet_recv"`
	PacketSent int           `json:"packet_sent"`
	PacketLoss float64       `json:"packet_loss"`
	DestURL    string        `json:"desk_url"`
	IPAddr     *net.IPAddr   `json:"ip_addr"`
	MinRtt     time.Duration `json:"min_rtt"`
	MaxRtt     time.Duration `json:"max_rtt"`
	AvgRtt     time.Duration `json:"avg_rtt"`
	StdDevRtt  time.Duration `json:"std_dev_rtt"`
	TotalTime  int64         `json:"total_time"`
}

func (*StatisticsRecord) FormatOutput

func (statis *StatisticsRecord) FormatOutput(url string)

Jump to

Keyboard shortcuts

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