measurer

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Overview

Package measurer collects metrics from a socket connection and returns them for consumption.

Index

Constants

This section is empty.

Variables

View Source
var (
	BBREnabled = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "ndt7_measurer_bbr_enabled_total",
			Help: "A counter of every attempt to enable bbr.",
		},
		[]string{"status", "error"},
	)
)

Functions

This section is empty.

Types

type Measurer added in v0.14.0

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

Measurer performs measurements

func New added in v0.14.0

func New(conn *websocket.Conn, UUID string) *Measurer

New creates a new measurer instance

func (*Measurer) Start added in v0.14.0

func (m *Measurer) Start(ctx context.Context, timeout time.Duration) <-chan model.Measurement

Start runs the measurement loop in a background goroutine and emits the measurements on the returned channel.

Liveness guarantee: the measurer will always terminate after the given timeout, provided that the consumer continues reading from the returned channel. Measurer may be stopped early by canceling ctx, or by calling Stop.

func (*Measurer) Stop added in v0.18.0

func (m *Measurer) Stop(src <-chan model.Measurement)

Stop ends the measurements and drains the measurement channel. Stop guarantees that the measurement goroutine completes by draining the measurement channel. Users that call Start should also call Stop.

Jump to

Keyboard shortcuts

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