usage_metrics

package
v16.11.10 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "usage_metrics"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter interface {
	// Inc increment the counter by 1.
	Inc()
}

type UniqueCounter

type UniqueCounter interface {
	Add(int64)
}

type UsageData

type UsageData struct {
	Counters       map[string]int64
	UniqueCounters map[string][]int64
}

func (*UsageData) IsEmpty

func (d *UsageData) IsEmpty() bool

type UsageTracker

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

func NewUsageTracker

func NewUsageTracker() *UsageTracker

func (*UsageTracker) CloneUsageData

func (ut *UsageTracker) CloneUsageData() *UsageData

func (*UsageTracker) RegisterCounter

func (ut *UsageTracker) RegisterCounter(name string) Counter

func (*UsageTracker) RegisterUniqueCounter

func (ut *UsageTracker) RegisterUniqueCounter(name string) UniqueCounter

func (*UsageTracker) Subtract

func (ut *UsageTracker) Subtract(ud *UsageData)

type UsageTrackerCollector

type UsageTrackerCollector interface {
	// CloneUsageData returns collected usage data.
	// Only non-zero counters are returned.
	CloneUsageData() *UsageData
	Subtract(data *UsageData)
}

type UsageTrackerInterface

type UsageTrackerInterface interface {
	UsageTrackerRegisterer
	UsageTrackerCollector
}

type UsageTrackerRegisterer

type UsageTrackerRegisterer interface {
	RegisterCounter(name string) Counter
	RegisterUniqueCounter(name string) UniqueCounter
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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