stats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 4 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) Clear

func (s *Stats) Clear()

func (*Stats) Hits

func (s *Stats) Hits() int64

Hits returns the number of cache hits.

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) Misses

func (s *Stats) Misses() int64

Misses returns the number of cache misses.

func (*Stats) Ratio

func (s *Stats) Ratio() float64

Ratio returns the cache hit ratio.

Jump to

Keyboard shortcuts

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