pprofextension

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package pprofextension implements an extension that exposes the golang net/http/pprof (Performance Profiler) in a HTTP endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	configmodels.ExtensionSettings `mapstructure:",squash"`

	// Endpoint is the address and port in which the pprof will be listening to.
	// Use localhost:<port> to make it available only locally, or ":<port>" to
	// make it available on all network interfaces.
	Endpoint string `mapstructure:"endpoint"`

	// Fraction of blocking events that are profiled. A value <= 0 disables
	// profiling. See https://golang.org/pkg/runtime/#SetBlockProfileRate for details.
	BlockProfileFraction int `mapstructure:"block_profile_fraction"`

	// Fraction of mutex contention events that are profiled. A value <= 0
	// disables profiling. See https://golang.org/pkg/runtime/#SetMutexProfileFraction
	// for details.
	MutexProfileFraction int `mapstructure:"mutex_profile_fraction"`

	// Optional file name to save the CPU profile to. The profiling starts when the
	// Collector starts and is saved to the file when the Collector is terminated.
	SaveToFile string `mapstructure:"save_to_file"`
}

Config has the configuration for the extension enabling the golang net/http/pprof (Performance Profiler) extension.

type Factory

type Factory struct {
}

ExtensionFactory is the factory for the extension.

func (*Factory) CreateDefaultConfig

func (f *Factory) CreateDefaultConfig() configmodels.Extension

CreateDefaultConfig creates the default configuration for the extension.

func (*Factory) CreateExtension

func (f *Factory) CreateExtension(
	logger *zap.Logger,
	cfg configmodels.Extension,
) (component.ServiceExtension, error)

CreateExtension creates the extension based on this config.

func (*Factory) Type

func (f *Factory) Type() string

Type gets the type of the config created by this factory.

Jump to

Keyboard shortcuts

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