usage_metrics

package
v14.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: MIT Imports: 2 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 UsageData

type UsageData struct {
	Counters map[string]int64
}

type UsageTracker

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

func NewUsageTracker

func NewUsageTracker() *UsageTracker

func (*UsageTracker) CloneUsageData

func (u *UsageTracker) CloneUsageData() *UsageData

func (*UsageTracker) RegisterCounter

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

func (*UsageTracker) Subtract

func (u *UsageTracker) Subtract(data *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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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