stats

package
v0.0.0-...-436d200 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: BSD-3-Clause Imports: 0 Imported by: 1

Documentation

Overview

package stats provides a set of interfaces to log stats including a no-op implementation that doesn't do anything. This is useful to instrument metrics within open-sourced components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterStat

type CounterStat interface {
	Inc()
	Add(float64)
}

type GaugeStat

type GaugeStat interface {
	Set(float64)
	Get() float64

	Inc()
	Add(float64)

	Dec()
	Sub(float64)
}

type StatsFactory

type StatsFactory interface {
	NewCounter(
		metric string,
		tags map[string]string) CounterStat

	NewGauge(
		metric string,
		tags map[string]string) GaugeStat

	NewSummary(
		metric string,
		tags map[string]string) SummaryStat
}
var (
	NoOpStatsFactory StatsFactory
)

func NewCompositeFactory

func NewCompositeFactory(factories ...StatsFactory) StatsFactory

type SummaryStat

type SummaryStat interface {
	Observe(float64)
}

Jump to

Keyboard shortcuts

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