stats

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

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

Stats is a thread-safe statistics collector.

func New

func New() *Stats

New creates a new Stats collector.

func (*Stats) AddEvictedCost added in v1.1.0

func (s *Stats) AddEvictedCost(cost uint32)

AddEvictedCost adds cost to the evictedCost counter.

func (*Stats) Clear

func (s *Stats) Clear()

func (*Stats) EvictedCost added in v1.1.0

func (s *Stats) EvictedCost() int64

EvictedCost returns the sum of costs of evicted entries.

func (*Stats) EvictedCount added in v1.1.0

func (s *Stats) EvictedCount() int64

EvictedCount returns the number of evicted entries.

func (*Stats) Hits

func (s *Stats) Hits() int64

Hits returns the number of cache hits.

func (*Stats) IncEvictedCount added in v1.1.0

func (s *Stats) IncEvictedCount()

IncEvictedCount increments the evictedCount counter.

func (*Stats) IncHits

func (s *Stats) IncHits()

IncHits increments the hits counter.

func (*Stats) IncMisses

func (s *Stats) IncMisses()

IncMisses increments the misses counter.

func (*Stats) IncRejectedSets added in v1.1.0

func (s *Stats) IncRejectedSets()

IncRejectedSets increments the rejectedSets counter.

func (*Stats) Misses

func (s *Stats) Misses() int64

Misses returns the number of cache misses.

func (*Stats) RejectedSets added in v1.1.0

func (s *Stats) RejectedSets() int64

RejectedSets returns the number of rejected sets.

Jump to

Keyboard shortcuts

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