stat

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Not deprecated since still used in other metrics
	NoSuchKey = "noKey"

	// Deprecated due to complications
	HasValue = "hasValue"
	CacheHit = "cacheHit"

	CacheCollision = "collision"
	CacheExpired   = "expired"
	LocalHasValue  = "localHasValue"
	LocalNoSuchKey = "localNoKey"

	L1NoSuchKey = "L1NoKey"
	L1HasValue  = "L1HasValue"
	L2NoSuchKey = "L2NoKey"
	L1Copy      = "L1Copy"

	// Aerospike Errors - still complicated
	Timeout = "timeout"
	Down    = "down"
)
View Source
const (
	ErrorKey = "error"
	// Context errors
	Canceled         = "canceled"
	DeadlineExceeded = "deadlineExceeded"
)
View Source
const (
	Enter = Dir(true)
	Exit  = Dir(false)
)
View Source
const (
	L1Write = "L1Write"
	L2Write = "L2Write"
)
View Source
const (
	EarlyCtxError = "ctx"
)
View Source
const Pending = "pending"

Variables

This section is empty.

Functions

func ErrorOnly added in v0.10.0

func ErrorOnly() counter.Provider

func ErrorWrap added in v0.13.0

func ErrorWrap(err error) errorWrap

func NewCache

func NewCache() counter.Provider

func NewClient added in v0.13.0

func NewClient() counter.Provider

func NewCtxErrOnly added in v0.13.0

func NewCtxErrOnly() counter.Provider

func NewHttp added in v0.13.0

func NewHttp() counter.Provider

func NewWrite added in v0.10.0

func NewWrite() counter.Provider

func TestMapping added in v0.9.0

func TestMapping(t *testing.T, builder func() counter.Provider)

TestMapping checks to ensure that a standard 1-to-1 mapping between keys and values exists.

Types

type Count added in v0.13.0

type Count uint64

func (Count) Aggregate added in v0.13.0

func (c Count) Aggregate(value interface{})

Implements counter.CustomCounter so that it can be used by counter.CustomCounter

type Dir added in v0.13.0

type Dir bool

Dir (direction) should be true if this is an enter event; otherwise should be false. It is expected that every Dir has an Exit, but that may not always happen.

func (Dir) Aggregate added in v0.13.0

func (_ Dir) Aggregate(value interface{})

Implements counter.CustomCounter so that it can be passed to Occupancy, representing the element side of reduce.

type E added in v0.13.0

type E struct {
	Error string
	Count uint64
}

type GMeter added in v0.13.1

type GMeter struct {
	*gmetric.Service

	Unit           time.Duration
	RecentDuration time.Duration
	NumRecent      int
}

func DefaultGMeter added in v0.13.1

func DefaultGMeter(m *gmetric.Service) *GMeter

func (*GMeter) MOp added in v0.13.1

func (g *GMeter) MOp(location, name, desc string, p counter.Provider) *gmetric.Operation

func (*GMeter) Op added in v0.13.1

func (g *GMeter) Op(location, name, desc string) *gmetric.Operation

type Occupancy added in v0.13.0

type Occupancy struct {
	// Members are exposed due to how gmetrics operates.
	Max uint64 `json:",omitempty"`
	// contains filtered or unexported fields
}

Occupancy keeps track of in-out metrics (not input-output); in-out counters are numbers that track the number of start and end events; with a focus on tracking the maximum number of starts without an end event.

func (*Occupancy) Aggregate added in v0.13.0

func (a *Occupancy) Aggregate(value interface{})

Aggregate implements counter.CustomCounter, but represents the aggregate side.

type Sum added in v0.13.0

type Sum struct {
	Total uint64 `json:",omitempty"`
}

TODO consider https://github.com/beorn7/perks

func (*Sum) Aggregate added in v0.13.0

func (s *Sum) Aggregate(value interface{})

type TopK added in v0.13.0

type TopK struct {
	Top []E
	// contains filtered or unexported fields
}

func NewTopK added in v0.13.0

func NewTopK(n, mod int) *TopK

func (*TopK) Aggregate added in v0.13.0

func (k *TopK) Aggregate(value interface{})

implements github.com/viant/gmetric/counter.CustomCounter

type Values

type Values []interface{}

Values is a utility to pass multiple events to gmetric.

func NewValues

func NewValues() *Values

func (*Values) Append

func (v *Values) Append(item interface{})

func (*Values) AppendError added in v0.9.0

func (v *Values) AppendError(err error)

func (*Values) Values

func (v *Values) Values() []interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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