latency

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CheckName = "latency"

Variables

This section is empty.

Functions

func NewCheck

func NewCheck() checks.Check

NewCheck creates a new instance of the latency check

Types

type Config added in v0.3.1

type Config struct {
	Targets  []string           `json:"targets,omitempty" yaml:"targets,omitempty"`
	Interval time.Duration      `json:"interval" yaml:"interval"`
	Timeout  time.Duration      `json:"timeout" yaml:"timeout"`
	Retry    helper.RetryConfig `json:"retry" yaml:"retry"`
}

Config defines the configuration parameters for a latency check

func (*Config) For added in v0.3.1

func (c *Config) For() string

For returns the name of the check

func (*Config) Validate added in v0.3.1

func (c *Config) Validate() error

Validate checks if the configuration is valid

type Latency

type Latency struct {
	checks.CheckBase
	// contains filtered or unexported fields
}

Latency is a check that measures the latency to an endpoint

func (*Latency) GetConfig added in v0.3.1

func (l *Latency) GetConfig() checks.Runtime

GetConfig returns the current configuration of the latency Check

func (*Latency) GetMetricCollectors

func (l *Latency) GetMetricCollectors() []prometheus.Collector

GetMetricCollectors returns all metric collectors of check

func (*Latency) Name added in v0.3.1

func (l *Latency) Name() string

Name returns the name of the check

func (*Latency) Run

func (l *Latency) Run(ctx context.Context, cResult chan checks.ResultDTO) error

Run starts the latency check

func (*Latency) Schema

func (l *Latency) Schema() (*openapi3.SchemaRef, error)

Schema provides the schema of the data that will be provided by the latency check

func (*Latency) SetConfig

func (l *Latency) SetConfig(cfg checks.Runtime) error

SetConfig sets the configuration for the latency check

func (*Latency) Shutdown

func (l *Latency) Shutdown(_ context.Context) error

Jump to

Keyboard shortcuts

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