proc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMemProfileRate = 4096

DefaultMemProfileRate is the default memory profiling rate. See also http://golang.org/pkg/runtime/#pkg-variables

Variables

This section is empty.

Functions

func AddShutdownListener

func AddShutdownListener(fn func()) (waitForCalled func())

AddShutdownListener adds fn as a shutdown listener. The returned func can be used to wait for fn getting called.

func AddWrapUpListener

func AddWrapUpListener(fn func()) (waitForCalled func())

AddWrapUpListener adds fn as a wrap up listener. The returned func can be used to wait for fn getting called.

func Env

func Env(name string) string

Env returns the value of the given environment variable.

func EnvInt

func EnvInt(name string) (int, bool)

EnvInt returns an int value of the given environment variable.

func Pid

func Pid() int

Pid returns pid of current process.

func ProcessName

func ProcessName() string

ProcessName returns the processname, same as the command name.

func SetTimeToForceQuit

func SetTimeToForceQuit(duration time.Duration)

SetTimeToForceQuit sets the waiting time before force quitting.

Types

type Profile

type Profile struct {
	// contains filtered or unexported fields
}

Profile represents an active profiling session.

func (*Profile) Stop

func (p *Profile) Stop()

Stop stops the profile and flushes any unwritten data.

type Stopper

type Stopper interface {
	Stop()
}

Stopper interface wraps the method Stop.

func StartProfile

func StartProfile() Stopper

StartProfile starts a new profiling session. The caller should call the Stop method on the value returned to cleanly stop profiling.

Jump to

Keyboard shortcuts

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