package counter
import "cmd/internal/telemetry/counter"
Index ¶
- func CountFlagValue(prefix string, flagSet flag.FlagSet, flagName string)
- func CountFlags(prefix string, flagSet flag.FlagSet)
- func Inc(name string)
- func New(name string) *counter.Counter
- func NewStack(name string, depth int) *counter.StackCounter
- func Open()
- func OpenCalled() bool
Functions ¶
func CountFlagValue ¶
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 ¶
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 ¶
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
Source Files ¶
- Version
- v1.24.0 (latest)
- Published
- Feb 10, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 22 minutes ago –
Tools for package owners.