netping

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PingTypeIcmp    = "ping"
	PingTypeTcping  = "tcping"
	PingTypeHttping = "httping"

	DefaultIntervalSeconds = 60    // default interval
	MinIntervalSeconds     = 5     // min interval seconds
	MaxIntervalSeconds     = 86400 // max interval seconds
	DefaultTimeoutSeconds  = 5     // default timeout is 5s
	MinTimeoutSeconds      = 1     // min timeout seconds
	MaxTimeoutSeconds      = 30    // max timeout seconds
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPConfig added in v1.1.0

type HTTPConfig struct {
	Src                    string            `json:"src"`
	Method                 string            `json:"method"` // default is GET
	ExpectResponseContains string            `json:"expect_response_contains"`
	ExpectCode             int               `json:"expect_code"`
	Target                 string            `json:"target"`
	Name                   string            `json:"name"`
	Labels                 map[string]string `json:"labels"`
}

type ICMPConfig

type ICMPConfig struct {
	Src    string            `json:"src"`
	Target string            `json:"target"`
	Count  int               `json:"count"`
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels"`
}

type NetPing

type NetPing struct {
	DisableDNS      bool         `json:"disable_dns_metric" comment:"disable dns resolve metric, default is false"`
	TimeoutSeconds  int          `` /* 131-byte string literal not displayed */
	IntervalSeconds int          `` /* 156-byte string literal not displayed */
	ICMPConfigs     []ICMPConfig `` /* 132-byte string literal not displayed */
	TCPConfigs      []TCPConfig  `` /* 149-byte string literal not displayed */
	HTTPConfigs     []HTTPConfig `json:"http" comment:"the http config list, example: {\"src\" : \"${IP_ADDR}\",  \"target\" : \"${http url}\"}"`
	// contains filtered or unexported fields
}

NetPing struct implements the MetricInput interface.

func (*NetPing) Collect

func (m *NetPing) Collect(collector ilogtail.Collector) error

Collect is called every trigger interval to collect the metrics and send them to the collector.

func (*NetPing) Description

func (m *NetPing) Description() string

func (*NetPing) Init

func (m *NetPing) Init(context ilogtail.Context) (int, error)

type ResolveResult added in v1.1.0

type ResolveResult struct {
	Label   string
	Success bool
	RTMs    float64
}

type Result

type Result struct {
	Valid   bool // if the result is meaningful for count
	Label   string
	Type    string
	Total   int
	Success int
	Failed  int

	// valid for icmping/tcping
	MinRTTMs    float64
	MaxRTTMs    float64
	AvgRTTMs    float64
	TotalRTTMs  float64
	StdDevRTTMs float64

	// valid for httping
	HTTPRTMs         int
	HTTPResponseSize int
	HasHTTPSCert     bool
	HTTPSCertLabels  string
	HTTPSCertTTLDay  int
}

type TCPConfig

type TCPConfig struct {
	Src    string            `json:"src"`
	Target string            `json:"target"`
	Port   int               `json:"port"`
	Count  int               `json:"count"`
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels"`
}

Jump to

Keyboard shortcuts

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