tidb: github.com/pingcap/tidb/util/execdetails Index | Files

package execdetails

import "github.com/pingcap/tidb/util/execdetails"


Package Files



const (
    // CopTimeStr represents the sum of cop-task time spend in TiDB distSQL.
    CopTimeStr = "Cop_time"
    // ProcessTimeStr represents the sum of process time of all the coprocessor tasks.
    ProcessTimeStr = "Process_time"
    // WaitTimeStr means the time of all coprocessor wait.
    WaitTimeStr = "Wait_time"
    // BackoffTimeStr means the time of all back-off.
    BackoffTimeStr = "Backoff_time"
    // LockKeysTimeStr means the time interval between pessimistic lock wait start and lock got obtain
    LockKeysTimeStr = "LockKeys_time"
    // RequestCountStr means the request count.
    RequestCountStr = "Request_count"
    // TotalKeysStr means the total scan keys.
    TotalKeysStr = "Total_keys"
    // ProcessKeysStr means the total processed keys.
    ProcessKeysStr = "Process_keys"
    // PreWriteTimeStr means the time of pre-write.
    PreWriteTimeStr = "Prewrite_time"
    // WaitPrewriteBinlogTimeStr means the time of waiting prewrite binlog finished when transaction committing.
    WaitPrewriteBinlogTimeStr = "Wait_prewrite_binlog_time"
    // CommitTimeStr means the time of commit.
    CommitTimeStr = "Commit_time"
    // GetCommitTSTimeStr means the time of getting commit ts.
    GetCommitTSTimeStr = "Get_commit_ts_time"
    // CommitBackoffTimeStr means the time of commit backoff.
    CommitBackoffTimeStr = "Commit_backoff_time"
    // BackoffTypesStr means the backoff type.
    BackoffTypesStr = "Backoff_types"
    // ResolveLockTimeStr means the time of resolving lock.
    ResolveLockTimeStr = "Resolve_lock_time"
    // LocalLatchWaitTimeStr means the time of waiting in local latch.
    LocalLatchWaitTimeStr = "Local_latch_wait_time"
    // WriteKeysStr means the count of keys in the transaction.
    WriteKeysStr = "Write_keys"
    // WriteSizeStr means the key/value size in the transaction.
    WriteSizeStr = "Write_size"
    // PrewriteRegionStr means the count of region when pre-write.
    PrewriteRegionStr = "Prewrite_region"
    // TxnRetryStr means the count of transaction retry.
    TxnRetryStr = "Txn_retry"


var CommitDetailCtxKey = commitDetailCtxKeyType{}

CommitDetailCtxKey presents CommitDetail info key in context.

type CommitDetails Uses

type CommitDetails struct {
    GetCommitTsTime        time.Duration
    PrewriteTime           time.Duration
    WaitPrewriteBinlogTime time.Duration
    CommitTime             time.Duration
    LocalLatchTime         time.Duration
    CommitBackoffTime      int64
    Mu                     struct {
        BackoffTypes []fmt.Stringer
    ResolveLockTime   int64
    WriteKeys         int
    WriteSize         int
    PrewriteRegionNum int32
    TxnRetry          int

CommitDetails contains commit detail information.

type ConcurrencyInfo Uses

type ConcurrencyInfo struct {
    // contains filtered or unexported fields

ConcurrencyInfo is used to save the concurrency information of the executor operator

func NewConcurrencyInfo Uses

func NewConcurrencyInfo(name string, num int) *ConcurrencyInfo

NewConcurrencyInfo creates new executor's concurrencyInfo.

type CopRuntimeStats Uses

type CopRuntimeStats struct {
    // contains filtered or unexported fields

CopRuntimeStats collects cop tasks' execution info.

func (*CopRuntimeStats) GetActRows Uses

func (crs *CopRuntimeStats) GetActRows() (totalRows int64)

GetActRows return total rows of CopRuntimeStats.

func (*CopRuntimeStats) RecordOneCopTask Uses

func (crs *CopRuntimeStats) RecordOneCopTask(address string, summary *tipb.ExecutorExecutionSummary)

RecordOneCopTask records a specific cop tasks's execution detail.

func (*CopRuntimeStats) String Uses

func (crs *CopRuntimeStats) String() string

type ExecDetails Uses

type ExecDetails struct {
    CalleeAddress    string
    CopTime          time.Duration
    ProcessTime      time.Duration
    WaitTime         time.Duration
    BackoffTime      time.Duration
    LockKeysDuration time.Duration
    BackoffSleep     map[string]time.Duration
    BackoffTimes     map[string]int
    RequestCount     int
    TotalKeys        int64
    ProcessedKeys    int64
    CommitDetail     *CommitDetails

ExecDetails contains execution detail information.

func (ExecDetails) String Uses

func (d ExecDetails) String() string

String implements the fmt.Stringer interface.

func (ExecDetails) ToZapFields Uses

func (d ExecDetails) ToZapFields() (fields []zap.Field)

ToZapFields wraps the ExecDetails as zap.Fields.

type ReaderRuntimeStats Uses

type ReaderRuntimeStats struct {
    // contains filtered or unexported fields

ReaderRuntimeStats collects stats for TableReader, IndexReader and IndexLookupReader

func (*ReaderRuntimeStats) String Uses

func (rrs *ReaderRuntimeStats) String() string

type RuntimeStats Uses

type RuntimeStats struct {
    // contains filtered or unexported fields

RuntimeStats collects one executor's execution info.

func (*RuntimeStats) GetActRows Uses

func (e *RuntimeStats) GetActRows() int64

GetActRows return rows of CopRuntimeStats.

func (*RuntimeStats) Record Uses

func (e *RuntimeStats) Record(d time.Duration, rowNum int)

Record records executor's execution.

func (*RuntimeStats) SetAdditionalInfo Uses

func (e *RuntimeStats) SetAdditionalInfo(info string)

SetAdditionalInfo sets the additional information.

func (*RuntimeStats) SetConcurrencyInfo Uses

func (e *RuntimeStats) SetConcurrencyInfo(infos ...*ConcurrencyInfo)

SetConcurrencyInfo sets the concurrency informations. We must clear the concurrencyInfo first when we call the SetConcurrencyInfo. When the num <= 0, it means the exector operator is not executed parallel.

func (*RuntimeStats) SetRowNum Uses

func (e *RuntimeStats) SetRowNum(rowNum int64)

SetRowNum sets the row num.

func (*RuntimeStats) String Uses

func (e *RuntimeStats) String() string

type RuntimeStatsColl Uses

type RuntimeStatsColl struct {
    // contains filtered or unexported fields

RuntimeStatsColl collects executors's execution info.

func NewRuntimeStatsColl Uses

func NewRuntimeStatsColl() *RuntimeStatsColl

NewRuntimeStatsColl creates new executor collector.

func (*RuntimeStatsColl) ExistsCopStats Uses

func (e *RuntimeStatsColl) ExistsCopStats(planID string) bool

ExistsCopStats checks if the planID exists in the copStats collection.

func (*RuntimeStatsColl) ExistsRootStats Uses

func (e *RuntimeStatsColl) ExistsRootStats(planID string) bool

ExistsRootStats checks if the planID exists in the rootStats collection.

func (*RuntimeStatsColl) GetCopStats Uses

func (e *RuntimeStatsColl) GetCopStats(planID string) *CopRuntimeStats

GetCopStats gets the CopRuntimeStats specified by planID.

func (*RuntimeStatsColl) GetReaderStats Uses

func (e *RuntimeStatsColl) GetReaderStats(planID string) *ReaderRuntimeStats

GetReaderStats gets the ReaderRuntimeStats specified by planID.

func (*RuntimeStatsColl) GetRootStats Uses

func (e *RuntimeStatsColl) GetRootStats(planID string) *RuntimeStats

GetRootStats gets execStat for a executor.

func (*RuntimeStatsColl) RecordOneCopTask Uses

func (e *RuntimeStatsColl) RecordOneCopTask(planID, address string, summary *tipb.ExecutorExecutionSummary)

RecordOneCopTask records a specific cop tasks's execution detail.

func (*RuntimeStatsColl) RecordOneReaderStats Uses

func (e *RuntimeStatsColl) RecordOneReaderStats(planID string, copRespTime time.Duration, detail *ExecDetails)

RecordOneReaderStats records a specific stats for TableReader, IndexReader and IndexLookupReader.

Package execdetails imports 9 packages (graph) and is imported by 87 packages. Updated 2020-05-30. Refresh now. Tools for package owners.