profiling

package
v0.0.0-...-d19fc40 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartGCPProfiler

func StartGCPProfiler(serviceName string, env GCPProfilerEnvConfig) error

StartGCPProfiler starts the GCP Profiler if enabled in the given EnvConfig struct. Returns an error or nil if the GCP Profiler is disabled.

Types

type GCPProfilerEnvConfig

type GCPProfilerEnvConfig struct {
	// GCPProfiler enables the Google Cloud Profiler when GCP_PROFILER=1
	// (or any other true value that strconv.ParseBool supports). Defaults to
	// false.
	GCPProfiler bool `envconfig:"GCP_PROFILER"`
	// GCPProfilerProject sets the GCP project to use when profiling with
	// GCP_PROFILER_PROJECT. Optional on GCP.
	GCPProfilerProject string `envconfig:"GCP_PROFILER_PROJECT"`
	// GCPProfilerServiceVersion sets the version string of the service being
	// profiled with GCP_PROFILER_SERVICE_VERSION. Defaults to 0.1.
	GCPProfilerServiceVersion string `envconfig:"GCP_PROFILER_SERVICE_VERSION" default:"0.1"`
	// GCPProfilerDebugLogging enables debug logging when
	// GCP_PROFILER_DEBUG_LOGGING=1 (or any other true value that
	// strconv.ParseBool supports). Defaults to false.
	GCPProfilerDebugLogging bool `envconfig:"GCP_PROFILER_DEBUG_LOGGING"`
}

GCPProfilerEnvConfig defines environment variables for enabling and configuring the GCP Profiler. Intended to be embedded in per-binary envconfig struct types.

func (GCPProfilerEnvConfig) GCPProfilerEnabled

func (c GCPProfilerEnvConfig) GCPProfilerEnabled() bool

GCPProfilerEnabled returns true if the config enables the GCP Profiler.

Jump to

Keyboard shortcuts

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