shm

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDefaultMetricsZone

func InitDefaultMetricsZone(name string, size int, clear bool)

InitDefaultMetricsZone used to initialize the default zone according to the configuration.

func InitMetricsZone

func InitMetricsZone(name string, size int) *zone

InitMetricsZone used to initialize the default zone according to the configuration. It's caller's responsibility to detach the zone.

func NewShmCounterFunc

func NewShmCounterFunc(name string) func() gometrics.Counter

func NewShmGaugeFunc

func NewShmGaugeFunc(name string) func() gometrics.Gauge

func Reset

func Reset()

Types

type ShmCounter

type ShmCounter uintptr

StandardCounter is the standard implementation of a Counter and uses the sync/atomic package to manage a single int64 value.

func (ShmCounter) Clear

func (c ShmCounter) Clear()

Clear sets the counter to zero.

func (ShmCounter) Count

func (c ShmCounter) Count() int64

Count returns the current count.

func (ShmCounter) Dec

func (c ShmCounter) Dec(i int64)

Dec decrements the counter by the given amount.

func (ShmCounter) Inc

func (c ShmCounter) Inc(i int64)

Inc increments the counter by the given amount.

func (ShmCounter) Snapshot

func (c ShmCounter) Snapshot() gometrics.Counter

Snapshot returns a read-only copy of the counter.

func (ShmCounter) Stop

func (c ShmCounter) Stop()

stoppable

type ShmGauge

type ShmGauge uintptr

StandardGauge is the standard implementation of a Gauge and uses the sync/atomic package to manage a single int64 value.

func (ShmGauge) Snapshot

func (g ShmGauge) Snapshot() gometrics.Gauge

Snapshot returns a read-only copy of the gauge.

func (ShmGauge) Stop

func (c ShmGauge) Stop()

stoppable

func (ShmGauge) Update

func (g ShmGauge) Update(v int64)

Update updates the gauge's value.

func (ShmGauge) Value

func (g ShmGauge) Value() int64

Value returns the gauge's current value.

Jump to

Keyboard shortcuts

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