metrics

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRoutes

func GetRoutes(cfg config.Config, logger *logrus.Logger) (endpoints.Routes, []endpoints.TeardownFn)

GetRoutes returns endpoints related to metric handling

Types

type Event

type Event struct {

	// A label used to categorize events
	Category types.Category `json:"category"`

	// A label used to identify the event type
	Action types.Action `json:"action"`

	// Labels that annotate the event
	Labels map[string]string `json:"labels"`
}

Event defines information necessary to process a metric event

func NewEvent added in v0.1.4

func NewEvent() Event

NewEvent initializes a metric event

func (Event) Validate added in v0.0.21

func (receiver Event) Validate() error

Validate ensures an Event contains the required and valid data

type MetricRegistry added in v0.1.4

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

func NewMetricRegistry added in v0.1.4

func NewMetricRegistry() *MetricRegistry

func (*MetricRegistry) Add added in v0.1.4

func (m *MetricRegistry) Add(d types.Definition)

func (*MetricRegistry) Increment added in v0.1.4

func (m *MetricRegistry) Increment(userAgent string, event Event) error

func (*MetricRegistry) Reset added in v0.1.4

func (m *MetricRegistry) Reset()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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