metrics

package
v0.0.86 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package metrics is responsible for tracking and publishing metrics to the Streamdal server.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingConfig       = errors.New("config cannot be nil")
	ErrMissingServerClient = errors.New("ServerClient cannot be nil")
	ErrMissingEntry        = errors.New("CounterEntry cannot be nil")
	ErrEmptyName           = errors.New("Name must be set")
	ErrMissingShutdownCtx  = errors.New("ShutdownCtx cannot be nil")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	IncrInterval   time.Duration
	ReaperInterval time.Duration
	ReaperTTL      time.Duration
	WorkerPoolSize int
	ServerClient   server.IServerClient
	ShutdownCtx    context.Context
	Log            logger.Logger
}

type IMetrics

type IMetrics interface {
	// Incr increases a counter with the given entry.
	// If a counter does not exist for this entry yet, one will be created.
	Incr(ctx context.Context, entry *types.CounterEntry) error
}

type Metrics

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

func New

func New(cfg *Config) (*Metrics, error)

func (*Metrics) Incr

func (m *Metrics) Incr(_ context.Context, entry *types.CounterEntry) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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