util

package
v0.0.0-...-2ae3236 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServiceNameFromTags

func ServiceNameFromTags(ctrName string, taggerEntity taggertypes.EntityID, taggerFunc func(entity taggertypes.EntityID) ([]string, error)) string

ServiceNameFromTags returns the standard tag 'service' corresponding to a container It returns an empty string if tag not found

Types

type MovingSum

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

MovingSum is a time-based moving sum that uses buckets to calculate the sum over a specified window.

func NewMovingSum

func NewMovingSum(timeWindow time.Duration, bucketSize time.Duration, clock clock.Clock) *MovingSum

NewMovingSum creates a new MovingSum with the specified time window, bucket size, and clock.

func (*MovingSum) Add

func (ms *MovingSum) Add(byteValue int64)

Add adds a byte value to the MovingSum, creating a new bucket if necessary.

func (*MovingSum) Info

func (ms *MovingSum) Info() []string

Info returns the moving sum as a formatted string slice.

func (*MovingSum) InfoKey

func (ms *MovingSum) InfoKey() string

InfoKey returns a string representing the key for the moving sum.

func (*MovingSum) MovingSum

func (ms *MovingSum) MovingSum() int64

MovingSum returns the current sum over the specified time window.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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