topsql

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

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxSQLTextSize exports for testing.
	MaxSQLTextSize = 4 * 1024
	// MaxBinaryPlanSize exports for testing.
	MaxBinaryPlanSize = 2 * 1024
)

Variables

This section is empty.

Functions

func AttachAndRegisterProcessInfo

func AttachAndRegisterProcessInfo(ctx context.Context, connID uint64, sqlID uint64) context.Context

AttachAndRegisterProcessInfo attach the ProcessInfo into Goroutine labels.

func AttachAndRegisterSQLInfo

func AttachAndRegisterSQLInfo(ctx context.Context, normalizedSQL string, sqlDigest *parser.Digest, isInternal bool) context.Context

AttachAndRegisterSQLInfo attach the sql information into Top Profiling and register the SQL meta information.

func AttachSQLAndPlanInfo

func AttachSQLAndPlanInfo(ctx context.Context, sqlDigest *parser.Digest, planDigest *parser.Digest) context.Context

AttachSQLAndPlanInfo attach the sql and plan information into Top Profiling.

func Close

func Close()

Close uses to close and release the top sql resource.

func MockHighCPULoad

func MockHighCPULoad(sql string, sqlPrefixs []string, load int64) bool

MockHighCPULoad mocks high cpu load, only use in failpoint test.

func RegisterPlan

func RegisterPlan(normalizedPlan string, planDigest *parser.Digest)

RegisterPlan uses to register plan information into Top Profiling.

func RegisterPubSubServer

func RegisterPubSubServer(s *grpc.Server)

RegisterPubSubServer registers TopSQLPubSubService to the given gRPC server.

func RegisterSQL

func RegisterSQL(normalizedSQL string, sqlDigest *parser.Digest, isInternal bool)

RegisterSQL uses to register SQL information into Top Profiling.

func SetupTopProfiling

func SetupTopProfiling(keyspaceName []byte, updater collector.ProcessCPUTimeUpdater)

SetupTopProfiling sets up the Top Profiling pipeline.

NOTE: Despite the legacy package name, this initializer wires the collectors and reporters shared by TopSQL (and future TopRU).

func SetupTopProfilingForTest

func SetupTopProfilingForTest(r reporter.TopSQLReporter)

SetupTopProfilingForTest sets up the global reporter for tests.

Types

This section is empty.

Directories

Path Synopsis
Package stmtstats provides statement statistics collection.
Package stmtstats provides statement statistics collection.

Jump to

Keyboard shortcuts

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