networktopology

package
v2.1.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkTopology added in v2.0.30

type NetworkTopology interface {
	// LoadDestHostIDs loads destination host ids by source host id.
	LoadDestHostIDs(string) ([]string, error)

	// DeleteHost deletes host.
	DeleteHost(string) error

	// ProbedCount is the number of times the host has been probed.
	ProbedCount(string) (uint64, error)

	// LoadProbes loads probes by source host id and destination host id.
	LoadProbes(string, string) Probes
}

NetworkTopology is an interface for network topology.

func NewNetworkTopology added in v2.0.30

func NewNetworkTopology(cfg config.NetworkTopologyConfig, rdb redis.UniversalClient, resource resource.Resource, storage storage.Storage) (NetworkTopology, error)

New network topology interface.

type Probe

type Probe struct {
	// Host metadata.
	Host *resource.Host `json:"host"`

	// RTT is the round-trip time sent via this pinger.
	RTT time.Duration `json:"rtt"`

	// CreatedAt is the time to create probe.
	CreatedAt time.Time `json:"createdAt"`
}

Probe is the probe metadata.

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, error)

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

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

	// Length gets the length of probes.
	Length() (int64, error)

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

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

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

Probes is the interface to store probes.

func NewProbes

func NewProbes(cfg config.ProbeConfig, rdb redis.UniversalClient, srcHostID string, destHostID string) Probes

NewProbes creates a probes interface.

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