counter

package standard library
go1.23.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountFlagValue

func CountFlagValue(prefix string, flagSet flag.FlagSet, flagName string)

CountFlagValue creates a counter for the flag value if it is set and increments the counter. The name of the counter is the concatenation of prefix, the flagName, ":", and value.String() for the flag's value.

func CountFlags

func CountFlags(prefix string, flagSet flag.FlagSet)

CountFlags creates a counter for every flag that is set and increments the counter. The name of the counter is the concatenation of prefix and the flag name.

func Inc

func Inc(name string)

Inc increments the counter with the given name.

func New

func New(name string) *counter.Counter

New returns a counter with the given name.

func NewStack

func NewStack(name string, depth int) *counter.StackCounter

NewStack returns a new stack counter with the given name and depth.

func Open

func Open()

Open opens the counter files for writing if telemetry is supported on the current platform (and does nothing otherwise).

func OpenCalled

func OpenCalled() bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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