Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func OverrideDumper ¶
OverrideDumper overrides the implementation for the dumper which has the specified profile name. This method must be called before calling Start() to take effect. Valid values for name are: "goroutine", "threadcreate", "heap", "block", "mutex", "trace" and "cpu".
Types ¶
type Config ¶
type Config struct {
// Used to tag the profile in some manner. Its meaning depends on how it is used
// by the dumpers implementations.
Tag string
// Number of seconds that have to elapse between profiles generation. In other words,
// each time Frequency seconds elapse, a profiling tick happens and hence the profiles
// generation.
Frequency int
// DebugLevel is used as the second parameter when calling profile.WriteTo to write
// a profile. NOTE: This affects the format of the profiling output.
DebugLevel int
// If true, runs the garbage collector before writing a "heap" profile.
RunGCBeforeHeapProfile bool
// Profiles is an array of the names of the profiles that will get generated on
// each profiling tick.
// Available values for each element:
// "goroutine", "threadcreate", "heap", "block", "mutex", "trace", "cpu"
Profiles []string
}
type Dumper ¶
type Dumper interface {
// Prepares the Dumper before any profiling tick takes place.
Prepare() error
// Dumps the profiling data to some destination.
// timestamp - string containing the time where the profiling tick begun executing,
// in the format yyyy-MM-dd_mmhhss.
// name - name of the profile that is currently dumping data.
Dump(timestamp string, name string) error
// Releases any resources associated with this Dumper.
Release() error
}
Dumper defines the interface that are used to dump profiling data of some kind.
Click to show internal directories.
Click to hide internal directories.