utility

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTcpdumpHookIfEnabled

func CreateTcpdumpHookIfEnabled() *backenddisruption.TcpdumpSamplerHook

CreateTcpdumpHookIfEnabled creates a tcpdump hook if DEBUG_ENABLE_TCPDUMP is enabled.

func FindOverlap

func FindOverlap(intervals monitorapi.Intervals, overlapsWith monitorapi.Interval) monitorapi.Intervals

FindOverlap finds any intervals that overlap with the given interval.

func IntervalsOverlap

func IntervalsOverlap(interval1, interval2 monitorapi.Interval) bool

IntervalsOverlap checks if two intervals overlap in time

func IsTransientAPIError added in v1.6.0

func IsTransientAPIError(err error) bool

func MoveTcpdumpToStorage

func MoveTcpdumpToStorage(tcpdumpHook *backenddisruption.TcpdumpSamplerHook, storageDir string)

MoveTcpdumpToStorage moves tcpdump pcap files to the storage directory if the hook is not nil. This should be called in the WriteContentToStorage method of monitor tests. It logs any errors but doesn't fail the entire storage operation.

func RetryWithExponentialBackoff added in v1.6.0

func RetryWithExponentialBackoff(ctx context.Context, fn func() error) error

func StopTcpdumpCollection

func StopTcpdumpCollection(tcpdumpHook *backenddisruption.TcpdumpSamplerHook)

StopTcpdumpCollection stops tcpdump collection if the hook is not nil. This should be called in the CollectData method of monitor tests.

func SystemdJournalLogTime

func SystemdJournalLogTime(logLine string, year int) time.Time

SystemdJournalLogTime returns Now if there is trouble reading the time. This will stack the event intervals without parsable times at the end of the run, which will be more clearly visible as a problem than not reporting them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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