stats

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStatsObject

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

func (*MockStatsObject) Increment

func (m *MockStatsObject) Increment(_ string, count int, _ int64) error

func (*MockStatsObject) Initialize

func (m *MockStatsObject) Initialize() error

func (*MockStatsObject) Key

func (m *MockStatsObject) Key() uint64

func (*MockStatsObject) Matches

func (m *MockStatsObject) Matches(other StatsObject) bool

type StatsCombiner

type StatsCombiner[T StatsObject] struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewStatsCombiner

func NewStatsCombiner[T StatsObject](now time.Time, interval time.Duration) *StatsCombiner[T]

func (*StatsCombiner[T]) Record

func (l *StatsCombiner[T]) Record(now time.Time, item T, incKey string, count int, logSize int64) (*map[uint64][]T, error)

type StatsObject

type StatsObject interface {
	Key() uint64
	Matches(other StatsObject) bool
	Increment(key string, count int, size int64) error
	Initialize() error
}

Jump to

Keyboard shortcuts

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