times

package
v0.0.0-...-0958f0d Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// GRPCAuthErrorDelay defines the delay before triggering a global process exit after a
	// gRPC auth error.
	GRPCAuthErrorDelay = 10 * time.Minute
	// GRPCConnectionTimeout defines the timeout for each established gRPC connection.
	GRPCConnectionTimeout = 3 * time.Second
	// GRPCOperationTimeout defines the timeout for each gRPC operation.
	GRPCOperationTimeout = 5 * time.Second
	// GRPCStartupBackoffTimeout defines the time between failed gRPC requests during startup
	// phase.
	GRPCStartupBackoffTimeout = 1 * time.Minute
)

Variables

This section is empty.

Functions

func StartRealtimeSync

func StartRealtimeSync(ctx context.Context, syncInterval time.Duration)

StartRealtimeSync calculates a delta between the monotonic clock (CLOCK_MONOTONIC, rebased to unixtime) and the realtime clock. If syncInterval is greater than zero, it also starts a goroutine to perform that calculation periodically.

Types

type IntervalsAndTimers

type IntervalsAndTimers interface {
	// MonitorInterval defines the interval for PID event monitoring and metric collection.
	MonitorInterval() time.Duration
	// TracePollInterval defines the interval at which we read the trace perf event buffer.
	TracePollInterval() time.Duration
	// ReportInterval defines the interval at which collected data is sent to collection agent.
	ReportInterval() time.Duration
	// ReportMetricsInterval defines the interval at which collected metrics are sent
	// to collection agent.
	ReportMetricsInterval() time.Duration
	// GRPCConnectionTimeout defines the timeout for each established gRPC connection.
	GRPCConnectionTimeout() time.Duration
	// GRPCOperationTimeout defines the timeout for each gRPC operation.
	GRPCOperationTimeout() time.Duration
	// GRPCStartupBackoffTime defines the time between failed gRPC requests during startup
	// phase.
	GRPCStartupBackoffTime() time.Duration
	// GRPCAuthErrorDelay defines the delay before triggering a global process exit after a
	// gRPC auth error.
	GRPCAuthErrorDelay() time.Duration
	// PIDCleanupInterval defines the interval at which monitored PIDs are checked for
	// liveness, and no longer living PIDs are cleaned up.
	PIDCleanupInterval() time.Duration
	// ProbabilisticInterval defines the interval for which probabilistic profiling will
	// be enabled or disabled.
	ProbabilisticInterval() time.Duration
}

IntervalsAndTimers is a meta-interface that exists purely to document its functionality.

type KTime

type KTime int64

KTime stores a time value, retrieved from a monotonic clock, in nanoseconds

func GetKTime

func GetKTime() KTime

GetKTime gets the current time in same nanosecond format as bpf_ktime_get_ns() eBPF call This relies runtime.nanotime to use CLOCK_MONOTONIC. If this changes, this needs to be adjusted accordingly. Using this internal is superior in performance, as it is able to use the vDSO to query the time without syscall.

func (KTime) Time

func (t KTime) Time() time.Time

Time converts the kernel timestamp into a Go time object.

func (KTime) UnixNano

func (t KTime) UnixNano() int64

UnixNano converts the kernel timestamp to nanoseconds since the epoch.

type Times

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

Times hold all the intervals and timeouts that are used across the host agent in a central place and comes with Getters to read them.

func New

func New(reportInterval, monitorInterval, probabilisticInterval time.Duration) *Times

New returns a new Times instance.

func (*Times) GRPCAuthErrorDelay

func (t *Times) GRPCAuthErrorDelay() time.Duration

func (*Times) GRPCConnectionTimeout

func (t *Times) GRPCConnectionTimeout() time.Duration

func (*Times) GRPCOperationTimeout

func (t *Times) GRPCOperationTimeout() time.Duration

func (*Times) GRPCStartupBackoffTime

func (t *Times) GRPCStartupBackoffTime() time.Duration

func (*Times) MonitorInterval

func (t *Times) MonitorInterval() time.Duration

func (*Times) PIDCleanupInterval

func (t *Times) PIDCleanupInterval() time.Duration

func (*Times) ProbabilisticInterval

func (t *Times) ProbabilisticInterval() time.Duration

func (*Times) ReportInterval

func (t *Times) ReportInterval() time.Duration

func (*Times) ReportMetricsInterval

func (t *Times) ReportMetricsInterval() time.Duration

func (*Times) TracePollInterval

func (t *Times) TracePollInterval() time.Duration

Jump to

Keyboard shortcuts

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