state

package
v1.1.0-beta.0...-d5b6b69 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefTiDBTopSQLEnable                = false
	DefTiDBTopSQLPrecisionSeconds      = 1
	DefTiDBTopSQLMaxTimeSeriesCount    = 100
	DefTiDBTopSQLMaxMetaCount          = 5000
	DefTiDBTopSQLReportIntervalSeconds = 60
)

Default Top-SQL state values.

Variables

View Source
var GlobalState = State{

	PrecisionSeconds:      atomic.NewInt64(DefTiDBTopSQLPrecisionSeconds),
	MaxStatementCount:     atomic.NewInt64(DefTiDBTopSQLMaxTimeSeriesCount),
	MaxCollect:            atomic.NewInt64(DefTiDBTopSQLMaxMetaCount),
	ReportIntervalSeconds: atomic.NewInt64(DefTiDBTopSQLReportIntervalSeconds),
	// contains filtered or unexported fields
}

GlobalState is the global Top-SQL state.

Functions

func DisableTopSQL

func DisableTopSQL()

DisableTopSQL disables the top SQL feature.

func EnableTopSQL

func EnableTopSQL()

EnableTopSQL enables the top SQL feature.

func TopSQLEnabled

func TopSQLEnabled() bool

TopSQLEnabled uses to check whether enabled the top SQL feature.

Types

type State

type State struct {

	// The refresh interval of top-sql.
	PrecisionSeconds *atomic.Int64
	// The maximum number of statements kept in memory.
	MaxStatementCount *atomic.Int64
	// The maximum capacity of the collect map.
	MaxCollect *atomic.Int64
	// The report data interval of top-sql.
	ReportIntervalSeconds *atomic.Int64
	// contains filtered or unexported fields
}

State is the state for control top sql feature.

Jump to

Keyboard shortcuts

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