Help us shape the future of Go! Take the 2026 Go Developer Survey

metrics

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterScan

func RegisterScan(metric *Metric)

RegisterScan fetches a metric handler and enqueues a metric

Types

type Metric

type Metric struct {
	Scanned int
	Updated int
	Failed  int
}

Metric is the data points of a single scan

func NewMetric

func NewMetric(report types.Report) *Metric

NewMetric returns a Metric with the counts taken from the appropriate types.Report fields

type Metrics

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

Metrics is the handler processing all individual scan metrics

func Default

func Default() *Metrics

Default creates a new metrics handler if none exists, otherwise returns the existing one

func (*Metrics) HandleUpdate

func (metrics *Metrics) HandleUpdate(channel <-chan *Metric)

HandleUpdate dequeue the metric channel and processes it

func (*Metrics) QueueIsEmpty

func (metrics *Metrics) QueueIsEmpty() bool

QueueIsEmpty checks whether any messages are enqueued in the channel

func (*Metrics) Register

func (metrics *Metrics) Register(metric *Metric)

Register registers metrics for an executed scan

Jump to

Keyboard shortcuts

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