Documentation ¶
Index ¶
- Constants
- Variables
- func ExecuteErrorToLabel(err error) string
- func GenerateReorgLabel(label string, schemaName string, tableName string) string
- func GetBackfillProgressByLabel(label string, schemaName string, tableName string) prometheus.Gauge
- func GetLazyPessimisticUniqueCheckSetCounter() int64
- func GetSavepointStmtCounter() int64
- func InitBindInfoMetrics()
- func InitDDLMetrics()
- func InitDistSQLMetrics()
- func InitDomainMetrics()
- func InitExecutorMetrics()
- func InitGCWorkerMetrics()
- func InitLogBackupMetrics()
- func InitMetaMetrics()
- func InitMetrics()
- func InitOwnerMetrics()
- func InitResourceManagerMetrics()
- func InitServerMetrics()
- func InitSessionMetrics()
- func InitSliMetrics()
- func InitStatsMetrics()
- func InitTTLMetrics()
- func InitTelemetryMetrics()
- func InitTopSQLMetrics()
- func NewCounter(opts prometheus.CounterOpts) prometheus.Counter
- func NewCounterVec(opts prometheus.CounterOpts, labelNames []string) *prometheus.CounterVec
- func NewGauge(opts prometheus.GaugeOpts) prometheus.Gauge
- func NewGaugeVec(opts prometheus.GaugeOpts, labelNames []string) *prometheus.GaugeVec
- func NewHistogram(opts prometheus.HistogramOpts) prometheus.Histogram
- func NewHistogramVec(opts prometheus.HistogramOpts, labelNames []string) *prometheus.HistogramVec
- func NewSummaryVec(opts prometheus.SummaryOpts, labelNames []string) *prometheus.SummaryVec
- func RegisterMetrics()
- func RetLabel(err error) string
- func SetConstLabels(kv ...string)
- func ToggleSimplifiedMode(simplified bool)
- type AccountLockCounter
- type CTEUsageCounter
- type DDLUsageCounter
- type ExchangePartitionUsageCounter
- type FairLockingUsageCounter
- type IndexMergeUsageCounter
- type MultiSchemaChangeUsageCounter
- type NonTransactionalStmtCounter
- type StoreBatchCoprCounter
- type TablePartitionUsageCounter
Constants ¶
const ( LblAction = "action" LblAddIndex = "add_index" LblAddIndexMerge = "add_index_merge_tmp" LblModifyColumn = "modify_column" LblReorgPartition = "reorganize_partition" )
Label constants.
const ( LabelSession = "session" LabelDomain = "domain" LabelDDLOwner = "ddl-owner" LabelDDL = "ddl" LabelDDLWorker = "ddl-worker" LabelDistReorg = "dist-reorg" LabelDDLSyncer = "ddl-syncer" LabelGCWorker = "gcworker" LabelAnalyze = "analyze" LabelWorkerPool = "worker-pool" LabelBatchRecvLoop = "batch-recv-loop" LabelBatchSendLoop = "batch-send-loop" TiDB = "tidb" LabelScope = "scope" ScopeGlobal = "global" ScopeSession = "session" Server = "server" TiKVClient = "tikvclient" )
metrics labels.
const ( LblUnretryable = "unretryable" LblReachMax = "reach_max" LblOK = "ok" LblError = "error" LblCommit = "commit" LblAbort = "abort" LblRollback = "rollback" LblType = "type" LblDb = "db" LblResult = "result" LblSQLType = "sql_type" LblCoprType = "copr_type" LblGeneral = "general" LblInternal = "internal" LblTxnMode = "txn_mode" LblPessimistic = "pessimistic" LblOptimistic = "optimistic" LblStore = "store" LblAddress = "address" LblBatchGet = "batch_get" LblGet = "get" LblLockKeys = "lock_keys" LblInTxn = "in_txn" LblVersion = "version" LblHash = "hash" LblCTEType = "cte_type" LblAccountLock = "account_lock" LblIdle = "idle" LblRunning = "executing_sql" LblLockWaiting = "waiting_for_lock" LblCommitting = "committing" LblRollingBack = "rolling_back" LblHasLock = "has_lock" LblPhase = "phase" LblModule = "module" LblRCReadCheckTS = "read_check" LblRCWriteCheckTS = "write_check" LblName = "name" LblFairLockingTxnUsed = "txn-used" LblFairLockingTxnEffective = "txn-effective" LblFairLockingStmtUsed = "stmt-used" LblFairLockingStmtEffective = "stmt-effective" LblScope = "scope" )
Label constants.
Variables ¶
var ( BindUsageCounter *prometheus.CounterVec BindTotalGauge *prometheus.GaugeVec BindMemoryUsage *prometheus.GaugeVec )
bindinfo metrics.
var ( JobsGauge *prometheus.GaugeVec HandleJobHistogram *prometheus.HistogramVec BatchAddIdxHistogram *prometheus.HistogramVec SyncerInit = "init" SyncerRestart = "restart" SyncerClear = "clear" SyncerRewatch = "rewatch" StateSyncerInit = "init_global_state" DeploySyncerHistogram *prometheus.HistogramVec UpdateSelfVersionHistogram *prometheus.HistogramVec OwnerUpdateGlobalVersion = "update_global_version" OwnerCheckAllVersions = "check_all_versions" UpdateGlobalState = "update_global_state" OwnerHandleSyncerHistogram *prometheus.HistogramVec // Metrics for ddl_worker.go. WorkerNotifyDDLJob = "notify_job" WorkerAddDDLJob = "add_job" WorkerRunDDLJob = "run_job" WorkerFinishDDLJob = "finish_job" WorkerWaitSchemaChanged = "wait_schema_changed" DDLWorkerHistogram *prometheus.HistogramVec CreateDDLInstance = "create_ddl_instance" CreateDDL = "create_ddl" DDLOwner = "owner" DDLCounter *prometheus.CounterVec BackfillTotalCounter *prometheus.CounterVec BackfillProgressGauge *prometheus.GaugeVec DDLJobTableDuration *prometheus.HistogramVec DDLRunningJobCount *prometheus.GaugeVec )
Metrics for the DDL package.
var ( DistSQLQueryHistogram *prometheus.HistogramVec DistSQLScanKeysPartialHistogram prometheus.Histogram DistSQLScanKeysHistogram prometheus.Histogram DistSQLPartialCountHistogram prometheus.Histogram DistSQLCoprCacheCounter *prometheus.CounterVec DistSQLCoprClosestReadCounter *prometheus.CounterVec DistSQLCoprRespBodySize *prometheus.HistogramVec )
distsql metrics.
var ( // LoadSchemaCounter records the counter of load schema. LoadSchemaCounter *prometheus.CounterVec // LoadSchemaDuration records the duration of load schema. LoadSchemaDuration prometheus.Histogram // InfoCacheCounters are the counters of get/hit. InfoCacheCounters *prometheus.CounterVec // InfoCacheCounterGet is the total number of getting entry. InfoCacheCounterGet = "get" // InfoCacheCounterHit is the cache hit numbers for get. InfoCacheCounterHit = "hit" // LoadPrivilegeCounter records the counter of load privilege. LoadPrivilegeCounter *prometheus.CounterVec // LoadSysVarCacheCounter records the counter of loading sysvars LoadSysVarCacheCounter *prometheus.CounterVec SchemaValidatorStop = "stop" SchemaValidatorRestart = "restart" SchemaValidatorReset = "reset" SchemaValidatorCacheEmpty = "cache_empty" SchemaValidatorCacheMiss = "cache_miss" // HandleSchemaValidate records the counter of handling schema validate. HandleSchemaValidate *prometheus.CounterVec )
Metrics for the domain package.
var ( // ExecutorCounter records the number of expensive executors. ExecutorCounter *prometheus.CounterVec // StmtNodeCounter records the number of statement with the same type. StmtNodeCounter *prometheus.CounterVec // DbStmtNodeCounter records the number of statement with the same type and db. DbStmtNodeCounter *prometheus.CounterVec // ExecPhaseDuration records the duration of each execution phase. ExecPhaseDuration *prometheus.SummaryVec )
var ( GCWorkerCounter *prometheus.CounterVec GCHistogram *prometheus.HistogramVec GCConfigGauge *prometheus.GaugeVec GCJobFailureCounter *prometheus.CounterVec GCActionRegionResultCounter *prometheus.CounterVec GCRegionTooManyLocksCounter prometheus.Counter GCUnsafeDestroyRangeFailuresCounterVec *prometheus.CounterVec )
Metrics for the GC worker.
var ( LastCheckpoint *prometheus.GaugeVec AdvancerOwner prometheus.Gauge AdvancerTickDuration *prometheus.HistogramVec GetCheckpointBatchSize *prometheus.HistogramVec RegionCheckpointRequest *prometheus.CounterVec RegionCheckpointFailure *prometheus.CounterVec RegionCheckpointSubscriptionEvent *prometheus.HistogramVec )
log backup metrics. see the `Help` field for details.
var ( GlobalAutoID = "global" TableAutoIDAlloc = "alloc" TableAutoIDRebase = "rebase" AutoIDHistogram *prometheus.HistogramVec GetSchemaDiff = "get_schema_diff" SetSchemaDiff = "set_schema_diff" GetHistoryDDLJob = "get_history_ddl_job" MetaHistogram *prometheus.HistogramVec )
Metrics
var ( // PanicCounter measures the count of panics. PanicCounter *prometheus.CounterVec // MemoryUsage measures the usage gauge of memory. MemoryUsage *prometheus.GaugeVec )
var ( NewSessionHistogram *prometheus.HistogramVec WatcherClosed = "watcher_closed" Cancelled = "cancelled" Deleted = "deleted" PutValue = "put_value" SessionDone = "session_done" CtxDone = "context_done" WatchOwnerCounter *prometheus.CounterVec NoLongerOwner = "no_longer_owner" CampaignOwnerCounter *prometheus.CounterVec )
Metrics
var ( // EMACPUUsageGauge means exponential moving average of CPU usage EMACPUUsageGauge prometheus.Gauge // PoolConcurrencyCounter means how much concurrency in the pool PoolConcurrencyCounter *prometheus.GaugeVec )
var ( PacketIOCounter *prometheus.CounterVec QueryDurationHistogram *prometheus.HistogramVec QueryTotalCounter *prometheus.CounterVec AffectedRowsCounter *prometheus.CounterVec ConnGauge prometheus.Gauge DisconnectionCounter *prometheus.CounterVec PreparedStmtGauge prometheus.Gauge ExecuteErrorCounter *prometheus.CounterVec CriticalErrorCounter prometheus.Counter EventStart = "start" EventGracefulDown = "graceful_shutdown" // Eventkill occurs when the server.Kill() function is called. EventKill = "kill" EventClose = "close" ServerEventCounter *prometheus.CounterVec TimeJumpBackCounter prometheus.Counter PlanCacheCounter *prometheus.CounterVec PlanCacheMissCounter *prometheus.CounterVec PlanCacheInstanceMemoryUsage *prometheus.GaugeVec PlanCacheInstancePlanNumCounter *prometheus.GaugeVec ReadFromTableCacheCounter prometheus.Counter HandShakeErrorCounter prometheus.Counter GetTokenDurationHistogram prometheus.Histogram NumOfMultiQueryHistogram prometheus.Histogram TotalQueryProcHistogram *prometheus.HistogramVec TotalCopProcHistogram *prometheus.HistogramVec TotalCopWaitHistogram *prometheus.HistogramVec MaxProcs prometheus.Gauge GOGC prometheus.Gauge ConnIdleDurationHistogram *prometheus.HistogramVec ServerInfo *prometheus.GaugeVec TokenGauge prometheus.Gauge ConfigStatus *prometheus.GaugeVec TiFlashQueryTotalCounter *prometheus.CounterVec TiFlashFailedMPPStoreState *prometheus.GaugeVec PDAPIExecutionHistogram *prometheus.HistogramVec PDAPIRequestCounter *prometheus.CounterVec CPUProfileCounter prometheus.Counter LoadTableCacheDurationHistogram prometheus.Histogram RCCheckTSWriteConfilictCounter *prometheus.CounterVec )
Metrics
var ( AutoIDReqDuration prometheus.Histogram SessionExecuteParseDuration *prometheus.HistogramVec SessionExecuteCompileDuration *prometheus.HistogramVec SessionExecuteRunDuration *prometheus.HistogramVec SchemaLeaseErrorCounter *prometheus.CounterVec SessionRetry *prometheus.HistogramVec SessionRetryErrorCounter *prometheus.CounterVec SessionRestrictedSQLCounter prometheus.Counter StatementPerTransaction *prometheus.HistogramVec TransactionDuration *prometheus.HistogramVec StatementDeadlockDetectDuration prometheus.Histogram StatementPessimisticRetryCount prometheus.Histogram StatementLockKeysCount prometheus.Histogram ValidateReadTSFromPDCount prometheus.Counter NonTransactionalDMLCount *prometheus.CounterVec TxnStatusEnteringCounter *prometheus.CounterVec TxnDurationHistogram *prometheus.HistogramVec LazyPessimisticUniqueCheckSetCount prometheus.Counter PessimisticDMLDurationByAttempt *prometheus.HistogramVec ResourceGroupQueryTotalCounter *prometheus.CounterVec FairLockingUsageCount *prometheus.CounterVec )
Session metrics.
var ( // SmallTxnWriteDuration uses to collect small transaction write duration. SmallTxnWriteDuration prometheus.Histogram // TxnWriteThroughput uses to collect transaction write throughput which transaction is not small. TxnWriteThroughput prometheus.Histogram )
var ( AutoAnalyzeHistogram prometheus.Histogram AutoAnalyzeCounter *prometheus.CounterVec StatsInaccuracyRate prometheus.Histogram PseudoEstimation *prometheus.CounterVec DumpFeedbackCounter *prometheus.CounterVec UpdateStatsCounter *prometheus.CounterVec StoreQueryFeedbackCounter *prometheus.CounterVec SignificantFeedbackCounter prometheus.Counter FastAnalyzeHistogram *prometheus.HistogramVec SyncLoadCounter prometheus.Counter SyncLoadTimeoutCounter prometheus.Counter SyncLoadHistogram prometheus.Histogram ReadStatsHistogram prometheus.Histogram StatsCacheLRUCounter *prometheus.CounterVec StatsCacheLRUGauge *prometheus.GaugeVec StatsHealthyGauge *prometheus.GaugeVec HistoricalStatsCounter *prometheus.CounterVec PlanReplayerTaskCounter *prometheus.CounterVec PlanReplayerRegisterTaskGauge prometheus.Gauge )
Stats metrics.
var ( TelemetrySQLCTECnt *prometheus.CounterVec TelemetryMultiSchemaChangeCnt prometheus.Counter TelemetryTablePartitionCnt prometheus.Counter TelemetryTablePartitionListCnt prometheus.Counter TelemetryTablePartitionRangeCnt prometheus.Counter TelemetryTablePartitionHashCnt prometheus.Counter TelemetryTablePartitionRangeColumnsCnt prometheus.Counter TelemetryTablePartitionRangeColumnsGt1Cnt prometheus.Counter TelemetryTablePartitionRangeColumnsGt2Cnt prometheus.Counter TelemetryTablePartitionRangeColumnsGt3Cnt prometheus.Counter TelemetryTablePartitionListColumnsCnt prometheus.Counter TelemetryTablePartitionMaxPartitionsCnt prometheus.Counter TelemetryAccountLockCnt *prometheus.CounterVec TelemetryTablePartitionCreateIntervalPartitionsCnt prometheus.Counter TelemetryTablePartitionAddIntervalPartitionsCnt prometheus.Counter TelemetryTablePartitionDropIntervalPartitionsCnt prometheus.Counter TelemetryExchangePartitionCnt prometheus.Counter TelemetryAddIndexIngestCnt prometheus.Counter TelemetryFlashbackClusterCnt prometheus.Counter TelemetryIndexMergeUsage prometheus.Counter TelemetryCompactPartitionCnt prometheus.Counter TelemetryReorganizePartitionCnt prometheus.Counter TelemetryDistReorgCnt prometheus.Counter TelemetryStoreBatchedQueryCnt prometheus.Counter TelemetryBatchedQueryTaskCnt prometheus.Counter TelemetryStoreBatchedCnt prometheus.Counter TelemetryStoreBatchedFallbackCnt prometheus.Counter )
Metrics
var ( TopSQLIgnoredCounter *prometheus.CounterVec TopSQLReportDurationHistogram *prometheus.HistogramVec TopSQLReportDataHistogram *prometheus.HistogramVec )
Top SQL metrics.
var ( TTLQueryDuration *prometheus.HistogramVec TTLProcessedExpiredRowsCounter *prometheus.CounterVec TTLJobStatus *prometheus.GaugeVec TTLTaskStatus *prometheus.GaugeVec TTLPhaseTime *prometheus.CounterVec TTLInsertRowsCount prometheus.Counter TTLWatermarkDelay *prometheus.GaugeVec )
TTL metrics
var ( // ResettablePlanCacheCounterFortTest be used to support reset counter in test. ResettablePlanCacheCounterFortTest = false )
Functions ¶
func ExecuteErrorToLabel ¶
ExecuteErrorToLabel converts an execute error to label.
func GenerateReorgLabel ¶
GenerateReorgLabel returns the label with schema name and table name.
func GetBackfillProgressByLabel ¶
func GetBackfillProgressByLabel(label string, schemaName string, tableName string) prometheus.Gauge
GetBackfillProgressByLabel returns the Gauge showing the percentage progress for the given type label.
func GetLazyPessimisticUniqueCheckSetCounter ¶
func GetLazyPessimisticUniqueCheckSetCounter() int64
GetLazyPessimisticUniqueCheckSetCounter returns the counter of setting tidb_constraint_check_in_place_pessimistic to false.
func GetSavepointStmtCounter ¶
func GetSavepointStmtCounter() int64
GetSavepointStmtCounter gets the savepoint statement executed counter.
func InitBindInfoMetrics ¶
func InitBindInfoMetrics()
InitBindInfoMetrics initializes bindinfo metrics.
func InitExecutorMetrics ¶
func InitExecutorMetrics()
InitExecutorMetrics initializes excutor metrics.
func InitGCWorkerMetrics ¶
func InitGCWorkerMetrics()
InitGCWorkerMetrics initializes GC worker metrics.
func InitLogBackupMetrics ¶
func InitLogBackupMetrics()
InitLogBackupMetrics initializes log backup metrics.
func InitResourceManagerMetrics ¶
func InitResourceManagerMetrics()
InitResourceManagerMetrics initializes resource manager metrics.
func InitTelemetryMetrics ¶
func InitTelemetryMetrics()
InitTelemetryMetrics initializes telemetry metrics.
func NewCounter ¶
func NewCounter(opts prometheus.CounterOpts) prometheus.Counter
NewCounter wraps a prometheus.NewCounter.
func NewCounterVec ¶
func NewCounterVec(opts prometheus.CounterOpts, labelNames []string) *prometheus.CounterVec
NewCounterVec wraps a prometheus.NewCounterVec.
func NewGauge ¶
func NewGauge(opts prometheus.GaugeOpts) prometheus.Gauge
NewGauge wraps a prometheus.NewGauge.
func NewGaugeVec ¶
func NewGaugeVec(opts prometheus.GaugeOpts, labelNames []string) *prometheus.GaugeVec
NewGaugeVec wraps a prometheus.NewGaugeVec.
func NewHistogram ¶
func NewHistogram(opts prometheus.HistogramOpts) prometheus.Histogram
NewHistogram wraps a prometheus.NewHistogram.
func NewHistogramVec ¶
func NewHistogramVec(opts prometheus.HistogramOpts, labelNames []string) *prometheus.HistogramVec
NewHistogramVec wraps a prometheus.NewHistogramVec.
func NewSummaryVec ¶
func NewSummaryVec(opts prometheus.SummaryOpts, labelNames []string) *prometheus.SummaryVec
NewSummaryVec wraps a prometheus.NewSummaryVec.
func RegisterMetrics ¶
func RegisterMetrics()
RegisterMetrics registers the metrics which are ONLY used in TiDB server.
func RetLabel ¶
RetLabel returns "ok" when err == nil and "err" when err != nil. This could be useful when you need to observe the operation result.
func SetConstLabels ¶
func SetConstLabels(kv ...string)
SetConstLabels sets constant labels for metrics.
func ToggleSimplifiedMode ¶
func ToggleSimplifiedMode(simplified bool)
ToggleSimplifiedMode is used to register/unregister the metrics that unused by grafana.
Types ¶
type AccountLockCounter ¶
type AccountLockCounter struct { LockUser int64 `json:"lockUser"` UnlockUser int64 `json:"unlockUser"` CreateOrAlterUser int64 `json:"createOrAlterUser"` }
AccountLockCounter records the number of lock users/roles
func GetAccountLockCounter ¶
func GetAccountLockCounter() AccountLockCounter
GetAccountLockCounter gets the AccountLockCounter
func (AccountLockCounter) Sub ¶
func (c AccountLockCounter) Sub(rhs AccountLockCounter) AccountLockCounter
Sub returns the difference of two counters.
type CTEUsageCounter ¶
type CTEUsageCounter struct { NonRecursiveCTEUsed int64 `json:"nonRecursiveCTEUsed"` RecursiveUsed int64 `json:"recursiveUsed"` NonCTEUsed int64 `json:"nonCTEUsed"` }
CTEUsageCounter records the usages of CTE.
func (CTEUsageCounter) Sub ¶
func (c CTEUsageCounter) Sub(rhs CTEUsageCounter) CTEUsageCounter
Sub returns the difference of two counters.
type DDLUsageCounter ¶
type DDLUsageCounter struct { AddIndexIngestUsed int64 `json:"add_index_ingest_used"` MetadataLockUsed bool `json:"metadata_lock_used"` FlashbackClusterUsed int64 `json:"flashback_cluster_used"` DistReorgUsed int64 `json:"dist_reorg_used"` }
DDLUsageCounter records the usages of DDL related features.
func GetDDLUsageCounter ¶
func GetDDLUsageCounter() DDLUsageCounter
GetDDLUsageCounter gets the add index acceleration solution counts.
func (DDLUsageCounter) Sub ¶
func (a DDLUsageCounter) Sub(rhs DDLUsageCounter) DDLUsageCounter
Sub returns the difference of two counters.
type ExchangePartitionUsageCounter ¶
type ExchangePartitionUsageCounter struct {
ExchangePartitionCnt int64 `json:"exchange_partition_cnt"`
}
ExchangePartitionUsageCounter records the usages of exchange partition.
func GetExchangePartitionCounter ¶
func GetExchangePartitionCounter() ExchangePartitionUsageCounter
GetExchangePartitionCounter gets the TxnCommitCounter.
func (ExchangePartitionUsageCounter) Sub ¶
func (c ExchangePartitionUsageCounter) Sub(rhs ExchangePartitionUsageCounter) ExchangePartitionUsageCounter
Sub returns the difference of two counters.
type FairLockingUsageCounter ¶
type FairLockingUsageCounter struct { TxnFairLockingUsed int64 `json:"txn_fair_locking_used"` TxnFairLockingEffective int64 `json:"txn_fair_locking_effective"` }
FairLockingUsageCounter records the usage of Fair Locking feature of pessimistic transaction.
func GetFairLockingUsageCounter ¶
func GetFairLockingUsageCounter() FairLockingUsageCounter
GetFairLockingUsageCounter returns the Fair Locking usage counter.
func (FairLockingUsageCounter) Sub ¶
func (i FairLockingUsageCounter) Sub(rhs FairLockingUsageCounter) FairLockingUsageCounter
Sub returns the difference of two counters.
type IndexMergeUsageCounter ¶
type IndexMergeUsageCounter struct {
IndexMergeUsed int64 `json:"index_merge_used"`
}
IndexMergeUsageCounter records the usages of IndexMerge feature.
func GetIndexMergeCounter ¶
func GetIndexMergeCounter() IndexMergeUsageCounter
GetIndexMergeCounter gets the IndexMerge usage counter.
func (IndexMergeUsageCounter) Sub ¶
func (i IndexMergeUsageCounter) Sub(rhs IndexMergeUsageCounter) IndexMergeUsageCounter
Sub returns the difference of two counters.
type MultiSchemaChangeUsageCounter ¶
type MultiSchemaChangeUsageCounter struct {
MultiSchemaChangeUsed int64 `json:"multi_schema_change_used"`
}
MultiSchemaChangeUsageCounter records the usages of multi-schema change.
func GetMultiSchemaCounter ¶
func GetMultiSchemaCounter() MultiSchemaChangeUsageCounter
GetMultiSchemaCounter gets the TxnCommitCounter.
func (MultiSchemaChangeUsageCounter) Sub ¶
func (c MultiSchemaChangeUsageCounter) Sub(rhs MultiSchemaChangeUsageCounter) MultiSchemaChangeUsageCounter
Sub returns the difference of two counters.
type NonTransactionalStmtCounter ¶
type NonTransactionalStmtCounter struct { DeleteCount int64 `json:"delete"` UpdateCount int64 `json:"update"` InsertCount int64 `json:"insert"` }
NonTransactionalStmtCounter records the usages of non-transactional statements.
func GetNonTransactionalStmtCounter ¶
func GetNonTransactionalStmtCounter() NonTransactionalStmtCounter
GetNonTransactionalStmtCounter gets the NonTransactionalStmtCounter.
func (NonTransactionalStmtCounter) Sub ¶
func (n NonTransactionalStmtCounter) Sub(rhs NonTransactionalStmtCounter) NonTransactionalStmtCounter
Sub returns the difference of two counters.
type StoreBatchCoprCounter ¶
type StoreBatchCoprCounter struct { // BatchSize is the global value of `tidb_store_batch_size` BatchSize int `json:"batch_size"` // BatchedQuery is the counter of queries that use this feature. BatchedQuery int64 `json:"query"` // BatchedQueryTask is the counter of total tasks in queries above. BatchedQueryTask int64 `json:"tasks"` // BatchedCount is the counter of successfully batched tasks. BatchedCount int64 `json:"batched"` // BatchedFallbackCount is the counter of fallback batched tasks by region miss. BatchedFallbackCount int64 `json:"batched_fallback"` }
StoreBatchCoprCounter records the usages of batch copr statements.
func GetStoreBatchCoprCounter ¶
func GetStoreBatchCoprCounter() StoreBatchCoprCounter
GetStoreBatchCoprCounter gets the IndexMerge usage counter.
func (StoreBatchCoprCounter) Sub ¶
func (n StoreBatchCoprCounter) Sub(rhs StoreBatchCoprCounter) StoreBatchCoprCounter
Sub returns the difference of two counters.
type TablePartitionUsageCounter ¶
type TablePartitionUsageCounter struct { TablePartitionCnt int64 `json:"table_partition_cnt"` TablePartitionListCnt int64 `json:"table_partition_list_cnt"` TablePartitionRangeCnt int64 `json:"table_partition_range_cnt"` TablePartitionHashCnt int64 `json:"table_partition_hash_cnt"` TablePartitionRangeColumnsCnt int64 `json:"table_partition_range_columns_cnt"` TablePartitionRangeColumnsGt1Cnt int64 `json:"table_partition_range_columns_gt_1_cnt"` TablePartitionRangeColumnsGt2Cnt int64 `json:"table_partition_range_columns_gt_2_cnt"` TablePartitionRangeColumnsGt3Cnt int64 `json:"table_partition_range_columns_gt_3_cnt"` TablePartitionListColumnsCnt int64 `json:"table_partition_list_columns_cnt"` TablePartitionMaxPartitionsCnt int64 `json:"table_partition_max_partitions_cnt"` TablePartitionCreateIntervalPartitionsCnt int64 `json:"table_partition_create_interval_partitions_cnt"` TablePartitionAddIntervalPartitionsCnt int64 `json:"table_partition_add_interval_partitions_cnt"` TablePartitionDropIntervalPartitionsCnt int64 `json:"table_partition_drop_interval_partitions_cnt"` TablePartitionComactCnt int64 `json:"table_TablePartitionComactCnt"` TablePartitionReorganizePartitionCnt int64 `json:"table_reorganize_partition_cnt"` }
TablePartitionUsageCounter records the usages of table partition.
func GetTablePartitionCounter ¶
func GetTablePartitionCounter() TablePartitionUsageCounter
GetTablePartitionCounter gets the TxnCommitCounter.
func ResetTablePartitionCounter ¶
func ResetTablePartitionCounter(pre TablePartitionUsageCounter) TablePartitionUsageCounter
ResetTablePartitionCounter gets the TxnCommitCounter.
func (TablePartitionUsageCounter) Cal ¶
func (c TablePartitionUsageCounter) Cal(rhs TablePartitionUsageCounter) TablePartitionUsageCounter
Cal returns the difference of two counters.