counter

package
v0.0.0-...-b809b14 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ComponentType runtime.ComponentType = "counter manager"

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

func NewCounter

func NewCounter(name string) *Counter

func (*Counter) Decrement

func (c *Counter) Decrement(group string)

func (*Counter) Get

func (c *Counter) Get() int64

func (*Counter) GetByGroup

func (c *Counter) GetByGroup(group string) int64

func (*Counter) Increment

func (c *Counter) Increment(group string)

func (*Counter) Reset

func (c *Counter) Reset()

type CounterManager

type CounterManager interface {
	RegisterSimpleCounter(kind resmodel.ResourceKind)
	RegisterDistributionCounter(kind resmodel.ResourceKind, metric CounterType, extractor FieldExtractor)
	Count(kind resmodel.ResourceKind) int64
	Distribution(metric CounterType) map[string]int64
	CountByMesh(kind resmodel.ResourceKind, mesh string) int64
	DistributionByMesh(metric CounterType, mesh string) map[string]int64
	Reset()
	Bind(bus events.EventBus) error
}

func NewCounterManager

func NewCounterManager() CounterManager

type CounterType

type CounterType string
const (
	ProtocolCounter  CounterType = "protocol"
	ReleaseCounter   CounterType = "release"
	DiscoveryCounter CounterType = "discovery"
)

type DistributionCounter

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

func NewDistributionCounter

func NewDistributionCounter(name string) *DistributionCounter

func (*DistributionCounter) Decrement

func (c *DistributionCounter) Decrement(group, key string)

func (*DistributionCounter) GetAll

func (c *DistributionCounter) GetAll() map[string]int64

func (*DistributionCounter) GetByGroup

func (c *DistributionCounter) GetByGroup(group string) map[string]int64

func (*DistributionCounter) Increment

func (c *DistributionCounter) Increment(group, key string)

func (*DistributionCounter) Reset

func (c *DistributionCounter) Reset()

type FieldExtractor

type FieldExtractor func(resmodel.Resource) string

type ManagerComponent

type ManagerComponent interface {
	runtime.Component
	CounterManager() CounterManager
}

Jump to

Keyboard shortcuts

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