stats

package
v2.4.48 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: AGPL-3.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Frontend = NewResettableMap()
	Backend  = NewResettableMap()
	General  = expvar.NewMap("proxy")
)

exposed expvar variables

Functions

func ResetAllCounters added in v2.4.47

func ResetAllCounters() (map[string]int64, map[string]int64)

ResetAllCounters resets all frontend and backend counters and returns their previous values

func ResetBackendCounters added in v2.4.47

func ResetBackendCounters() map[string]int64

ResetBackendCounters resets all backend counters and returns their previous values

func ResetFrontendCounters added in v2.4.47

func ResetFrontendCounters() map[string]int64

ResetFrontendCounters resets all frontend counters and returns their previous values

Types

type Counter added in v2.4.47

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

Counter represents a thread-safe counter that can be reset

func (*Counter) Add added in v2.4.47

func (c *Counter) Add(delta int64)

Add increments the counter by the given value

func (*Counter) Get added in v2.4.47

func (c *Counter) Get() int64

Get returns the current value of the counter

func (*Counter) Reset added in v2.4.47

func (c *Counter) Reset() int64

Reset sets the counter to 0 and returns the previous value

func (*Counter) String added in v2.4.47

func (c *Counter) String() string

String implements the expvar.Var interface

type ResettableMap added in v2.4.47

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

ResettableMap is a thread-safe map of counters that can be reset

func NewResettableMap added in v2.4.47

func NewResettableMap() *ResettableMap

NewResettableMap creates a new ResettableMap

func (*ResettableMap) Add added in v2.4.47

func (rm *ResettableMap) Add(key string, delta int64)

Add increments a counter by the given value, creating it if it doesn't exist

func (*ResettableMap) Get added in v2.4.47

func (rm *ResettableMap) Get(key string) int64

Get returns the current value of a counter

func (*ResettableMap) Reset added in v2.4.47

func (rm *ResettableMap) Reset(key string) int64

Reset resets a specific counter and returns its previous value

func (*ResettableMap) ResetAll added in v2.4.47

func (rm *ResettableMap) ResetAll() map[string]int64

ResetAll resets all counters and returns a map of their previous values

func (*ResettableMap) Set added in v2.4.48

func (rm *ResettableMap) Set(key string, value interface{})

Set sets a counter to a specific value, creating it if it doesn't exist

func (*ResettableMap) String added in v2.4.47

func (rm *ResettableMap) String() string

String implements the expvar.Var interface

type Stringer

type Stringer string

func (Stringer) String

func (s Stringer) String() string

Jump to

Keyboard shortcuts

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