dnsperf

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, queries io.Reader, addr, network string, duration time.Duration, count int) error

Run runs dnsperf which read the queries from the io.Reader and benchmarks the server running on addr. The test runs for duration. The thread count is set the runtime.NumCPU/2, as both the server and requestor are running on the same machine. I.e.

Run(q, "127.0.0.1:8053", udp, 2*time.Second, 10)

runs: "dnsperf -s 127.0.0.1 -p 8053 -l 2 -c 2 -T 2", 10 times (if runtime.NumCPU returns 4).

See dnsperf on how to create queries. The queries io.Reader is drained and placed in a file.

The output is simular to running Go benchmark tests and can be used in benchstat. See https://pkg.go.dev/golang.org/x/perf/cmd/benchstat

Types

This section is empty.

Jump to

Keyboard shortcuts

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