networktopology

package
v2.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMovingAverageWeight is the weight of the moving average.
	DefaultMovingAverageWeight = 0.1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Probe

type Probe struct {
	// Host metadata.
	Host *resource.Host

	// RTT is the round-trip time sent via this pinger.
	RTT time.Duration

	// CreatedAt is the time to create probe.
	CreatedAt time.Time
}

func NewProbe

func NewProbe(host *resource.Host, rtt time.Duration, createdAt time.Time) *Probe

NewProbe creates a new probe instance.

type Probes

type Probes interface {
	// Peek returns the oldest probe without removing it.
	Peek() (*Probe, bool)

	// Enqueue enqueues probe into the queue.
	Enqueue(*Probe) error

	// Dequeue removes and returns the oldest probe.
	Dequeue() (*Probe, bool)

	// Items returns the probes list.
	Items() *list.List

	// Length gets the length of probes.
	Length() int

	// CreatedAt is the creation time of probes.
	CreatedAt() time.Time

	// UpdatedAt is the updated time to store probe.
	UpdatedAt() time.Time

	// AverageRTT is the average round-trip time of probes.
	AverageRTT() time.Duration
}

func NewProbes

func NewProbes(limit int, host *resource.Host) Probes

NewProbes creates a new probe list instance.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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