sherlock

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Memory configureType = iota
	CPU
	Goroutine
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricCircle

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

type Option

type Option func(opts *options)

func WithCPUMax

func WithCPUMax(max int) Option

WithCPUMax : set the CPUMaxPercent parameter as max

func WithCPURule

func WithCPURule(min int, diff int, abs int, coolDown time.Duration) Option

WithCPURule set the cpu rule options.

func WithGrtRule

func WithGrtRule(min int, diff int, abs int, max int, coolDown time.Duration) Option

WithGrtRule set the goroutine rule options.

func WithLogger

func WithLogger(log *logger.Logger) Option

func WithMaxAge added in v1.2.0

func WithMaxAge(age int) Option

WithMaxAge set the maximum number of days to retain old profile files based on the timestamp encoded in their filename

func WithMaxNum added in v1.2.0

func WithMaxNum(num int) Option

WithMaxNum set the maximum number of old profile files to retain

func WithMemRule

func WithMemRule(min int, diff int, abs int, coolDown time.Duration) Option

WithMemRule set the memory rule options.

func WithMonitorInterval

func WithMonitorInterval(interval time.Duration) Option

WithMonitorInterval set: interval

func WithSavePath

func WithSavePath(dumpPath string) Option

WithSavePath set the profile export path

type RuleType

type RuleType uint8
const (
	RuleHistoryLessMin RuleType = iota
	RuleCurlGreaterMin
	RuleCurGreaterAbs
	RuleDiff
)

type Sherlock

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

func New

func New(opts ...Option) *Sherlock

New creates a sherlock dumper.

func (*Sherlock) DisableCPUDump

func (s *Sherlock) DisableCPUDump()

DisableCPUDump disables the cpu dump.

func (*Sherlock) DisableGrtDump

func (s *Sherlock) DisableGrtDump()

DisableGrtDump disables the goroutine dump.

func (*Sherlock) DisableMemDump

func (s *Sherlock) DisableMemDump()

DisableMemDump disables the mem dump.

func (*Sherlock) EnableCPUDump

func (s *Sherlock) EnableCPUDump()

EnableCPUDump enables the cpu dump.

func (*Sherlock) EnableGrtDump

func (s *Sherlock) EnableGrtDump()

EnableGrtDump enables the goroutine dump.

func (*Sherlock) EnableMemDump

func (s *Sherlock) EnableMemDump()

EnableMemDump enables the mem dump.

func (*Sherlock) Set

func (s *Sherlock) Set(opts ...Option)

Set sets sherlock's optional after initialing.

func (*Sherlock) Start

func (s *Sherlock) Start()

Start starts the dump loop of sherlock.

func (*Sherlock) Stop

func (s *Sherlock) Stop()

Stop the dump loop of sherlock.

Jump to

Keyboard shortcuts

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