topsql

package
v1.1.0-beta.0...-2a72e7f Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 14 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 SQL 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 SQL

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 SQL.

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 SQL.

func SetupTopSQL

func SetupTopSQL(updater collector.ProcessCPUTimeUpdater)

SetupTopSQL sets up the top-sql worker.

func SetupTopSQLForTest

func SetupTopSQLForTest(r reporter.TopSQLReporter)

SetupTopSQLForTest sets up the global top-sql reporter, it's exporting for test.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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