metrics

package
v1.1.1 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, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommittedTimeoutForIp

type CommittedTimeoutForIp struct {
	Timeout time.Duration
	Ip      string
}

Timeout for an IP address we have been able to work out who's timeout is

type Recast

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

This struct monitors the amount of time wasted by the node and determines if it should try to shutdown the node and "recast" to get a new IP address

func NewRecast

func NewRecast(lf fx.Lifecycle, shutdowner fx.Shutdowner, config *config.Config, telemetry *Telemetry) (*Recast, error)

func (*Recast) StartChecking

func (r *Recast) StartChecking()

type Telemetry

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

func NewTelemetry

func NewTelemetry(lf fx.Lifecycle, config *config.Config) (*Telemetry, error)

func (*Telemetry) GetWastedTime

func (t *Telemetry) GetWastedTime() float64

func (*Telemetry) StartMetricsServer

func (t *Telemetry) StartMetricsServer()

func (*Telemetry) StartPushGateway

func (t *Telemetry) StartPushGateway()

func (*Telemetry) Stop

func (t *Telemetry) Stop() error

func (*Telemetry) StopMetricsServer

func (t *Telemetry) StopMetricsServer() error

func (*Telemetry) StopPushGateway

func (t *Telemetry) StopPushGateway() error

func (*Telemetry) TrackGeneratedSecrets

func (t *Telemetry) TrackGeneratedSecrets(generatedSecrets int)

func (*Telemetry) TrackWastedTime

func (t *Telemetry) TrackWastedTime(wastedTime time.Duration)

type TelemetryInput

type TelemetryInput struct {
	NodeName string
}

type TimeoutForIp

type TimeoutForIp struct {

	// The number of requests that have been made by an given IP to this node
	Requests int

	// The duration of the last N timeouts that finished successfully
	ValidTimeouts []time.Duration

	// The duration of the last N timeouts that finished with a client timeout
	InvalidTimeouts []time.Duration

	// The duration of the last valid timeout
	LastValidTimeout time.Duration

	// The duration of the last invalid timeout
	LastInvalidTimeout time.Duration

	// The duration of the last timeout that was attempted
	LastPerformedTimeout time.Duration
	// contains filtered or unexported fields
}

Struct representing the traffic for a given IP address

func NewTimeoutForIp

func NewTimeoutForIp(opts *TimeoutWatcherOptions) *TimeoutForIp

func (*TimeoutForIp) CalculateNextTimeout

func (t *TimeoutForIp) CalculateNextTimeout() time.Duration

func (*TimeoutForIp) GetAverageTimeoutInSample

func (t *TimeoutForIp) GetAverageTimeoutInSample() time.Duration

func (*TimeoutForIp) GetNextTimeout

func (t *TimeoutForIp) GetNextTimeout() time.Duration

func (*TimeoutForIp) GetStandardDeviation

func (t *TimeoutForIp) GetStandardDeviation() time.Duration

func (*TimeoutForIp) RecordInvalidTimeout

func (t *TimeoutForIp) RecordInvalidTimeout(timeout time.Duration)

func (*TimeoutForIp) RecordValidTimeout

func (t *TimeoutForIp) RecordValidTimeout(timeout time.Duration)

type TimeoutWatcher

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

func NewTimeoutWatcher

func NewTimeoutWatcher(config *config.Config) *TimeoutWatcher

func (*TimeoutWatcher) BroadcastColdCacheIp

func (tw *TimeoutWatcher) BroadcastColdCacheIp(identifier string, timeout time.Duration)

func (*TimeoutWatcher) CommitToColdCache

func (tw *TimeoutWatcher) CommitToColdCache(identifier string, timeout time.Duration)

func (*TimeoutWatcher) CommitToColdCacheWithBroadcast

func (tw *TimeoutWatcher) CommitToColdCacheWithBroadcast(identifier string, timeout time.Duration)

func (*TimeoutWatcher) GetTimeout

func (tw *TimeoutWatcher) GetTimeout(identifier string) time.Duration

func (*TimeoutWatcher) HasColdCacheTimeout

func (tw *TimeoutWatcher) HasColdCacheTimeout(identifier string) bool

func (*TimeoutWatcher) RecordResponse

func (tw *TimeoutWatcher) RecordResponse(identifier string, timeout time.Duration, successful bool)

func (*TimeoutWatcher) SetActionDispatcher

func (tw *TimeoutWatcher) SetActionDispatcher(actionDispatcher action.IBroadcastActionDispatcher)

type TimeoutWatcherOptions

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

Jump to

Keyboard shortcuts

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