throughput

package
v1.1.21 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Measurement

type Measurement struct {
	Iterations uint64    // Number of iterations done
	StartTime  time.Time // time of measurement startup
}

Measurement measures throughput with StartMeasurement / AddIterations

func NewMeasurement

func NewMeasurement() *Measurement

NewMeasurement creates and starts a Throughput measurment

func (*Measurement) AddIterations

func (m *Measurement) AddIterations(nb uint64)

AddIterations adds iterations to the Throughput measurment GetThroughput and AddIterations can be called in different goroutines

func (*Measurement) GetThroughput

func (m *Measurement) GetThroughput() Result

GetThroughput returns the number of iterations per second returns Throughput, iterations, duration GetThroughput and AddIterations can be called in different goroutines

func (*Measurement) StartMeasurement

func (m *Measurement) StartMeasurement()

StartMeasurement starts the Throughput measurment

type Result

type Result struct {
	Iterations          uint64        // Number of iterations done
	Duration            time.Duration // measurement duration
	IterationsPerSecond float64
}

Result is the result of a throughput measurement

func (Result) Log

func (r Result) Log(msg string)

Log sneds the output to log, prefixed with msg

Jump to

Keyboard shortcuts

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