stats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Absolute

func Absolute(category, key string, value int64)

func Decrement

func Decrement(category, key string)

func DecrementBy

func DecrementBy(category, key string, value int64)

func Gauge

func Gauge(category, key string, value int64)

func GetTimestamp

func GetTimestamp(category string, key ...string) *time.Time

func Increment

func Increment(category string, key ...string)

func IncrementBy

func IncrementBy(category, key string, value int64)

func JoinArray

func JoinArray(array []string, delimiter string) string

func Register

func Register(h StatsInterface)

func RegisterStats

func RegisterStats(statsKey string, callback func() interface{})

func Stat

func Stat(category, key string) int64

func StatsMap

func StatsMap() (util.MapStr, error)

func Timestamp

func Timestamp(category, key string, value time.Time)

func TimestampNow

func TimestampNow(category string, key ...string)

record the last timestamp for specify operation

func Timing

func Timing(category, key string, value int64)

Types

type StatsInterface

type StatsInterface interface {
	Increment(category, key string)

	IncrementBy(category, key string, value int64)

	Decrement(category, key string)

	DecrementBy(category, key string, value int64)

	Absolute(category, key string, value int64)

	Timing(category, key string, v int64)

	Gauge(category, key string, v int64)

	Stat(category, key string) int64

	StatsAll() string

	//record the last timestamp for specify operation
	RecordTimestamp(category, key string, value time.Time)
	//get the last timestamp for specify operation
	GetTimestamp(category, key string) (time.Time, error)
}

Jump to

Keyboard shortcuts

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