globalstats

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package globalstats provides configurable singleton stats instance for ctlstore. It is heavily inspired by segmentio/flagon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Incr

func Incr(name, family, table string)

func Initialize

func Initialize(ctx context.Context, cfg Config)

Initialize configures ctlstore to report global stats. This must be called at least once in order to report stats.

func Observe

func Observe(name string, value interface{}, tags ...stats.Tag)

func Set added in v0.0.8

func Set(name string, value interface{}, tags ...stats.Tag)

Types

type Config

type Config struct {
	AppName      string // set this to your app name
	StatsHandler stats.Handler
	FlushEvery   time.Duration
	// SamplePct is the percent of Observe calls to report.
	SamplePct float64
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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