stat

package
v0.0.0-...-4b25d55 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatMB

func FormatMB(v int, period time.Duration) string

func LenOf

func LenOf(containerPtr any, mu *sync.RWMutex) func() int

LenOf reads the metric value from the given slice/map/chan.

Types

type AverageParameter

type AverageParameter interface {
	time.Duration
}

type AverageValue

type AverageValue[T AverageParameter] struct {
	// contains filtered or unexported fields
}

func (*AverageValue[T]) Save

func (av *AverageValue[T]) Save(val T)

func (*AverageValue[T]) Value

func (av *AverageValue[T]) Value() T

type Distribution

type Distribution struct{}

Distribution says to collect/visualize histogram of individual sample distributions.

type Graph

type Graph string

Graph allows to combine multiple related metrics on a single graph.

const NoGraph Graph = ""

NoGraph says to not visualize the metric as a graph.

type Level

type Level int

Level controls if the metric should be printed to console in periodic heartbeat logs, or showed on the simple web interface, or showed in the expert interface only.

const (
	All Level = iota
	Simple
	Console
)
type Link string

Link adds a hyperlink to metric name.

type Prometheus

type Prometheus string

Prometheus exports the metric to Prometheus under the given name.

type Rate

type Rate struct{}

Rate says to collect/visualize metric rate per unit of time rather then total value.

type StackedGraph

type StackedGraph string

StackedGraph is like Graph, but shows metrics on a stacked graph.

type UI

type UI struct {
	Name  string
	Desc  string
	Link  string
	Level Level
	Value string
	V     int
}

func Collect

func Collect(level Level) []UI

type UIGraph

type UIGraph struct {
	ID      int
	Title   string
	Stacked bool
	Level   Level
	Lines   []string
	Points  []UIPoint
}

func RenderGraphs

func RenderGraphs() []UIGraph

type UIPoint

type UIPoint struct {
	X int
	Y []float64
}

type Val

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

func New

func New(name, desc string, opts ...any) *Val

func (*Val) Add

func (v *Val) Add(val int)

func (*Val) Val

func (v *Val) Val() int

Directories

Path Synopsis
Package sample provides various statistical operations and algorithms.
Package sample provides various statistical operations and algorithms.

Jump to

Keyboard shortcuts

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