histogram

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	sync.Mutex
	Time struct {
		Avg    time.Duration
		P1     int64
		P10    int64
		P50    int64
		P97    int64
		P99    int64
		StdDev time.Duration
		Max    time.Duration
		Min    time.Duration
	}
}

Metrics histogram structure

type Sample

type Sample struct {
	sync.Mutex
	Ticker         *time.Ticker
	StartTime      time.Time
	TimeSleep      int
	Count          int64
	Times          timeSlice
	MetricBodySize struct {
		P1  int64
		P10 int64
		P50 int64
		P97 int64
		P99 int64
	}
	MetricReqSec struct {
		P1  int64
		P10 int64
		P50 int64
		P97 int64
		P99 int64
	}
}

Sample histogram

func New

func New() *Sample

New to start histogram

func (*Sample) AddSize

func (s *Sample) AddSize(t time.Duration, size int64) *Sample

AddSize to add size from sample data

func (*Sample) AddTime

func (s *Sample) AddTime(t time.Duration) *Sample

AddTime to add sample time duration

func (*Sample) CalcLatency

func (s *Sample) CalcLatency()

CalcLatency to calculate sample data

func (*Sample) CalcReqBytes

func (s *Sample) CalcReqBytes()

CalcReqBytes to calculate sample data

func (*Sample) SetTimeSleep

func (s *Sample) SetTimeSleep(d int) *Sample

SetTimeSleep to set time to sleep

Jump to

Keyboard shortcuts

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