stats

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(pool string, caches ...*ecache.Cache) error

Bind - to stats a cache `pool` can be used to classify instances that store same items `caches` is cache instances to be binded

func Stats

func Stats() *sync.Map

Stats - get the result like follows

`k` is categoy, type is string `v` is node, type is `*stats.StatsNode`

	stats.Stats().Range(func(k, v interface{}) bool {
    	fmt.Println("stats:", k, v)
    	return true
	})

Types

type StatsNode

type StatsNode struct {
	// don't reorder them or add field between them
	Evicted, Updated, Added, GetMiss, GetHit, DelMiss, DelHit uint64
}

func (*StatsNode) HitRate added in v1.1.0

func (s *StatsNode) HitRate() float64

HitRate

Jump to

Keyboard shortcuts

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