memstats

package
v0.0.0-...-5571a5c Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMinimumReadMemStatsInterval time.Duration = 15 * time.Second

DefaultMinimumReadMemStatsInterval is the default minimum interval between calls to runtime.ReadMemStats(). Use the WithMinimumReadMemStatsInterval() option to modify this setting in Start().

Variables

This section is empty.

Functions

func Start

func Start(opts ...Option) error

Start initializes reporting of runtime metrics using the supplied config.

Types

type Option

type Option interface {
	// ApplyRuntime updates *config.
	ApplyRuntime(*config)
}

Option supports configuring optional settings for runtime metrics.

func WithExtraRuntimeMetrics

func WithExtraRuntimeMetrics() Option

WithExtraRuntimeMetrics sets a flag that if set to true will allow extra metrics to be emitted eg. goroutine num.

func WithLabels

func WithLabels(labels []label.KeyValue) Option

WithLabels sets a number of labels to the actual metric because the export at the collector side does not expose them by default if they are only specified at the resource level to be emitted eg. goroutine num.

func WithMetricPrefix

func WithMetricPrefix(prefix string) Option

WithMetricPrefix sets a prefix to the name of all the metrics

func WithMinimumReadMemStatsInterval

func WithMinimumReadMemStatsInterval(d time.Duration) Option

WithMinimumReadMemStatsInterval sets a minimum interval between calls to runtime.ReadMemStats(), which is a relatively expensive call to make frequently. This setting is ignored when `d` is negative.

Jump to

Keyboard shortcuts

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