testrecord

package
v0.312.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HistCounts = []int{10, 100, 1000}

HistCounts is the standard set of histogram counts for benchmarks.

View Source
var HistDataCases = []HistDataCase{
	{"exp", GenExpHistograms},
	{"nhcb", GenCustomBucketHistograms},
}

HistDataCases is the standard set of histogram data cases for benchmarks.

HistSTCases is the standard set of histogram ST cases for benchmarks.

Functions

func GenCustomBucketHistograms added in v0.312.0

func GenCustomBucketHistograms(n int, stCase HistSTCase) []record.RefHistogramSample

GenCustomBucketHistograms generates n custom-bucket (NHCB) histograms (schema=-53) with incrementing refs. The stCase parameter controls how the ST field is populated.

func GenExpHistograms added in v0.312.0

func GenExpHistograms(n int, stCase HistSTCase) []record.RefHistogramSample

GenExpHistograms generates n standard exponential histograms (schema=1) with incrementing refs, same timestamp, and realistic bucket distributions. The stCase parameter controls how the ST field is populated.

func GenFloatHistograms added in v0.312.0

func GenFloatHistograms(src []record.RefHistogramSample) []record.RefFloatHistogramSample

GenFloatHistograms converts int histograms to float histograms, preserving ST.

func GenTestRefSamplesCase

func GenTestRefSamplesCase(t testing.TB, c RefSamplesCase) []record.RefSample

Types

type HistDataCase added in v0.312.0

type HistDataCase struct {
	Name string
	Gen  func(n int, stCase HistSTCase) []record.RefHistogramSample
}

HistDataCase pairs a name with a histogram generator for benchmark tables.

type HistSTCase added in v0.312.0

type HistSTCase string

HistSTCase selects the start-time pattern for histogram test data generators.

const (
	HistNoST       HistSTCase = "no-st"
	HistConstST    HistSTCase = "const-st"
	HistPrevTST    HistSTCase = "prevt-st"
	HistVariableST HistSTCase = "var-st"
)

type RefSamplesCase

type RefSamplesCase string
const (
	Realistic1000Samples               RefSamplesCase = "real1000"
	Realistic1000WithVariableSTSamples RefSamplesCase = "real1000-vst"
	Realistic1000WithConstSTSamples    RefSamplesCase = "real1000-cst"
	WorstCase1000                      RefSamplesCase = "worst1000"
	WorstCase1000WithSTSamples         RefSamplesCase = "worst1000-st"
)

Jump to

Keyboard shortcuts

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