system

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: AGPL-3.0 Imports: 13 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 Done

func Done() <-chan struct{}

Done returns the channel that notifies the process quitting.

func SetDefaultOutputDir

func SetDefaultOutputDir(dir string) error

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, error)

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