sli

package
v1.1.0-beta.0...-1521bf7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TxnWriteThroughputSLI

type TxnWriteThroughputSLI struct {
	// contains filtered or unexported fields
}

TxnWriteThroughputSLI uses to report transaction write throughput metrics for SLI.

func (*TxnWriteThroughputSLI) AddReadKeys

func (t *TxnWriteThroughputSLI) AddReadKeys(readKeys int64)

AddReadKeys adds the read keys.

func (*TxnWriteThroughputSLI) AddTxnWriteSize

func (t *TxnWriteThroughputSLI) AddTxnWriteSize(size, keys int)

AddTxnWriteSize adds the transaction write size and keys.

func (*TxnWriteThroughputSLI) FinishExecuteStmt

func (t *TxnWriteThroughputSLI) FinishExecuteStmt(cost time.Duration, affectRow uint64, inTxn bool)

FinishExecuteStmt records the cost for write statement which affect rows more than 0. And report metrics when the transaction is committed.

func (*TxnWriteThroughputSLI) IsInvalid

func (t *TxnWriteThroughputSLI) IsInvalid() bool

IsInvalid checks the transaction is valid to report SLI metrics. Currently, the following case will cause invalid: 1. The transaction contains `insert|replace into ... select ... from ...` statement. 2. The write SQL statement has more read keys than write keys.

func (*TxnWriteThroughputSLI) IsSmallTxn

func (t *TxnWriteThroughputSLI) IsSmallTxn() bool

IsSmallTxn exports for testing.

func (*TxnWriteThroughputSLI) Reset

func (t *TxnWriteThroughputSLI) Reset()

Reset exports for testing.

func (*TxnWriteThroughputSLI) SetInvalid

func (t *TxnWriteThroughputSLI) SetInvalid()

SetInvalid marks this transaction is invalid to report SLI metrics.

func (*TxnWriteThroughputSLI) String

func (t *TxnWriteThroughputSLI) String() string

String exports for testing.

Jump to

Keyboard shortcuts

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