counter

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SLOT counter resulting stored.
	SLOT int64 = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

Counter resulting count in default interval period. It is thread safe.

func (*Counter) Add

func (c *Counter) Add()

Add counts once in now.

func (*Counter) AddN

func (c *Counter) AddN(n int)

AddN adds n in now.

func (*Counter) Show

func (c *Counter) Show() (counts [SLOT]int)

Show returns result from oldest to newest.

Jump to

Keyboard shortcuts

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