metrics

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a collection of metrics.

func NewClient

func NewClient(window time.Duration) *Client

NewClient creates a new collection of metrics.

func (*Client) Add

func (c *Client) Add(modelID string, v float64)

Add adds a value to a given metric.

func (*Client) Get

func (c *Client) Get(modelID string) float64

Get returns the value of a given metric.

type Collector

type Collector interface {
	Add(modelID string, v float64)
}

Collector is the interface for collecting metrics.

type NoopCollector added in v1.11.0

type NoopCollector struct{}

NoopCollector is a no-op implementation of Collector.

func (*NoopCollector) Add added in v1.11.0

func (c *NoopCollector) Add(modelID string, v float64)

Add is a no-op.

type PromMetricsCollector added in v1.11.0

type PromMetricsCollector struct{}

PromMetricsCollector collects metrics for Prometheus.

func (*PromMetricsCollector) Add added in v1.11.0

func (c *PromMetricsCollector) Add(modelID string, v float64)

Add adds a value to the metric.

type Provider

type Provider interface {
	Get(modelID string) float64
}

Provider is the interface for providing metric values.

Jump to

Keyboard shortcuts

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