Documentation ¶
Index ¶
Constants ¶
View Source
const ( LblType = "type" LblResult = "result" LblStore = "store" LblCommit = "commit" LblAbort = "abort" LblRollback = "rollback" LblBatchGet = "batch_get" LblGet = "get" LblLockKeys = "lock_keys" LabelBatchRecvLoop = "batch-recv-loop" LabelBatchSendLoop = "batch-send-loop" LblAddress = "address" LblFromStore = "from_store" LblToStore = "to_store" LblStaleRead = "stale_read" LblSource = "source" )
Label constants.
Variables ¶
View Source
var ( TiKVTxnCmdHistogram *prometheus.HistogramVec TiKVBackoffHistogram *prometheus.HistogramVec TiKVSendReqHistogram *prometheus.HistogramVec TiKVSendReqCounter *prometheus.CounterVec TiKVSendReqTimeCounter *prometheus.CounterVec TiKVRPCNetLatencyHistogram *prometheus.HistogramVec TiKVCoprocessorHistogram *prometheus.HistogramVec TiKVLockResolverCounter *prometheus.CounterVec TiKVRegionErrorCounter *prometheus.CounterVec TiKVTxnWriteKVCountHistogram prometheus.Histogram TiKVTxnWriteSizeHistogram prometheus.Histogram TiKVRawkvCmdHistogram *prometheus.HistogramVec TiKVRawkvSizeHistogram *prometheus.HistogramVec TiKVTxnRegionsNumHistogram *prometheus.HistogramVec TiKVLoadSafepointCounter *prometheus.CounterVec TiKVSecondaryLockCleanupFailureCounter *prometheus.CounterVec TiKVRegionCacheCounter *prometheus.CounterVec TiKVLoadRegionCacheHistogram *prometheus.HistogramVec TiKVLocalLatchWaitTimeHistogram prometheus.Histogram TiKVStatusDuration *prometheus.HistogramVec TiKVStatusCounter *prometheus.CounterVec TiKVBatchWaitDuration prometheus.Histogram TiKVBatchSendLatency prometheus.Histogram TiKVBatchWaitOverLoad prometheus.Counter TiKVBatchPendingRequests *prometheus.HistogramVec TiKVBatchRequests *prometheus.HistogramVec TiKVBatchClientWaitEstablish prometheus.Histogram TiKVBatchClientRecycle prometheus.Histogram TiKVBatchRecvLatency *prometheus.HistogramVec TiKVRangeTaskStats *prometheus.GaugeVec TiKVRangeTaskPushDuration *prometheus.HistogramVec TiKVTokenWaitDuration prometheus.Histogram TiKVTxnHeartBeatHistogram *prometheus.HistogramVec TiKVPessimisticLockKeysDuration prometheus.Histogram TiKVTTLLifeTimeReachCounter prometheus.Counter TiKVNoAvailableConnectionCounter prometheus.Counter TiKVTwoPCTxnCounter *prometheus.CounterVec TiKVAsyncCommitTxnCounter *prometheus.CounterVec TiKVOnePCTxnCounter *prometheus.CounterVec TiKVStoreLimitErrorCounter *prometheus.CounterVec TiKVGRPCConnTransientFailureCounter *prometheus.CounterVec TiKVPanicCounter *prometheus.CounterVec TiKVForwardRequestCounter *prometheus.CounterVec TiKVTSFutureWaitDuration prometheus.Histogram TiKVSafeTSUpdateCounter *prometheus.CounterVec TiKVMinSafeTSGapSeconds *prometheus.GaugeVec TiKVReplicaSelectorFailureCounter *prometheus.CounterVec TiKVRequestRetryTimesHistogram prometheus.Histogram TiKVTxnCommitBackoffSeconds prometheus.Histogram TiKVTxnCommitBackoffCount prometheus.Histogram TiKVSmallReadDuration prometheus.Histogram TiKVReadThroughput prometheus.Histogram TiKVUnsafeDestroyRangeFailuresCounterVec *prometheus.CounterVec TiKVPrewriteAssertionUsageCounter *prometheus.CounterVec TiKVGrpcConnectionState *prometheus.GaugeVec )
Client metrics.
View Source
var ( TxnCmdHistogramWithCommit prometheus.Observer TxnCmdHistogramWithRollback prometheus.Observer TxnCmdHistogramWithBatchGet prometheus.Observer TxnCmdHistogramWithGet prometheus.Observer TxnCmdHistogramWithLockKeys prometheus.Observer RawkvCmdHistogramWithGet prometheus.Observer RawkvCmdHistogramWithBatchGet prometheus.Observer RawkvCmdHistogramWithBatchPut prometheus.Observer RawkvCmdHistogramWithDelete prometheus.Observer RawkvCmdHistogramWithBatchDelete prometheus.Observer RawkvCmdHistogramWithRawScan prometheus.Observer RawkvCmdHistogramWithRawReversScan prometheus.Observer RawkvSizeHistogramWithKey prometheus.Observer RawkvSizeHistogramWithValue prometheus.Observer RawkvCmdHistogramWithRawChecksum prometheus.Observer BackoffHistogramRPC prometheus.Observer BackoffHistogramLock prometheus.Observer BackoffHistogramLockFast prometheus.Observer BackoffHistogramPD prometheus.Observer BackoffHistogramRegionMiss prometheus.Observer BackoffHistogramRegionScheduling prometheus.Observer BackoffHistogramServerBusy prometheus.Observer BackoffHistogramTiKVDiskFull prometheus.Observer BackoffHistogramRegionRecoveryInProgress prometheus.Observer BackoffHistogramStaleCmd prometheus.Observer BackoffHistogramDataNotReady prometheus.Observer BackoffHistogramIsWitness prometheus.Observer BackoffHistogramEmpty prometheus.Observer TxnRegionsNumHistogramWithSnapshot prometheus.Observer TxnRegionsNumHistogramPrewrite prometheus.Observer TxnRegionsNumHistogramCommit prometheus.Observer TxnRegionsNumHistogramCleanup prometheus.Observer TxnRegionsNumHistogramPessimisticLock prometheus.Observer TxnRegionsNumHistogramPessimisticRollback prometheus.Observer TxnRegionsNumHistogramWithCoprocessor prometheus.Observer TxnRegionsNumHistogramWithBatchCoprocessor prometheus.Observer LockResolverCountWithBatchResolve prometheus.Counter LockResolverCountWithExpired prometheus.Counter LockResolverCountWithNotExpired prometheus.Counter LockResolverCountWithWaitExpired prometheus.Counter LockResolverCountWithResolve prometheus.Counter LockResolverCountWithResolveForWrite prometheus.Counter LockResolverCountWithResolveAsync prometheus.Counter LockResolverCountWithWriteConflict prometheus.Counter LockResolverCountWithQueryTxnStatus prometheus.Counter LockResolverCountWithQueryTxnStatusCommitted prometheus.Counter LockResolverCountWithQueryTxnStatusRolledBack prometheus.Counter LockResolverCountWithQueryCheckSecondaryLocks prometheus.Counter LockResolverCountWithResolveLocks prometheus.Counter LockResolverCountWithResolveLockLite prometheus.Counter RegionCacheCounterWithInvalidateRegionFromCacheOK prometheus.Counter RegionCacheCounterWithSendFail prometheus.Counter RegionCacheCounterWithGetRegionByIDOK prometheus.Counter RegionCacheCounterWithGetRegionByIDError prometheus.Counter RegionCacheCounterWithGetCacheMissOK prometheus.Counter RegionCacheCounterWithGetCacheMissError prometheus.Counter RegionCacheCounterWithScanRegionsOK prometheus.Counter RegionCacheCounterWithScanRegionsError prometheus.Counter RegionCacheCounterWithGetStoreOK prometheus.Counter RegionCacheCounterWithGetStoreError prometheus.Counter RegionCacheCounterWithInvalidateStoreRegionsOK prometheus.Counter LoadRegionCacheHistogramWhenCacheMiss prometheus.Observer LoadRegionCacheHistogramWithRegions prometheus.Observer LoadRegionCacheHistogramWithRegionByID prometheus.Observer LoadRegionCacheHistogramWithGetStore prometheus.Observer TxnHeartBeatHistogramOK prometheus.Observer TxnHeartBeatHistogramError prometheus.Observer StatusCountWithOK prometheus.Counter StatusCountWithError prometheus.Counter SecondaryLockCleanupFailureCounterCommit prometheus.Counter SecondaryLockCleanupFailureCounterRollback prometheus.Counter TwoPCTxnCounterOk prometheus.Counter TwoPCTxnCounterError prometheus.Counter AsyncCommitTxnCounterOk prometheus.Counter AsyncCommitTxnCounterError prometheus.Counter OnePCTxnCounterOk prometheus.Counter OnePCTxnCounterError prometheus.Counter OnePCTxnCounterFallback prometheus.Counter BatchRecvHistogramOK prometheus.Observer BatchRecvHistogramError prometheus.Observer PrewriteAssertionUsageCounterNone prometheus.Counter PrewriteAssertionUsageCounterExist prometheus.Counter PrewriteAssertionUsageCounterNotExist prometheus.Counter PrewriteAssertionUsageCounterUnknown prometheus.Counter )
Shortcuts for performance improvement.
Functions ¶
func InitMetrics ¶
func InitMetrics(namespace, subsystem string)
InitMetrics initializes metrics variables with given namespace and subsystem name.
func ObserveReadSLI ¶
ObserveReadSLI observes the read SLI metric.
func RegisterMetrics ¶
func RegisterMetrics()
RegisterMetrics registers all metrics variables. Note: to change default namespace and subsystem name, call `InitMetrics` before registering.
Types ¶
type TxnCommitCounter ¶
type TxnCommitCounter struct { TwoPC int64 `json:"twoPC"` AsyncCommit int64 `json:"asyncCommit"` OnePC int64 `json:"onePC"` }
TxnCommitCounter is the counter of transactions committed with different protocols, i.e. 2PC, async-commit, 1PC.
func GetTxnCommitCounter ¶
func GetTxnCommitCounter() TxnCommitCounter
GetTxnCommitCounter gets the TxnCommitCounter.
func (TxnCommitCounter) Sub ¶
func (c TxnCommitCounter) Sub(rhs TxnCommitCounter) TxnCommitCounter
Sub returns the difference of two counters.
Click to show internal directories.
Click to hide internal directories.