metrics

package
v3.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

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"
)

Label constants.

Variables

View Source
var (
	TiKVTxnCmdHistogram                      *prometheus.HistogramVec
	TiKVBackoffHistogram                     *prometheus.HistogramVec
	TiKVSendReqHistogram                     *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
	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
	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
)

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

	BackoffHistogramRPC              prometheus.Observer
	BackoffHistogramLock             prometheus.Observer
	BackoffHistogramLockFast         prometheus.Observer
	BackoffHistogramPD               prometheus.Observer
	BackoffHistogramRegionMiss       prometheus.Observer
	BackoffHistogramRegionScheduling prometheus.Observer
	BackoffHistogramServerBusy       prometheus.Observer
	BackoffHistogramTiKVDiskFull     prometheus.Observer
	BackoffHistogramStaleCmd         prometheus.Observer
	BackoffHistogramDataNotReady     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
	RegionCacheCounterWithGetRegionOK                 prometheus.Counter
	RegionCacheCounterWithGetRegionError              prometheus.Counter
	RegionCacheCounterWithScanRegionsOK               prometheus.Counter
	RegionCacheCounterWithScanRegionsError            prometheus.Counter
	RegionCacheCounterWithGetStoreOK                  prometheus.Counter
	RegionCacheCounterWithGetStoreError               prometheus.Counter
	RegionCacheCounterWithInvalidateStoreRegionsOK    prometheus.Counter

	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

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