Documentation ¶
Index ¶
- Variables
- func EnableWindowAggregator(window int)
- func RegisterTag(tag string, receiveChan chan *DataSetAggregate)
- func StartCPUProfiler(ctx context.Context, window time.Duration) error
- func UnRegisterTag(tag string)
- func WebProfile(addr string)
- type Aggregator
- type Collector
- type DataSetAggregate
- type DataSetAggregateMap
- type LabelValueTime
- type ProfileConsumer
- type ProfileData
- type WindowAggregator
Constants ¶
This section is empty.
Variables ¶
View Source
var DefProfileDuration = time.Second
DefProfileDuration exports for testing.
Functions ¶
func EnableWindowAggregator ¶ added in v1.0.3
func EnableWindowAggregator(window int)
func RegisterTag ¶
func RegisterTag(tag string, receiveChan chan *DataSetAggregate)
func StartCPUProfiler ¶
StartProfiler uses to start to run the global cpuProfiler and global aggregater
func UnRegisterTag ¶
func UnRegisterTag(tag string)
func WebProfile ¶
func WebProfile(addr string)
Types ¶
type Aggregator ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector is a cpu profile collector, it collect cpu profile data from globalCPUProfiler.
func NewCollector ¶
func NewCollector() *Collector
func (*Collector) StartCPUProfile ¶
StartCPUProfile is a substitute for the `pprof.StartCPUProfile` function. You should use this function instead of `pprof.StartCPUProfile`. Otherwise you may fail, or affect the TopSQL feature and pprof profile HTTP API . WARN: this function is not thread-safe.
func (*Collector) StopCPUProfile ¶
StopCPUProfile is a substitute for the `pprof.StopCPUProfile` function. WARN: this function is not thread-safe.
type DataSetAggregate ¶
type DataSetAggregateMap ¶ added in v1.0.3
type DataSetAggregateMap map[string]*DataSetAggregate
func GetWindowData ¶ added in v1.0.3
func GetWindowData() DataSetAggregateMap
func (DataSetAggregateMap) TopN ¶ added in v1.0.3
func (da DataSetAggregateMap) TopN(num int) []LabelValueTime
func (DataSetAggregateMap) TopNWithLabel ¶ added in v1.0.3
func (da DataSetAggregateMap) TopNWithLabel(num int, label string) []LabelValueTime
type LabelValueTime ¶ added in v1.0.3
type ProfileConsumer ¶
type ProfileConsumer = chan *ProfileData
type ProfileData ¶
type WindowAggregator ¶ added in v1.0.3
Click to show internal directories.
Click to hide internal directories.