zcount

package
v0.0.0-...-9d1b792 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

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
}

A Counter is a striped int64 counter.

Should be preferred over a single atomically updated int64 counter in high contention scenarios.

A Counter must not be copied after first use.

func (*Counter) Add

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

Add adds the delta to the counter.

func (*Counter) AddZ

func (c *Counter) AddZ(delta int64)

Add adds the delta to the counter.

func (*Counter) Dec

func (c *Counter) Dec() int64

Dec decrements the counter by 1.

func (*Counter) Inc

func (c *Counter) Inc() int64

Inc increments the counter by 1.

func (*Counter) IncZ

func (c *Counter) IncZ()

func (*Counter) Reset

func (c *Counter) Reset()

Reset resets the counter to zero. This method should only be used when it is known that there are no concurrent modifications of the counter.

func (*Counter) Value

func (c *Counter) Value() int64

Value returns the current counter value. The returned value may not include all of the latest operations in presence of concurrent modifications of the counter.

Jump to

Keyboard shortcuts

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