latency

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLatencyProbe

func AddLatencyProbe(ch channel.Channel, binding channel.Binding, interval time.Duration, roundTripFreq uint8, handler HandlerF)

func AddLatencyProbeResponder

func AddLatencyProbeResponder(binding channel.Binding)

func ProbeLatencyConfigurable

func ProbeLatencyConfigurable(config *ProbeConfig)

Types

type Handler

type Handler interface {
	HandleLatency(latencyType Type, latency time.Duration)
}

type HandlerF

type HandlerF func(latencyType Type, latency time.Duration)

func (HandlerF) HandleLatency

func (self HandlerF) HandleLatency(latencyType Type, latency time.Duration)

type LatencyHandler

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

LatencyHandler responds to latency messages with Result messages.

func (*LatencyHandler) ContentType

func (h *LatencyHandler) ContentType() int32

func (*LatencyHandler) HandleReceive

func (h *LatencyHandler) HandleReceive(msg *channel.Message, ch channel.Channel)

type ProbeConfig

type ProbeConfig struct {
	Channel        channel.Channel
	Interval       time.Duration
	Timeout        time.Duration
	ResultHandler  func(resultNanos int64)
	TimeoutHandler func()
	ExitHandler    func()
}

type Responder

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

Responder responds to latency messages with LatencyResponse messages.

func (*Responder) ContentType

func (self *Responder) ContentType() int32

func (*Responder) HandleReceive

func (self *Responder) HandleReceive(msg *channel.Message, _ channel.Channel)

type RoundTripLatency

type RoundTripLatency struct {
	channel.BaseSendable
	channel.BaseSendListener
	// contains filtered or unexported fields
}

func (*RoundTripLatency) Msg

func (self *RoundTripLatency) Msg() *channel.Message

func (*RoundTripLatency) NotifyBeforeWrite

func (self *RoundTripLatency) NotifyBeforeWrite()

func (*RoundTripLatency) SendListener

func (self *RoundTripLatency) SendListener() channel.SendListener

func (*RoundTripLatency) Sequence

func (self *RoundTripLatency) Sequence() int32

func (*RoundTripLatency) SetSequence

func (self *RoundTripLatency) SetSequence(seq int32)

type SendTimeTracker

type SendTimeTracker struct {
	channel.BaseSendable
	channel.BaseSendListener
	Handler   HandlerF
	StartTime time.Time
	// contains filtered or unexported fields
}

func (*SendTimeTracker) NotifyBeforeWrite

func (self *SendTimeTracker) NotifyBeforeWrite()

func (*SendTimeTracker) SendListener

func (self *SendTimeTracker) SendListener() channel.SendListener

func (*SendTimeTracker) Sequence

func (self *SendTimeTracker) Sequence() int32

func (*SendTimeTracker) SetSequence

func (self *SendTimeTracker) SetSequence(seq int32)

type Type

type Type uint8
const (
	RoundTripType  Type = 1
	BeforeSendType      = 2
)

Jump to

Keyboard shortcuts

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