udplistener

package
v0.0.0-...-eff70b3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package udplistener is a generated protocol buffer package.

It is generated from these files:

github.com/google/cloudprober/probes/udplistener/config.proto

It has these top-level messages:

ProbeConf

Package udplistener implements a UDP listener. Given a target list, it listens for packets from each of the targets and reports number of packets successfully received in order, lost or delayed. It also uses the probe interval as an indicator for the number of packets we expect from each target. Use the "udp" probe as the counterpart with the same targets list and probe interval as the sender.

Notes:

Each probe has 3 goroutines:

  • A recvLoop that keeps handling incoming packets and updates metrics.
  • An outputLoop that ticks twice every statsExportInterval and outputs metrics.
  • An echoLoop that receives incoming packets from recvLoop over a channel and echos back the packets.
  • Targets list determines which packet sources are valid sources. It is updated in the outputLoop routine.
  • We use the probe interval to determine the estimated number of packets that should be received. This number is the lower bound of the total number of packets "sent" by each source.

Index

Constants

View Source
const Default_ProbeConf_Port int32 = 32212
View Source
const Default_ProbeConf_StatsExportIntervalMsec int32 = 10000

Variables

View Source
var ProbeConf_Type_name = map[int32]string{
	0: "INVALID",
	1: "ECHO",
	2: "DISCARD",
}
View Source
var ProbeConf_Type_value = map[string]int32{
	"INVALID": 0,
	"ECHO":    1,
	"DISCARD": 2,
}

Functions

This section is empty.

Types

type Probe

type Probe struct {
	// contains filtered or unexported fields
}

Probe holds aggregate information about all probe runs.

func (*Probe) Init

func (p *Probe) Init(name string, opts *options.Options) error

Init initializes the probe with the given params.

func (*Probe) Start

func (p *Probe) Start(ctx context.Context, dataChan chan *metrics.EventMetrics)

Start starts and runs the probe indefinitely.

type ProbeConf

type ProbeConf struct {
	// Export stats after these many milliseconds
	StatsExportIntervalMsec *int32 `` /* 138-byte string literal not displayed */
	// Port to listen.
	Port             *int32          `protobuf:"varint,3,opt,name=port,def=32212" json:"port,omitempty"`
	Type             *ProbeConf_Type `protobuf:"varint,4,opt,name=type,enum=cloudprober.probes.udplistener.ProbeConf_Type" json:"type,omitempty"`
	XXX_unrecognized []byte          `json:"-"`
}

func (*ProbeConf) Descriptor

func (*ProbeConf) Descriptor() ([]byte, []int)

func (*ProbeConf) GetPort

func (m *ProbeConf) GetPort() int32

func (*ProbeConf) GetStatsExportIntervalMsec

func (m *ProbeConf) GetStatsExportIntervalMsec() int32

func (*ProbeConf) GetType

func (m *ProbeConf) GetType() ProbeConf_Type

func (*ProbeConf) ProtoMessage

func (*ProbeConf) ProtoMessage()

func (*ProbeConf) Reset

func (m *ProbeConf) Reset()

func (*ProbeConf) String

func (m *ProbeConf) String() string

type ProbeConf_Type

type ProbeConf_Type int32

Probe response to an incoming packet: echo back or discard.

const (
	ProbeConf_INVALID ProbeConf_Type = 0
	ProbeConf_ECHO    ProbeConf_Type = 1
	ProbeConf_DISCARD ProbeConf_Type = 2
)

func (ProbeConf_Type) Enum

func (x ProbeConf_Type) Enum() *ProbeConf_Type

func (ProbeConf_Type) EnumDescriptor

func (ProbeConf_Type) EnumDescriptor() ([]byte, []int)

func (ProbeConf_Type) String

func (x ProbeConf_Type) String() string

func (*ProbeConf_Type) UnmarshalJSON

func (x *ProbeConf_Type) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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