stat

package
v0.0.0-...-55524bd Latest Latest
Warning

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

Go to latest
Published: May 30, 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 TimeStat

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

TimeStat object

func NewTimeStat

func NewTimeStat(name string) *TimeStat

NewTimeStat create a TimeStat object

func (*TimeStat) Add

func (s *TimeStat) Add(dur time.Duration)

Add add a stat element

func (*TimeStat) Average

func (s *TimeStat) Average() (avg time.Duration)

Average get the average stat time

func (*TimeStat) Clean

func (s *TimeStat) Clean()

Clean clean the last stat info

func (*TimeStat) Info

func (s *TimeStat) Info() (min, max, avg time.Duration, cnt, totalCnt uint64)

Info report the time stat info

func (*TimeStat) Name

func (s *TimeStat) Name() string

Name get name of the stat object

func (*TimeStat) Report

func (s *TimeStat) Report() string

Report show the latest stat result

Jump to

Keyboard shortcuts

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