telemetrygolang.org/x/telemetry/counter/countertest Index | Files

package countertest

import "golang.org/x/telemetry/counter/countertest"

countertest provides testing utilities for counters. This package cannot be used except for testing.

Index

Constants

const SupportedPlatform = !telemetry.DisabledOnPlatform

SupportedPlatform reports if this platform supports Open()

Functions

func Open

func Open(telemetryDir string)

Open enables telemetry data writing to disk. This is supposed to be called once during the program execution (i.e. typically in TestMain), and must not be used with golang.org/x/telemetry/counter.Open.

func ReadCounter

func ReadCounter(c *counter.Counter) (count uint64, _ error)

ReadCounter reads the given counter.

func ReadFile

func ReadFile(name string) (counters, stackCounters map[string]uint64, _ error)

ReadFile reads the counters and stack counters from the given file.

func ReadStackCounter

func ReadStackCounter(c *counter.StackCounter) (stackCounts map[string]uint64, _ error)

ReadStackCounter reads the given StackCounter.

Source Files

countertest.go countertest_go121.go

Version
v0.0.0-20250214215356-6f9b61db478c (latest)
Published
Feb 14, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
3 days ago

Tools for package owners.