metrics

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelUpdateMetricsFunctions added in v0.3.0

func CancelUpdateMetricsFunctions()

CancelUpdateMetricsFunctions calls the contexts cancel() methods of all interval processes.

func GetDefaultUpdateMetricsInterval added in v0.3.0

func GetDefaultUpdateMetricsInterval() time.Duration

GetDefaultUpdateMetricsInterval gets default interval

func GetUpdateMetricsFunctionInterval added in v0.3.0

func GetUpdateMetricsFunctionInterval(name string) *time.Duration

GetUpdateMetricsFunctionInterval returns the interval the update metrics is currently registered at.

func RegisterUpdateMetricsFunction added in v0.3.0

func RegisterUpdateMetricsFunction(name string, f UpdateMetricsFunction)

RegisterUpdateMetricsFunction allows you to register a function that will update prometheus metrics.

func RegisterUpdateMetricsFunctionWithInterval added in v0.3.0

func RegisterUpdateMetricsFunctionWithInterval(name string, f UpdateMetricsFunction, interval time.Duration)

RegisterUpdateMetricsFunctionWithInterval allows you to register a function that will update prometheus metrics every interval.

func SetDefaultUpdateMetricsInterval added in v0.3.0

func SetDefaultUpdateMetricsInterval(interval time.Duration)

SetDefaultUpdateMetricsInterval sets default interval

func UpdateAPIRateLimitingMetrics added in v0.6.0

func UpdateAPIRateLimitingMetrics(ctx context.Context) error

UpdateAPIRateLimitingMetrics updates api metrics.

func UpdateBatchMetrics

func UpdateBatchMetrics(ctx context.Context) error

UpdateBatchMetrics updates batch metrics

func UpdateGraphMetrics

func UpdateGraphMetrics(ctx context.Context) error

UpdateGraphMetrics updates graph metrics

func UpdateMetrics

func UpdateMetrics(ctx context.Context)

UpdateMetrics main update metrics process. It spawns goroutines of updateMetricsWithInterval() which are responsible for running the update metrics functions every desired update intervals. This method loops forever so it needs to be detached.

func UpdateStorageMetrics added in v0.2.0

func UpdateStorageMetrics(ctx context.Context) error

UpdateStorageMetrics updates storage metrics.

Types

type UpdateMetricsFunction added in v0.2.0

type UpdateMetricsFunction func(context.Context) error

UpdateMetricsFunction is the function type which needs to respected to create update metrics functions.

func GetUpdateMetricsFunction added in v0.3.0

func GetUpdateMetricsFunction(name string) UpdateMetricsFunction

GetUpdateMetricsFunction returns the update metrics function associated to `name`. It will only return a result if the function has previously been registered once. It does not matter if the function has been un-registered.

func UnregisterUpdateMetricsFunctions added in v0.3.0

func UnregisterUpdateMetricsFunctions(name string) UpdateMetricsFunction

UnregisterUpdateMetricsFunctions allows you to unregister an update functions metrics which has been previously registered.

Jump to

Keyboard shortcuts

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