Documentation
¶
Index ¶
- func CompareRecorderCosts(database, memory *Recorder)
- func DumpHeap(opts ...HeapDumpOption) bool
- func Enabled(lvl Level) bool
- func LogRecorder(label string, recorders ...*Recorder)
- func SetLevel(lvl Level)
- func SetLevelFromString(raw string) error
- func StartHeapMonitor(interval time.Duration, opts ...HeapDumpOption) context.CancelFunc
- func Track(name string, steps ...func() error) error
- func TrackHigh(name string, steps ...func() error) error
- func TrackLow(name string, steps ...func() error) error
- type HeapDumpOption
- func WithDisable(disable ...bool) HeapDumpOption
- func WithDumpCount(count int) HeapDumpOption
- func WithFileName(name string) HeapDumpOption
- func WithHTTPServer(addr string) HeapDumpOption
- func WithHeapFile(name string) HeapDumpOption
- func WithHeapLimit(memThreshold uint64) HeapDumpOption
- func WithName(name string) HeapDumpOption
- func WithRuntimeGC(enable ...bool) HeapDumpOption
- type Level
- type Measurement
- type Recorder
- func (rec *Recorder) Log(label ...string)
- func (r *Recorder) Reset()
- func (r *Recorder) Snapshot() []Measurement
- func (r *Recorder) Track(name string, steps ...func() error) error
- func (r *Recorder) TrackHigh(name string, steps ...func() error) error
- func (r *Recorder) TrackLow(name string, steps ...func() error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareRecorderCosts ¶
func CompareRecorderCosts(database, memory *Recorder)
func DumpHeap ¶
func DumpHeap(opts ...HeapDumpOption) bool
func LogRecorder ¶
func SetLevelFromString ¶
SetLevelFromString parses a string and applies the log level if valid.
func StartHeapMonitor ¶
func StartHeapMonitor(interval time.Duration, opts ...HeapDumpOption) context.CancelFunc
Types ¶
type HeapDumpOption ¶
type HeapDumpOption func(*heapDumpConfig)
func WithDisable ¶
func WithDisable(disable ...bool) HeapDumpOption
func WithDumpCount ¶
func WithDumpCount(count int) HeapDumpOption
func WithFileName ¶
func WithFileName(name string) HeapDumpOption
func WithHTTPServer ¶
func WithHTTPServer(addr string) HeapDumpOption
func WithHeapFile ¶
func WithHeapFile(name string) HeapDumpOption
func WithHeapLimit ¶
func WithHeapLimit(memThreshold uint64) HeapDumpOption
func WithName ¶
func WithName(name string) HeapDumpOption
func WithRuntimeGC ¶
func WithRuntimeGC(enable ...bool) HeapDumpOption
type Level ¶
type Level int
Level controls the detail tier used when recording diagnostics measurements.
type Measurement ¶
type Measurement struct {
Name string
Total time.Duration
Count uint64
ErrorCount uint64
Steps []time.Duration
}
func (Measurement) Average ¶
func (m Measurement) Average() time.Duration
func (Measurement) String ¶
func (m Measurement) String() string
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func DefaultRecorder ¶
func DefaultRecorder() *Recorder
func NewRecorder ¶
func NewRecorder() *Recorder
func ReplaceDefault ¶
func ResetDefaultRecorder ¶
func ResetDefaultRecorder() *Recorder
func (*Recorder) Snapshot ¶
func (r *Recorder) Snapshot() []Measurement
Click to show internal directories.
Click to hide internal directories.