badmetrics

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2017 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