badmetrics

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: BSD-2-Clause-Views Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadMetrics

type BadMetrics struct {
	In chan Record
	// contains filtered or unexported fields
}

func New

func New(maxAge time.Duration) *BadMetrics

maxAge is the age after which we expire old records (in practice a bit later)

func (*BadMetrics) Add

func (b *BadMetrics) Add(metric []byte, msg []byte, err error)

func (*BadMetrics) Get

func (b *BadMetrics) Get(expiry time.Duration) []Record

type ByMetric

type ByMetric []Record

ByMetric implements sort.Interface for []Record based on the Metric field.

func (ByMetric) Len

func (a ByMetric) Len() int

func (ByMetric) Less

func (a ByMetric) Less(i, j int) bool

func (ByMetric) Swap

func (a ByMetric) Swap(i, j int)

type Record

type Record struct {
	Metric   string // the key parsed, or "" if parse failure
	LastMsg  string // metric line read
	LastErr  string
	LastSeen time.Time
}

Jump to

Keyboard shortcuts

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