measurement

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxLatency = 16 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HistInfo added in v1.0.4

type HistInfo struct {
	Elapsed float64
	Sum     float64
	Count   int64
	Ops     float64
	Avg     float64
	P50     float64
	P90     float64
	P95     float64
	P99     float64
	P999    float64
	Max     float64
}

type Histogram added in v1.0.4

type Histogram struct {
	*hdrhistogram.Histogram
	// contains filtered or unexported fields
}

func NewHistogram added in v1.0.4

func NewHistogram(minLat, maxLat time.Duration, sf int) *Histogram

func (*Histogram) Empty added in v1.0.4

func (h *Histogram) Empty() bool

func (*Histogram) GetInfo added in v1.0.4

func (h *Histogram) GetInfo() HistInfo

func (*Histogram) Measure added in v1.0.4

func (h *Histogram) Measure(rawLatency time.Duration)

func (*Histogram) Summary added in v1.0.4

func (h *Histogram) Summary() []string

type Measurement added in v1.0.4

type Measurement struct {
	sync.RWMutex

	MinLatency       time.Duration
	MaxLatency       time.Duration
	SigFigs          int
	OpCurMeasurement map[string]*Histogram
	OpSumMeasurement map[string]*Histogram
	// contains filtered or unexported fields
}

func NewMeasurement added in v1.0.4

func NewMeasurement(opts ...func(*Measurement)) *Measurement

func (*Measurement) EnableWarmUp added in v1.0.4

func (m *Measurement) EnableWarmUp(b bool)

EnableWarmUp sets whether to enable warm-up.

func (*Measurement) IsWarmUpFinished added in v1.0.4

func (m *Measurement) IsWarmUpFinished() bool

IsWarmUpFinished returns whether warm-up is finished or not.

func (*Measurement) Measure added in v1.0.4

func (m *Measurement) Measure(op string, lan time.Duration, err error)

Measure measures the operation.

func (*Measurement) Output added in v1.0.4

func (m *Measurement) Output(ifSummaryReport bool, outputStyle string, outputFunc func(string, string, map[string]*Histogram))

Output prints the measurement summary.

Jump to

Keyboard shortcuts

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