netdump

package
v0.0.0-...-c2ef643 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetDumper

type NetDumper struct {
	// MaxDumpsPerTopic : maximum number of archives with network diagnostic information
	// (aka network dumps) that can be persistent at the same time for a given topic.
	// NetDumper will remove the oldest network dump of a given topic before publishing
	// a new one that would otherwise exceed this limit.
	// By default (zero value), there is no limit.
	// Can be changed between calls to Publish.
	MaxDumpsPerTopic int
}

NetDumper publishes (writes to /persist/netdump) tar.gz archives containing network diagnostic information for post-mortem analysis of device connectivity issues.

func (*NetDumper) LastPublishAt

func (dumper *NetDumper) LastPublishAt(topics ...string) (time.Time, error)

LastPublishAt returns timestamp of the last publication for any of the given topics. Returns zero timestamp (and nil error) if nothing has been published yet.

func (*NetDumper) Publish

func (dumper *NetDumper) Publish(topic string,
	requests ...TracedNetRequest) (filepath string, err error)

Publish a single netdump archive, containing information such as the current DPCL (DevicePortConfigList), DNS (DeviceNetworkStatus), ifconfig output, DHCP leases, wwan status and more. Additionally, it is possible to attach traces and packet captures recorded during an execution of one or more network requests (i.e. requests targeted at remote endpoints and carried over the network). In order to avoid race conditions between microservices, each microservice should use different topic(s) (e.g. topic = microservice name). Topic name should not contain characters which are not suitable for filenames (across all OSes).

type TracedNetRequest

type TracedNetRequest struct {
	// RequestName : name of the executed request that had its network operations traced.
	// It is used as a dirname inside the published netdump.
	// Avoid characters which are not suitable for filenames (across all OSes).
	RequestName string
	// NetTrace : summary of all network operations performed from within the given request.
	NetTrace nettrace.AnyNetTrace
	// PacketCaptures obtained for selected interfaces during the request execution.
	PacketCaptures []nettrace.PacketCapture
}

TracedNetRequest : trace and potentially one or more packet captures obtained during a request targeted at a remote endpoint (i.e. carried over the network).

Jump to

Keyboard shortcuts

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