stats

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Report

func Report()

func Total

func Total()

Types

type Counter

type Counter struct {
	Name       string
	TotalCalls int
	// contains filtered or unexported fields
}

func NewCounter

func NewCounter(ctx context.Context, name string) *Counter

func (*Counter) Inc

func (c *Counter) Inc()

func (Counter) Rate

func (c Counter) Rate() float64

func (*Counter) Report

func (c *Counter) Report()

func (*Counter) Total

func (c *Counter) Total()

type Doner

type Doner interface {
	Done()
}

type Reporter

type Reporter interface {
	Report()
	Total()
}

type Timer

type Timer struct {
	Name string
	// contains filtered or unexported fields
}

func NewTimer

func NewTimer(ctx context.Context, name string) *Timer

func (Timer) AverageLatency

func (c Timer) AverageLatency() time.Duration

func (*Timer) Call

func (c *Timer) Call() Doner

func (*Timer) Done

func (c *Timer) Done(start time.Time)

func (Timer) Rate

func (c Timer) Rate() float64

func (*Timer) Report

func (c *Timer) Report()

func (*Timer) Total

func (c *Timer) Total()

Jump to

Keyboard shortcuts

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