ppcpuusage

package
v1.1.0-beta.0...-0ffac36 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUUsages

type CPUUsages struct {
	TidbCPUTime time.Duration
	TikvCPUTime time.Duration
}

CPUUsages records tidb/tikv cpu usages

func (*CPUUsages) Reset

func (c *CPUUsages) Reset()

Reset resets all cpu times to 0

type SQLCPUUsages

type SQLCPUUsages struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SQLCPUUsages is used to record sqlID and its cpu usages

func (*SQLCPUUsages) AllocNewSQLID

func (c *SQLCPUUsages) AllocNewSQLID() uint64

AllocNewSQLID alloc new ID, will restart from 0 when exceeds uint64 max limit

func (*SQLCPUUsages) GetCPUUsages

func (c *SQLCPUUsages) GetCPUUsages() CPUUsages

GetCPUUsages returns tidbCPU, tikvCPU time

func (*SQLCPUUsages) MergeTidbCPUTime

func (c *SQLCPUUsages) MergeTidbCPUTime(sqlID uint64, d time.Duration)

MergeTidbCPUTime merges tidbCPU time into self when sqlID matches Checks sqlID here, because tidb cpu time can only be collected by profiler now, and updated in concurrent goroutines

func (*SQLCPUUsages) MergeTikvCPUTime

func (c *SQLCPUUsages) MergeTikvCPUTime(d time.Duration)

MergeTikvCPUTime merges tikvCPU time into self. Doesn't need to check sqlID here, because tikv cpu time is updated in executors now.

func (*SQLCPUUsages) ResetCPUTimes

func (c *SQLCPUUsages) ResetCPUTimes()

ResetCPUTimes resets tidb/tikv cpu times to 0

func (*SQLCPUUsages) SetCPUUsages

func (c *SQLCPUUsages) SetCPUUsages(usage CPUUsages)

SetCPUUsages sets cpu usages value

Jump to

Keyboard shortcuts

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