rate

package module
v0.0.0-...-61f9cf3 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: BSD-3-Clause Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorRate

func ErrorRate(successes, failures float64) float64

Types

type Errors

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

func NewErrors

func NewErrors(period time.Duration) *Errors

func (*Errors) Inc

func (e *Errors) Inc(n int64) (sucesses, failures float64)

func (*Errors) Rate

func (e *Errors) Rate() float64

func (*Errors) Reset

func (e *Errors) Reset()

func (*Errors) SetNow

func (e *Errors) SetNow(now time.Time)

type Number

type Number interface {
	constraints.Integer | constraints.Float
}

type Rate

type Rate struct {
	Now func() time.Time
	// contains filtered or unexported fields
}

func NewRate

func NewRate(period time.Duration) *Rate

func (*Rate) Inc

func (r *Rate) Inc(n int64) int64

func (*Rate) Reset

func (r *Rate) Reset()

func (*Rate) Throughput

func (r *Rate) Throughput() float64

Throughput returns the number of transactions per second.

Jump to

Keyboard shortcuts

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