stats

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package stats contains calculation utils for benchmarks Based on https://github.com/anycable/websocket-bench/blob/master/benchmark/stat.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoundToMS

func RoundToMS(d time.Duration) int64

RoundToMS returns the number of milliseconds for the given duration

Types

type ResAggregate

type ResAggregate struct {
	// contains filtered or unexported fields
}

ResAggregate contains duration samples

func (*ResAggregate) Add

func (agg *ResAggregate) Add(rtt time.Duration)

Add adds a new sample to the aggregate

func (*ResAggregate) Count

func (agg *ResAggregate) Count() int

Count returns the number of samples

func (*ResAggregate) Max

func (agg *ResAggregate) Max() time.Duration

Max returns the max value

func (*ResAggregate) Min

func (agg *ResAggregate) Min() time.Duration

Min returns the min value

func (*ResAggregate) Percentile

func (agg *ResAggregate) Percentile(p int) time.Duration

Percentile returns the p-th percentile

Jump to

Keyboard shortcuts

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