perfstat

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAll

func GetAll() map[string]map[string]*Stat

func GetDefaultAggregationPeriodMs

func GetDefaultAggregationPeriodMs() int64

func Merge

func Merge(rhs map[string]map[string]*Stat)

func ResetAll

func ResetAll()

func Round

func Round(nanos int64) float64

returns #.### ms

func SetDefaultAggregationPeriodMs

func SetDefaultAggregationPeriodMs(ms int64)

Types

type PerfStat

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

Record/calculate performance statistic for aggregation period and grand total.

Create an instance per component

perf := perfstat.ForName("domain")

Use in method

t := perf.Start()
... calculations
fmt.Printf("%f ms\n", perfstat.Round(perf.Stop(t)))

Once per aggregation time period flush samples somethere for Graphana to pick-up

func ForName

func ForName(name string) *PerfStat

func ForTypeName

func ForTypeName(typ, name string) *PerfStat

func ForTypeNamePeriod

func ForTypeNamePeriod(typ, name string, period int64) *PerfStat

func (*PerfStat) GetFullName

func (p *PerfStat) GetFullName() string

func (*PerfStat) GetName

func (p *PerfStat) GetName() string

func (*PerfStat) GetStat

func (p *PerfStat) GetStat() *Stat

func (*PerfStat) GetType

func (p *PerfStat) GetType() string

func (*PerfStat) Reset

func (p *PerfStat) Reset()

func (*PerfStat) Start

func (p *PerfStat) Start() time.Time

func (*PerfStat) Stop

func (p *PerfStat) Stop(start time.Time) int64

func (*PerfStat) String

func (p *PerfStat) String() string

type Stat

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

func GetByName

func GetByName(name string) *Stat

func GetByTypeName

func GetByTypeName(typ, name string) *Stat

func (*Stat) GetAvgTimeMs

func (s *Stat) GetAvgTimeMs() float64

func (*Stat) GetAvgTimeSampleMs

func (s *Stat) GetAvgTimeSampleMs() float64

func (*Stat) GetFullName

func (s *Stat) GetFullName() string

func (*Stat) GetLeapTimeMs

func (s *Stat) GetLeapTimeMs() float64

func (*Stat) GetLeapsCount

func (s *Stat) GetLeapsCount() int64

func (*Stat) GetLeapsCountSample

func (s *Stat) GetLeapsCountSample() int64

func (*Stat) GetMaxTimeMs

func (s *Stat) GetMaxTimeMs() float64

func (*Stat) GetMaxTimeSampleMs

func (s *Stat) GetMaxTimeSampleMs() float64

func (*Stat) GetMinTimeMs

func (s *Stat) GetMinTimeMs() float64

func (*Stat) GetMinTimeSampleMs

func (s *Stat) GetMinTimeSampleMs() float64

func (*Stat) GetName

func (s *Stat) GetName() string

func (*Stat) GetPeersCount

func (s *Stat) GetPeersCount() int64

func (*Stat) GetTotalTimeMs

func (s *Stat) GetTotalTimeMs() float64

func (*Stat) GetType

func (s *Stat) GetType() string

func (*Stat) Reset

func (s *Stat) Reset()

func (*Stat) String

func (s *Stat) String() string

Jump to

Keyboard shortcuts

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