counter

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package counter implements a counter that keeps some historical data to calculate rates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

func New

func New(maxPeriod, resolution time.Duration) *Counter

New returns a new Counter.

func (*Counter) Incr

func (c *Counter) Incr(delta int64) int64

func (*Counter) Rate

func (c *Counter) Rate(period time.Duration) float64

func (*Counter) Value

func (c *Counter) Value() int64

Jump to

Keyboard shortcuts

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