Documentation
¶
Index ¶
- Constants
- Variables
- func InitialRun(ctx sessionctx.Context) error
- func IsTelemetryEnabled(ctx sessionctx.Context) (bool, error)
- func Logger() *zap.Logger
- func PostReportTelemetryDataForTest()
- func PostSavepointCount()
- func ReportUsageData(ctx sessionctx.Context) error
- func RotateSubWindow()
- type BuiltinFunctionsUsage
- type NewClusterIndexUsage
- type TableClusteredInfo
- type TxnUsage
Constants ¶
const ( // WindowSize determines how long some data is aggregated by. WindowSize = 1 * time.Hour // SubWindowSize determines how often data is rotated. SubWindowSize = 1 * time.Minute )
const ( // ReportInterval is the interval of the report. ReportInterval = 6 * time.Hour )
Variables ¶
var ( // CurrentExecuteCount is CurrentExecuteCount CurrentExecuteCount atomic.Uint64 // CurrentTiFlashPushDownCount is CurrentTiFlashPushDownCount CurrentTiFlashPushDownCount atomic.Uint64 // CurrentTiFlashExchangePushDownCount is CurrentTiFlashExchangePushDownCount CurrentTiFlashExchangePushDownCount atomic.Uint64 // CurrentCoprCacheHitRatioGTE0Count is CurrentCoprCacheHitRatioGTE0Count CurrentCoprCacheHitRatioGTE0Count atomic.Uint64 // CurrentCoprCacheHitRatioGTE1Count is CurrentCoprCacheHitRatioGTE1Count CurrentCoprCacheHitRatioGTE1Count atomic.Uint64 // CurrentCoprCacheHitRatioGTE10Count is CurrentCoprCacheHitRatioGTE10Count CurrentCoprCacheHitRatioGTE10Count atomic.Uint64 // CurrentCoprCacheHitRatioGTE20Count is CurrentCoprCacheHitRatioGTE20Count CurrentCoprCacheHitRatioGTE20Count atomic.Uint64 // CurrentCoprCacheHitRatioGTE40Count is CurrentCoprCacheHitRatioGTE40Count CurrentCoprCacheHitRatioGTE40Count atomic.Uint64 // CurrentCoprCacheHitRatioGTE80Count is CurrentCoprCacheHitRatioGTE80Count CurrentCoprCacheHitRatioGTE80Count atomic.Uint64 // CurrentCoprCacheHitRatioGTE100Count is CurrentCoprCacheHitRatioGTE100Count CurrentCoprCacheHitRatioGTE100Count atomic.Uint64 // CurrentTiflashTableScanCount count the number of tiflash table scan and tiflash partition table scan CurrentTiflashTableScanCount atomic.Uint64 // CurrentTiflashTableScanWithFastScanCount count the number of tiflash table scan and tiflash partition table scan which use fastscan CurrentTiflashTableScanWithFastScanCount atomic.Uint64 )
var GetDomainInfoSchema func(sessionctx.Context) infoschema.InfoSchema
GetDomainInfoSchema is used by the telemetry package to get the latest schema information while avoiding circle dependency with domain package.
var GlobalBuiltinFunctionsUsage = &builtinFunctionsUsageCollector{usageData: make(BuiltinFunctionsUsage)}
GlobalBuiltinFunctionsUsage is used to collect builtin functions usage information
Functions ¶
func InitialRun ¶
func InitialRun(ctx sessionctx.Context) error
InitialRun reports the Telmetry configuration and trigger an initial run
func IsTelemetryEnabled ¶
func IsTelemetryEnabled(ctx sessionctx.Context) (bool, error)
IsTelemetryEnabled check whether telemetry enabled.
func PostReportTelemetryDataForTest ¶
func PostReportTelemetryDataForTest()
PostReportTelemetryDataForTest is for test.
func ReportUsageData ¶
func ReportUsageData(ctx sessionctx.Context) error
ReportUsageData generates the latest usage data and print it to log.
Types ¶
type BuiltinFunctionsUsage ¶
BuiltinFunctionsUsage is a map from ScalarFuncSig_name(string) to usage count(uint32)
func (BuiltinFunctionsUsage) Inc ¶
func (b BuiltinFunctionsUsage) Inc(scalarFuncSigName string)
Inc will increase the usage count of scalar function by 1
func (BuiltinFunctionsUsage) Merge ¶
func (b BuiltinFunctionsUsage) Merge(usageData BuiltinFunctionsUsage)
Merge BuiltinFunctionsUsage data
type NewClusterIndexUsage ¶
type NewClusterIndexUsage struct {
// The number of user's tables with clustered index enabled.
NumClusteredTables uint64 `json:"numClusteredTables"`
// The number of user's tables.
NumTotalTables uint64 `json:"numTotalTables"`
}
NewClusterIndexUsage records the clustered index usage info of all the tables.
type TableClusteredInfo ¶
type TableClusteredInfo struct {
IsClustered bool `json:"isClustered"` // True means CLUSTERED, False means NON_CLUSTERED
ClusterPKType string `json:"clusterPKType"` // INT means clustered PK type is int
}
TableClusteredInfo records the usage info of clusterindex of each table CLUSTERED, NON_CLUSTERED, NA
type TxnUsage ¶
type TxnUsage struct {
AsyncCommitUsed bool `json:"asyncCommitUsed"`
OnePCUsed bool `json:"onePCUsed"`
TxnCommitCounter metrics.TxnCommitCounter `json:"txnCommitCounter"`
MutationCheckerUsed bool `json:"mutationCheckerUsed"`
AssertionLevel string `json:"assertionLevel"`
RcCheckTS bool `json:"rcCheckTS"`
RCWriteCheckTS bool `json:"rcWriteCheckTS"`
FairLocking bool `json:"fairLocking"`
SavepointCounter int64 `json:"SavepointCounter"`
LazyUniqueCheckSetCounter int64 `json:"lazyUniqueCheckSetCounter"`
FairLockingUsageCounter m.FairLockingUsageCounter `json:"FairLockingUsageCounter"`
}
TxnUsage records the usage info of transaction related features, including async-commit, 1PC and counters of transactions committed with different protocols.