stats

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: BSD-2-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	IncrHit()
	IncrMiss()
	IncrLocalHit()
	IncrLocalMiss()
	IncrRemoteHit()
	IncrRemoteMiss()
	IncrQuery()
	IncrQueryFail(err error)
}

Handler defines the interface that the Transport uses to collect cache metrics. Note that implementations of this interface must be thread-safe; the methods of a Handler can be called from concurrent goroutines.

func NewHandles

func NewHandles(disable bool, handlers ...Handler) Handler

NewHandles creates a new instance of Handlers.

func NewStatsLogger

func NewStatsLogger(name string, opts ...Option) Handler

type Handlers

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

func (*Handlers) IncrHit

func (hs *Handlers) IncrHit()

func (*Handlers) IncrLocalHit

func (hs *Handlers) IncrLocalHit()

func (*Handlers) IncrLocalMiss

func (hs *Handlers) IncrLocalMiss()

func (*Handlers) IncrMiss

func (hs *Handlers) IncrMiss()

func (*Handlers) IncrQuery

func (hs *Handlers) IncrQuery()

func (*Handlers) IncrQueryFail

func (hs *Handlers) IncrQueryFail(err error)

func (*Handlers) IncrRemoteHit

func (hs *Handlers) IncrRemoteHit()

func (*Handlers) IncrRemoteMiss

func (hs *Handlers) IncrRemoteMiss()

type Option

type Option func(o *Options)

Option defines the method to customize an Options.

func WithStatsInterval

func WithStatsInterval(statsInterval time.Duration) Option

type Options

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

type Stats

type Stats struct {
	Options
	Name       string
	Hit        uint64
	Miss       uint64
	LocalHit   uint64
	LocalMiss  uint64
	RemoteHit  uint64
	RemoteMiss uint64
	Query      uint64
	QueryFail  uint64
}

func (*Stats) IncrHit

func (s *Stats) IncrHit()

func (*Stats) IncrLocalHit

func (s *Stats) IncrLocalHit()

func (*Stats) IncrLocalMiss

func (s *Stats) IncrLocalMiss()

func (*Stats) IncrMiss

func (s *Stats) IncrMiss()

func (*Stats) IncrQuery

func (s *Stats) IncrQuery()

func (*Stats) IncrQueryFail

func (s *Stats) IncrQueryFail(err error)

func (*Stats) IncrRemoteHit

func (s *Stats) IncrRemoteHit()

func (*Stats) IncrRemoteMiss

func (s *Stats) IncrRemoteMiss()

Jump to

Keyboard shortcuts

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