...

Package countertest

import "cmd/vendor/golang.org/x/telemetry/counter/countertest"
Overview
Index

Overview ▾

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

Constants

SupportedPlatform reports if this platform supports Open()

const SupportedPlatform = !telemetry.DisabledOnPlatform

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.