stats

package
v2.3.19 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// TotalCommands is the tracking key to get the number of all processed commands
	TotalCommands = "command_total"

	// UnauthorizedCommands is the tracking key to get the number of commands by unauthorized users
	UnauthorizedCommands = "command_unauthorized"

	// UnknownCommands is the tracking key to get the number of all unknown commands (when the fallback-command is fired)
	UnknownCommands = "command_unknown"

	// Interactions is the tracking key to get the number of all processed interactions aka buttons
	Interactions = "interactions"
)

Variables

This section is empty.

Functions

func Get

func Get(key string) (uint, error)

Get the counter value of of type

func GetKeys added in v2.2.10

func GetKeys() []string

GetKeys returns all used metric keys

func Increase

func Increase[T constraints.Signed](key string, count T)

Increase is increasing the stats counter

func IncreaseOne

func IncreaseOne(key string)

IncreaseOne is increasing the stats counter of the given type by 1

func InitMetrics added in v2.2.10

func InitMetrics(cfg config.Config, ctx *util.ServerContext)

func RegisterCollector added in v2.3.19

func RegisterCollector(collector prometheus.Collector)

RegisterCollector adds a custom prometheus collector to the "/metrics" endpoint, e.g. to provide metrics of a plugin. It has to be called before the bot is started, e.g. in the Setup function of a plugin.

func Set

func Set[T constraints.Signed](key string, value T)

Set the stats to a specific value

Types

This section is empty.

Jump to

Keyboard shortcuts

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