utilizationtracker

package module
v0.84.5 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package utilizationtracker provides a utility to track the utilization of a component.

Package utilizationtracker provides a utility to track the utilization of a component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UtilizationTracker

type UtilizationTracker struct {
	Output chan float64
	// contains filtered or unexported fields
}

UtilizationTracker tracks the utilization of a component.

func NewUtilizationTracker

func NewUtilizationTracker(
	interval time.Duration,
	alpha float64,
) *UtilizationTracker

NewUtilizationTracker instantiates and configures a utilization tracker that calculates the values and publishes them to expvars

func (*UtilizationTracker) Finished

func (ut *UtilizationTracker) Finished()

Finished should be invoked when a compnent's work is complete so that we can calculate the utilization of the compoennt.

Produces one value on the Output channel.

func (*UtilizationTracker) Started

func (ut *UtilizationTracker) Started()

Started should be invoked when a compnent's work is about to being so that we can track the start time and the utilization.

Produces one value on the Output channel.

func (*UtilizationTracker) Stop

func (ut *UtilizationTracker) Stop()

Stop should be invoked when a component is about to exit so that we can clean up the instances resources.

func (*UtilizationTracker) Tick

func (ut *UtilizationTracker) Tick()

Tick updates to the utilization during intervals where no component were started or stopped.

Produces one value on the Output channel.

Jump to

Keyboard shortcuts

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