perfhelper

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 28 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagsForMetrics

func FlagsForMetrics(prefix string, c *MetricsConfig) *pflag.FlagSet

func FlagsForPProfConfig

func FlagsForPProfConfig(prefix string, c *PProfConfig) *pflag.FlagSet

func FlagsForTracing

func FlagsForTracing(prefix string, c *TracingConfig) *pflag.FlagSet

Types

type MetricsConfig

type MetricsConfig struct {
	// Enabled metrics collection
	Enabled bool `json:"enabled" yaml:"enabled"`

	// Endpoint address for metrics/tracing collection,
	// for prometheus, it's a listen address (SHOULD NOT be empty or use random port (:0))
	// for otlp, it's the otlp collector address
	Endpoint string `json:"listen" yaml:"listen"`

	// Format of exposed metrics
	Format string `json:"format" yaml:"format"`

	// HTTPPath for metrics collection
	HTTPPath string `json:"httpPath" yaml:"httpPath"`

	// TLS config for client/server
	TLS tlshelper.TLSConfig `json:"tls" yaml:"tls"`
}

func (*MetricsConfig) RegisterIfEnabled

func (c *MetricsConfig) RegisterIfEnabled(ctx context.Context, logger log.Interface) (err error)

type PProfConfig

type PProfConfig struct {
	Enabled              bool   `json:"enabled" yaml:"enabled"`
	Listen               string `json:"listen" yaml:"listen"`
	HTTPPath             string `json:"httpPath" yaml:"httpPath"`
	MutexProfileFraction int    `json:"mutexProfileFraction" yaml:"mutexProfileFraction"`
	BlockProfileRate     int    `json:"blockProfileRate" yaml:"blockProfileRate"`
}

func (*PProfConfig) RunIfEnabled

func (c *PProfConfig) RunIfEnabled() error

type TracingConfig

type TracingConfig struct {
	// Enabled tracing stats
	Enabled bool `json:"enabled" yaml:"enabled"`

	// Format of exposed tracing stats
	Format string `json:"format" yaml:"format"`

	// EndpointType the type of collector (used for jaeger), can be one of [agent, collector]
	EndpointType string `json:"endpointType" yaml:"endpointType"`

	// Endpoint to report tracing stats
	Endpoint string `json:"endpoint" yaml:"endpoint"`

	// SampleRate
	SampleRate float64 `json:"sampleRate" yaml:"sampleRate"`

	// ReportedServiceName used when reporting tracing stats
	ReportedServiceName string `json:"serviceName" yaml:"serviceName"`

	// TLS config for client/server
	TLS tlshelper.TLSConfig `json:"tls" yaml:"tls"`
}

func (*TracingConfig) RegisterIfEnabled

func (c *TracingConfig) RegisterIfEnabled(ctx context.Context, logger log.Interface) (err error)

Jump to

Keyboard shortcuts

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