Documentation ¶
Index ¶
- Constants
- func AddShutdownListener(fn func()) (waitForCalled func())
- func AddWrapUpListener(fn func()) (waitForCalled func())
- func Env(name string) string
- func EnvInt(name string) (int, bool)
- func Pid() int
- func ProcessName() string
- func SetTimeToForceQuit(duration time.Duration)
- type Profile
- type Stopper
Constants ¶
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 ProcessName ¶
func ProcessName() string
ProcessName returns the processname, same as the command name.
func SetTimeToForceQuit ¶
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.
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.