Documentation ¶
Overview ¶
Package tools holds tooling to couple command formatting and output parsers together.
Index ¶
- Constants
- func ExtractRubyLoadTime(output string) (time.Duration, error)
- func ExtractRubyTestTime(output string) (time.Duration, error)
- func ParametersToName(params ...Parameter) (string, error)
- func ReportCustomMetric(b *testing.B, value float64, name, unit string)
- type ApacheBench
- type Fio
- type Hackbench
- type Hey
- type IOEngine
- type Iperf
- type Meminfo
- type Metric
- type Parameter
- type Redis
- type Sysbench
- type SysbenchBase
- type SysbenchCPU
- type SysbenchMemory
- type SysbenchMutex
Constants ¶
const ( EngineSync = IOEngine("sync") EngineLibAIO = IOEngine("libaio") )
Names of FIO I/O engines.
Variables ¶
This section is empty.
Functions ¶
func ExtractRubyLoadTime ¶
ExtractRubyLoadTime extracts the load time from fastlane ruby test output.
func ExtractRubyTestTime ¶
ExtractRubyTestTime extracts the test time from fastlane ruby test output.
func ParametersToName ¶
ParametersToName joins parameters into a string format for parsing. It is meant to be used for t.Run() calls in benchmark tools.
Types ¶
type ApacheBench ¶
ApacheBench is for the client application ApacheBench.
type Fio ¶
type Fio struct { Test string // test to run: read, write, randread, randwrite. IOEngine IOEngine // ioengine to use: sync or libaio. SizeMB int // total size to be read/written in megabytes. BlockSizeKB int // block size to be read/written in kilobytes. IODepth int // I/O depth for reads/writes when using libaio. Jobs int // Number of jobs running in concurrent threads. Direct bool // Whether to use direct I/O (O_DIRECT) or not. }
Fio makes 'fio' commands and parses their output.
func (*Fio) Parameters ¶
Parameters returns the test parameters and the overall test name derived from them.
type Hackbench ¶
type Hackbench struct { IpcMode string // ipc mode: pipe, socket(default) ProcessMode string // process mode: thread, process(default) }
Hackbench makes 'hackbench' commands and parses their output.
type Hey ¶
type Hey struct { Requests int // Note: requests cannot be less than concurrency. Concurrency int Doc string }
Hey is for the client application 'hey'.
type Iperf ¶
type Iperf struct { Num int // Number of bytes to send in KB. Parallel int // Number of parallel threads. }
Iperf is for the client side of `iperf`.
type Meminfo ¶
type Meminfo struct { }
Meminfo wraps measurements of MemAvailable using /proc/meminfo.
type Metric ¶
Metric holds metric data parsed from a string based on the format ReportMetric.
func ParseCustomMetric ¶
ParseCustomMetric parses a metric reported with ReportCustomMetric.
type Parameter ¶
Parameter is a test parameter.
func NameToParameters ¶
NameToParameters parses the string created by ParametersToName and returns it as a set of Parameters. Example: BenchmarkRuby/server_threads.1/doc_size.16KB-6 The parameter part of this benchmark is: "server_threads.1/doc_size.16KB" (BenchmarkRuby is the name, and 6 is GOMAXPROCS) This function will return a slice with two parameters -> {Name: server_threads, Value: 1}, {Name: doc_size, Value: 16KB}
type Redis ¶
type Redis struct {
Operation string
}
Redis is for the client 'redis-benchmark'.
type Sysbench ¶
type Sysbench interface { // MakeCmd constructs the relevant command line. MakeCmd(*testing.B) []string // Report reports relevant custom metrics. Report(*testing.B, string) }
Sysbench represents a 'sysbench' command.
type SysbenchBase ¶
type SysbenchBase struct { // Threads is the number of threads for the test. Threads int }
SysbenchBase is the top level struct for sysbench and holds top-level arguments for sysbench. See: 'sysbench --help'
type SysbenchCPU ¶
type SysbenchCPU struct {
SysbenchBase
}
SysbenchCPU is for 'sysbench [flags] cpu run' and holds CPU specific arguments.
type SysbenchMemory ¶
type SysbenchMemory struct { SysbenchBase BlockSize int // size of test memory block in megabytes [1]. Scope string // memory access scope {global, local} [global]. HugeTLB bool // allocate memory from HugeTLB [off]. OperationType string // type of memory ops {read, write, none} [write]. AccessMode string // access mode {seq, rnd} [seq]. }
SysbenchMemory is for 'sysbench [FLAGS] memory run' and holds Memory specific arguments.
type SysbenchMutex ¶
type SysbenchMutex struct { SysbenchBase Num int // total size of mutex array [4096]. Loops int // number of loops to do outside mutex lock [10000]. }
SysbenchMutex is for 'sysbench [FLAGS] mutex run' and holds Mutex specific arguments.