metrics

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 30

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"
	LblScope           = "scope"
	LblInternal        = "internal"
	LblGeneral         = "general"
)

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.HistogramVec
	TiKVTxnWriteSizeHistogram                *prometheus.HistogramVec
	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
	TiKVBatchClientUnavailable               prometheus.Histogram
	TiKVBatchClientWaitEstablish             prometheus.Histogram
	TiKVBatchClientRecycle                   prometheus.Histogram
	TiKVBatchRecvLatency                     *prometheus.HistogramVec
	TiKVRangeTaskStats                       *prometheus.GaugeVec
	TiKVRangeTaskPushDuration                *prometheus.HistogramVec
	TiKVTokenWaitDuration                    prometheus.Histogram
	TiKVTxnHeartBeatHistogram                *prometheus.HistogramVec
	TiKVTTLManagerHistogram                  prometheus.Histogram
	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
	TiKVAggressiveLockedKeysCounter          *prometheus.CounterVec
	TiKVStoreSlowScoreGauge                  *prometheus.GaugeVec
	TiKVPreferLeaderFlowsGauge               *prometheus.GaugeVec
)

Client metrics.

View Source
var (
	TxnCmdHistogramWithCommitInternal   prometheus.Observer
	TxnCmdHistogramWithCommitGeneral    prometheus.Observer
	TxnCmdHistogramWithRollbackInternal prometheus.Observer
	TxnCmdHistogramWithRollbackGeneral  prometheus.Observer
	TxnCmdHistogramWithBatchGetInternal prometheus.Observer
	TxnCmdHistogramWithBatchGetGeneral  prometheus.Observer
	TxnCmdHistogramWithGetInternal      prometheus.Observer
	TxnCmdHistogramWithGetGeneral       prometheus.Observer
	TxnCmdHistogramWithLockKeysInternal prometheus.Observer
	TxnCmdHistogramWithLockKeysGeneral  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

	TxnRegionsNumHistogramWithSnapshotInternal         prometheus.Observer
	TxnRegionsNumHistogramWithSnapshot                 prometheus.Observer
	TxnRegionsNumHistogramPrewriteInternal             prometheus.Observer
	TxnRegionsNumHistogramPrewrite                     prometheus.Observer
	TxnRegionsNumHistogramCommitInternal               prometheus.Observer
	TxnRegionsNumHistogramCommit                       prometheus.Observer
	TxnRegionsNumHistogramCleanupInternal              prometheus.Observer
	TxnRegionsNumHistogramCleanup                      prometheus.Observer
	TxnRegionsNumHistogramPessimisticLockInternal      prometheus.Observer
	TxnRegionsNumHistogramPessimisticLock              prometheus.Observer
	TxnRegionsNumHistogramPessimisticRollbackInternal  prometheus.Observer
	TxnRegionsNumHistogramPessimisticRollback          prometheus.Observer
	TxnRegionsNumHistogramWithCoprocessorInternal      prometheus.Observer
	TxnRegionsNumHistogramWithCoprocessor              prometheus.Observer
	TxnRegionsNumHistogramWithBatchCoprocessorInternal prometheus.Observer
	TxnRegionsNumHistogramWithBatchCoprocessor         prometheus.Observer

	TxnWriteKVCountHistogramInternal prometheus.Observer
	TxnWriteKVCountHistogramGeneral  prometheus.Observer
	TxnWriteSizeHistogramInternal    prometheus.Observer
	TxnWriteSizeHistogramGeneral     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

	AggressiveLockedKeysNew                prometheus.Counter
	AggressiveLockedKeysDerived            prometheus.Counter
	AggressiveLockedKeysLockedWithConflict prometheus.Counter
	AggressiveLockedKeysNonForceLock       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

func ObserveReadSLI(readKeys uint64, readTime float64, readSize float64)

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

Sub returns the difference of two counters.

Jump to

Keyboard shortcuts

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