dnspyre

package
v2.12.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 36 Imported by: 0

Documentation

Overview

Example (Json_printReport)
b, rs := testData()
b.JSON = true
b.Rcodes = true
b.HistDisplay = true

b.PrintReport([]*ResultStats{&rs}, time.Second)
Output:

{"totalRequests":1,"totalSuccessCodes":4,"totalErrors":3,"TotalIDmismatch":6,"totalTruncatedResponses":7,"responseRcodes":{"NOERROR":2},"questionTypes":{"A":2},"queriesPerSecond":1,"benchmarkDurationSeconds":1,"latencyStats":{"minMs":0,"meanMs":0,"stdMs":0,"maxMs":0,"p99Ms":0,"p95Ms":0,"p90Ms":0,"p75Ms":0,"p50Ms":0},"latencyDistribution":[{"latencyMs":0,"count":0},{"latencyMs":0,"count":0},{"latencyMs":0,"count":0},{"latencyMs":0,"count":0},{"latencyMs":0,"count":0},{"latencyMs":0,"count":1},{"latencyMs":0,"count":0},{"latencyMs":0,"count":0},{"latencyMs":0,"count":0},{"latencyMs":0,"count":0},{"latencyMs":0,"count":1}]}
Example (Standard_printReport)
b, rs := testData()

b.PrintReport([]*ResultStats{&rs}, time.Second)
Output:

Total requests:		1
Connection errors:	2
Read/Write errors:	3
ID mismatch errors:	6
DNS success codes:	4
Truncated responses:	7

DNS response codes:
	NOERROR:	2

DNS question types:
	A:	2

Time taken for tests:	 1s
Questions per second:	 1.0
DNS timings, 2 datapoints
	 min:		 5ns
	 mean:		 7ns
	 [+/-sd]:	 2ns
	 max:		 10ns
	 p99:		 10ns
	 p95:		 10ns
	 p90:		 10ns
	 p75:		 10ns
	 p50:		 5ns

Total Errors: 3
Top errors:
test	2 (66.67)%
test2	1 (33.33)%

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	// Version is set during release of project during build process.
	Version = "development"
)

Functions

func Execute

func Execute()

Execute starts main logic of command.

Types

type Benchmark

type Benchmark struct {
	Server      string
	Types       []string
	Count       int64
	Concurrency uint32

	Rate     int
	QperConn int64

	Recurse bool

	Probability float64

	UDPSize uint16
	EdnsOpt string

	TCP bool
	DOT bool

	WriteTimeout time.Duration
	ReadTimeout  time.Duration

	Rcodes bool

	HistDisplay bool
	HistMin     time.Duration
	HistMax     time.Duration
	HistPre     int

	Csv  string
	JSON bool

	Silent bool
	Color  bool

	PlotDir    string
	PlotFormat string

	DohMethod   string
	DohProtocol string

	Insecure bool

	Queries []string

	Duration time.Duration
	// contains filtered or unexported fields
}

Benchmark is representation of benchmark scenario.

func (*Benchmark) PrintReport

func (b *Benchmark) PrintReport(stats []*ResultStats, t time.Duration) error

PrintReport print formatted benchmark results to stdout. If there is a fatal error while printing report, an error is returned.

func (*Benchmark) Run

func (b *Benchmark) Run(ctx context.Context) ([]*ResultStats, error)

Run executes benchmark, if benchmark is unable to start the error is returned, otherwise array of results from parallel benchmark goroutines is returned.

type Counters added in v2.1.0

type Counters struct {
	Total      int64
	ConnError  int64
	IOError    int64
	Success    int64
	IDmismatch int64
	Truncated  int64
}

Counters represents various counters of benchmark results.

type Datapoint

type Datapoint struct {
	Duration float64
	Start    time.Time
}

Datapoint one datapoint of benchmark (single DNS request).

type ResultStats

type ResultStats struct {
	Codes    map[int]int64
	Qtypes   map[string]int64
	Hist     *hdrhistogram.Histogram
	Timings  []Datapoint
	Counters *Counters
	Errors   []error
}

ResultStats is a representation of benchmark results of single concurrent thread.

Jump to

Keyboard shortcuts

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