Skip to content

Commit

Permalink
stmtsummary: implement tidb_statements_stats, a cumulative version of…
Browse files Browse the repository at this point in the history
… statements_summary (#57155)

ref #57147
  • Loading branch information
henrybw authored Dec 6, 2024
1 parent bb9096c commit 8c88823
Show file tree
Hide file tree
Showing 13 changed files with 1,062 additions and 697 deletions.
4 changes: 3 additions & 1 deletion pkg/executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2325,9 +2325,11 @@ func (b *executorBuilder) buildMemTable(v *plannercore.PhysicalMemTable) exec.Ex
case strings.ToLower(infoschema.TableStatementsSummary),
strings.ToLower(infoschema.TableStatementsSummaryHistory),
strings.ToLower(infoschema.TableStatementsSummaryEvicted),
strings.ToLower(infoschema.TableTiDBStatementsStats),
strings.ToLower(infoschema.ClusterTableStatementsSummary),
strings.ToLower(infoschema.ClusterTableStatementsSummaryHistory),
strings.ToLower(infoschema.ClusterTableStatementsSummaryEvicted):
strings.ToLower(infoschema.ClusterTableStatementsSummaryEvicted),
strings.ToLower(infoschema.ClusterTableTiDBStatementsStats):
var extractor *plannercore.StatementsSummaryExtractor
if v.Extractor != nil {
extractor = v.Extractor.(*plannercore.StatementsSummaryExtractor)
Expand Down
20 changes: 16 additions & 4 deletions pkg/executor/stmtsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ func (e *stmtSummaryRetriever) initSummaryRowsReader(sctx sessionctx.Context) (*
}

var rows [][]types.Datum
if isCurrentTable(e.table.Name.O) {
if isCumulativeTable(e.table.Name.O) {
rows = reader.GetStmtSummaryCumulativeRows()
} else if isCurrentTable(e.table.Name.O) {
rows = reader.GetStmtSummaryCurrentRows()
}
if isHistoryTable(e.table.Name.O) {
} else if isHistoryTable(e.table.Name.O) {
rows = reader.GetStmtSummaryHistoryRows()
}
return newSimpleRowsReader(rows), nil
Expand Down Expand Up @@ -345,7 +346,18 @@ func isClusterTable(originalTableName string) bool {
switch originalTableName {
case infoschema.ClusterTableStatementsSummary,
infoschema.ClusterTableStatementsSummaryHistory,
infoschema.ClusterTableStatementsSummaryEvicted:
infoschema.ClusterTableStatementsSummaryEvicted,
infoschema.ClusterTableTiDBStatementsStats:
return true
}

return false
}

func isCumulativeTable(originalTableName string) bool {
switch originalTableName {
case infoschema.TableTiDBStatementsStats,
infoschema.ClusterTableTiDBStatementsStats:
return true
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/infoschema/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const (
ClusterTableStatementsSummaryHistory = "CLUSTER_STATEMENTS_SUMMARY_HISTORY"
// ClusterTableStatementsSummaryEvicted is the string constant of cluster statement summary evict table.
ClusterTableStatementsSummaryEvicted = "CLUSTER_STATEMENTS_SUMMARY_EVICTED"
// ClusterTableTiDBStatementsStats is the string constant of the cluster statement stats table.
ClusterTableTiDBStatementsStats = "CLUSTER_TIDB_STATEMENTS_STATS"
// ClusterTableTiDBTrx is the string constant of cluster transaction running table.
ClusterTableTiDBTrx = "CLUSTER_TIDB_TRX"
// ClusterTableDeadlocks is the string constant of cluster dead lock table.
Expand All @@ -65,6 +67,7 @@ var memTableToAllTiDBClusterTables = map[string]string{
TableStatementsSummary: ClusterTableStatementsSummary,
TableStatementsSummaryHistory: ClusterTableStatementsSummaryHistory,
TableStatementsSummaryEvicted: ClusterTableStatementsSummaryEvicted,
TableTiDBStatementsStats: ClusterTableTiDBStatementsStats,
TableTiDBTrx: ClusterTableTiDBTrx,
TableDeadlocks: ClusterTableDeadlocks,
TableTrxSummary: ClusterTableTrxSummary,
Expand Down
76 changes: 76 additions & 0 deletions pkg/infoschema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ const (
TableStatementsSummaryHistory = "STATEMENTS_SUMMARY_HISTORY"
// TableStatementsSummaryEvicted is the string constant of statements summary evicted table.
TableStatementsSummaryEvicted = "STATEMENTS_SUMMARY_EVICTED"
// TableTiDBStatementsStats is the string constant of the TiDB statement stats table.
TableTiDBStatementsStats = "TIDB_STATEMENTS_STATS"
// TableStorageStats is a table that contains all tables disk usage
TableStorageStats = "TABLE_STORAGE_STATS"
// TableTiFlashTables is the string constant of tiflash tables table.
Expand Down Expand Up @@ -342,6 +344,8 @@ var tableIDMap = map[string]int64{
TableTiFlashIndexes: autoid.InformationSchemaDBID + 95,
TableTiDBPlanCache: autoid.InformationSchemaDBID + 96,
ClusterTableTiDBPlanCache: autoid.InformationSchemaDBID + 97,
TableTiDBStatementsStats: autoid.InformationSchemaDBID + 98,
ClusterTableTiDBStatementsStats: autoid.InformationSchemaDBID + 99,
}

// columnInfo represents the basic column information of all kinds of INFORMATION_SCHEMA tables
Expand Down Expand Up @@ -1391,6 +1395,77 @@ var tableStatementsSummaryCols = []columnInfo{
{name: stmtsummary.PlanCacheUnqualifiedLastReasonStr, tp: mysql.TypeBlob, size: types.UnspecifiedLength, comment: "The last reason why the statement is not supported by the plan cache"},
}

var tableTiDBStatementsStatsCols = []columnInfo{
{name: stmtsummary.StmtTypeStr, tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, comment: "Statement type"},
{name: stmtsummary.SchemaNameStr, tp: mysql.TypeVarchar, size: 64, comment: "Current schema"},
{name: stmtsummary.DigestStr, tp: mysql.TypeVarchar, size: 64},
{name: stmtsummary.DigestTextStr, tp: mysql.TypeBlob, size: types.UnspecifiedLength, flag: mysql.NotNullFlag, comment: "Normalized statement"},
{name: stmtsummary.TableNamesStr, tp: mysql.TypeBlob, size: types.UnspecifiedLength, comment: "Involved tables"},
{name: stmtsummary.IndexNamesStr, tp: mysql.TypeBlob, size: types.UnspecifiedLength, comment: "Used indices"},
{name: stmtsummary.SampleUserStr, tp: mysql.TypeVarchar, size: 64, comment: "Sampled user who executed these statements"},
{name: stmtsummary.ExecCountStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Count of executions"},
{name: stmtsummary.ErrorsStr, tp: mysql.TypeLong, size: 11, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Sum of errors"},
{name: stmtsummary.WarningsStr, tp: mysql.TypeLong, size: 11, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Sum of warnings"},
{name: stmtsummary.MemStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total memory(byte) used"},
{name: stmtsummary.DiskStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total disk space(byte) used"},
{name: stmtsummary.TotalTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Sum latency of these statements"},
{name: stmtsummary.ParseTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total latency of parsing"},
{name: stmtsummary.CompileTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total latency of compiling"},
{name: stmtsummary.CopTaskNumStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total number of CopTasks"},
{name: stmtsummary.CopProcessTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total processing time of CopTasks"},
{name: stmtsummary.MaxCopProcessAddressStr, tp: mysql.TypeVarchar, size: 256, comment: "Address of the CopTask with max processing time"},
{name: stmtsummary.CopWaitTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total waiting time of CopTasks"},
{name: stmtsummary.MaxCopWaitAddressStr, tp: mysql.TypeVarchar, size: 256, comment: "Address of the CopTask with max waiting time"},
{name: stmtsummary.PdTimeStr, tp: mysql.TypeLonglong, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time of PD used"},
{name: stmtsummary.KvTimeStr, tp: mysql.TypeLonglong, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time of TiKV used"},
{name: stmtsummary.ProcessTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total processing time in TiKV"},
{name: stmtsummary.WaitTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total waiting time in TiKV"},
{name: stmtsummary.BackoffTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total waiting time before retry"},
{name: stmtsummary.TotalKeysStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total number of scanned keys"},
{name: stmtsummary.ProcessedKeysStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total number of processed keys"},
{name: stmtsummary.RocksdbDeleteSkippedCountStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total RocksDB delete skipped count"},
{name: stmtsummary.RocksdbKeySkippedCountStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total RocksDB key skipped count"},
{name: stmtsummary.RocksdbBlockCacheHitCountStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total RocksDB block cache hit count"},
{name: stmtsummary.RocksdbBlockReadCountStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total RocksDB block read count"},
{name: stmtsummary.RocksdbBlockReadByteStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total RocksDB block read byte"},
{name: stmtsummary.PrewriteTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time of prewrite phase"},
{name: stmtsummary.CommitTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time of commit phase"},
{name: stmtsummary.CommitTsTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time of getting commit_ts"},
{name: stmtsummary.CommitBackoffTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time before retry during commit phase"},
{name: stmtsummary.ResolveLockTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time for resolving locks"},
{name: stmtsummary.LocalLatchWaitTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total waiting time of local transaction"},
{name: stmtsummary.WriteKeysStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total count of written keys"},
{name: stmtsummary.WriteSizeStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total amount of written bytes"},
{name: stmtsummary.PrewriteRegionsStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total number of involved regions in prewrite phase"},
{name: stmtsummary.TxnRetryStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total number of transaction retries"},
{name: stmtsummary.ExecRetryStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Sum number of execution retries in pessimistic transactions"},
{name: stmtsummary.ExecRetryTimeStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Sum time of execution retries in pessimistic transactions"},
{name: stmtsummary.BackoffTimesStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Sum of retries"},
{name: stmtsummary.BackoffTypesStr, tp: mysql.TypeVarchar, size: 1024, comment: "Types of errors and the number of retries for each type"},
{name: stmtsummary.BackoffTotalTimeStr, tp: mysql.TypeLonglong, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time spent in backoff and retry"},
{name: stmtsummary.WriteSQLRespTimeStr, tp: mysql.TypeLonglong, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time used to write a response to the client."},
{name: stmtsummary.ResultRowsStr, tp: mysql.TypeLonglong, size: 22, flag: mysql.NotNullFlag, comment: "Total count of SQL result rows"},
{name: stmtsummary.AffectedRowsStr, tp: mysql.TypeDouble, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total number of rows affected"},
{name: stmtsummary.PreparedStr, tp: mysql.TypeTiny, size: 1, flag: mysql.NotNullFlag, comment: "Whether prepared"},
{name: stmtsummary.FirstSeenStr, tp: mysql.TypeTimestamp, size: 26, flag: mysql.NotNullFlag, comment: "The time these statements are seen for the first time"},
{name: stmtsummary.LastSeenStr, tp: mysql.TypeTimestamp, size: 26, flag: mysql.NotNullFlag, comment: "The time these statements are seen for the last time"},
{name: stmtsummary.PlanInCacheStr, tp: mysql.TypeTiny, size: 1, flag: mysql.NotNullFlag, comment: "Whether the last statement hit the plan cache"},
{name: stmtsummary.PlanCacheHitsStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.NotNullFlag, comment: "The number of times these statements hit the plan cache"},
{name: stmtsummary.PlanInBindingStr, tp: mysql.TypeTiny, size: 1, flag: mysql.NotNullFlag, comment: "Whether the last statement is matched with the hints in the binding"},
{name: stmtsummary.QuerySampleTextStr, tp: mysql.TypeBlob, size: types.UnspecifiedLength, comment: "Sampled original statement"},
{name: stmtsummary.PrevSampleTextStr, tp: mysql.TypeBlob, size: types.UnspecifiedLength, comment: "The previous statement before commit"},
{name: stmtsummary.PlanDigestStr, tp: mysql.TypeVarchar, size: 64, comment: "Digest of its execution plan"},
{name: stmtsummary.PlanStr, tp: mysql.TypeBlob, size: types.UnspecifiedLength, comment: "Sampled execution plan"},
{name: stmtsummary.BinaryPlan, tp: mysql.TypeBlob, size: types.UnspecifiedLength, comment: "Sampled binary plan"},
{name: stmtsummary.Charset, tp: mysql.TypeVarchar, size: 64, comment: "Sampled charset"},
{name: stmtsummary.Collation, tp: mysql.TypeVarchar, size: 64, comment: "Sampled collation"},
{name: stmtsummary.PlanHint, tp: mysql.TypeBlob, size: types.UnspecifiedLength, comment: "Sampled plan hint"},
{name: stmtsummary.RequestUnitReadStr, tp: mysql.TypeDouble, flag: mysql.NotNullFlag | mysql.UnsignedFlag, size: 22, comment: "Total read request-unit cost of these statements"},
{name: stmtsummary.RequestUnitWriteStr, tp: mysql.TypeDouble, flag: mysql.NotNullFlag | mysql.UnsignedFlag, size: 22, comment: "Total write request-unit cost of these statements"},
{name: stmtsummary.QueuedRcTimeStr, tp: mysql.TypeLonglong, size: 22, flag: mysql.NotNullFlag | mysql.UnsignedFlag, comment: "Total time waiting for available request-units"},
{name: stmtsummary.ResourceGroupName, tp: mysql.TypeVarchar, size: 64, comment: "Bind resource group name"},
}

var tableStorageStatsCols = []columnInfo{
{name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64},
{name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64},
Expand Down Expand Up @@ -2363,6 +2438,7 @@ var tableNameToColumns = map[string][]columnInfo{
TableStatementsSummaryHistory: tableStatementsSummaryCols,
TableStatementsSummaryEvicted: tableStatementsSummaryEvictedCols,
TableStorageStats: tableStorageStatsCols,
TableTiDBStatementsStats: tableTiDBStatementsStatsCols,
TableTiFlashTables: tableTableTiFlashTablesCols,
TableTiFlashSegments: tableTableTiFlashSegmentsCols,
TableTiFlashIndexes: tableTiFlashIndexesCols,
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4842,7 +4842,7 @@ func (b *PlanBuilder) buildMemTable(_ context.Context, dbName pmodel.CIStr, tabl
p.Extractor = &TableStorageStatsExtractor{}
case infoschema.TableTiFlashTables, infoschema.TableTiFlashSegments, infoschema.TableTiFlashIndexes:
p.Extractor = &TiFlashSystemTableExtractor{}
case infoschema.TableStatementsSummary, infoschema.TableStatementsSummaryHistory:
case infoschema.TableStatementsSummary, infoschema.TableStatementsSummaryHistory, infoschema.TableTiDBStatementsStats:
p.Extractor = &StatementsSummaryExtractor{}
case infoschema.TableTiKVRegionPeers:
p.Extractor = &TikvRegionPeersExtractor{}
Expand Down
2 changes: 2 additions & 0 deletions pkg/planner/core/operator/logicalop/logical_mem_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ func (p *LogicalMemTable) PruneColumns(parentUsedCols []*expression.Column, opt
switch p.TableInfo.Name.O {
case infoschema.TableStatementsSummary,
infoschema.TableStatementsSummaryHistory,
infoschema.TableTiDBStatementsStats,
infoschema.TableSlowQuery,
infoschema.ClusterTableStatementsSummary,
infoschema.ClusterTableStatementsSummaryHistory,
infoschema.ClusterTableTiDBStatementsStats,
infoschema.ClusterTableSlowLog,
infoschema.TableTiDBTrx,
infoschema.ClusterTableTiDBTrx,
Expand Down
4 changes: 4 additions & 0 deletions pkg/sessionctx/stmtctx/stmtctx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ func TestCopTasksDetails(t *testing.T) {
d := ctx.CopTasksDetails()
require.Equal(t, 100, d.NumCopTasks)
require.Equal(t, time.Second*101/2, d.AvgProcessTime)
require.Equal(t, time.Second*101/2*100, d.TotProcessTime)
require.Equal(t, time.Second*91, d.P90ProcessTime)
require.Equal(t, time.Second*100, d.MaxProcessTime)
require.Equal(t, "100", d.MaxProcessAddress)
require.Equal(t, time.Millisecond*101/2, d.AvgWaitTime)
require.Equal(t, time.Millisecond*101/2*100, d.TotWaitTime)
require.Equal(t, time.Millisecond*91, d.P90WaitTime)
require.Equal(t, time.Millisecond*100, d.MaxWaitTime)
require.Equal(t, "100", d.MaxWaitAddress)
Expand Down Expand Up @@ -261,6 +263,7 @@ func TestApproxRuntimeInfo(t *testing.T) {
for _, detail := range details {
timeSum += detail.TimeDetail.ProcessTime
}
require.Equal(t, d.TotProcessTime, timeSum)
require.Equal(t, d.AvgProcessTime, timeSum/time.Duration(n))
require.InEpsilon(t, d.P90ProcessTime.Nanoseconds(), details[n*9/10].TimeDetail.ProcessTime.Nanoseconds(), 0.05)
require.Equal(t, d.MaxProcessTime, details[n-1].TimeDetail.ProcessTime)
Expand All @@ -273,6 +276,7 @@ func TestApproxRuntimeInfo(t *testing.T) {
for _, detail := range details {
timeSum += detail.TimeDetail.WaitTime
}
require.Equal(t, d.TotWaitTime, timeSum)
require.Equal(t, d.AvgWaitTime, timeSum/time.Duration(n))
require.InEpsilon(t, d.P90WaitTime.Nanoseconds(), details[n*9/10].TimeDetail.WaitTime.Nanoseconds(), 0.05)
require.Equal(t, d.MaxWaitTime, details[n-1].TimeDetail.WaitTime)
Expand Down
9 changes: 7 additions & 2 deletions pkg/util/execdetails/execdetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,11 @@ func (s *SyncExecDetails) CopTasksDetails() CopTasksDetails {
if n == 0 {
return d
}
d.AvgProcessTime = s.execDetails.TimeDetail.ProcessTime / time.Duration(n)
d.AvgWaitTime = s.execDetails.TimeDetail.WaitTime / time.Duration(n)
d.TotProcessTime = s.execDetails.TimeDetail.ProcessTime
d.AvgProcessTime = d.TotProcessTime / time.Duration(n)

d.TotWaitTime = s.execDetails.TimeDetail.WaitTime
d.AvgWaitTime = d.TotWaitTime / time.Duration(n)

d.P90ProcessTime = time.Duration((s.detailsSummary.ProcessTimePercentile.GetPercentile(0.9)))
d.MaxProcessTime = s.detailsSummary.ProcessTimePercentile.GetMax().D
Expand Down Expand Up @@ -515,11 +518,13 @@ type CopTasksDetails struct {
P90ProcessTime time.Duration
MaxProcessAddress string
MaxProcessTime time.Duration
TotProcessTime time.Duration

AvgWaitTime time.Duration
P90WaitTime time.Duration
MaxWaitAddress string
MaxWaitTime time.Duration
TotWaitTime time.Duration

MaxBackoffTime map[string]time.Duration
MaxBackoffAddress map[string]string
Expand Down
14 changes: 8 additions & 6 deletions pkg/util/stmtsummary/evicted.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ func newStmtSummaryByDigestEvictedElement(beginTime int64, endTime int64) *stmtS
beginTime: beginTime,
endTime: endTime,
otherSummary: &stmtSummaryByDigestElement{
beginTime: beginTime,
endTime: endTime,
authUsers: make(map[string]struct{}),
minLatency: time.Duration(math.MaxInt64),
backoffTypes: make(map[string]int),
firstSeen: time.Unix(endTime, 0),
beginTime: beginTime,
endTime: endTime,
stmtSummaryStats: stmtSummaryStats{
authUsers: make(map[string]struct{}),
minLatency: time.Duration(math.MaxInt64),
backoffTypes: make(map[string]int),
firstSeen: time.Unix(endTime, 0),
},
},
}
}
Expand Down
Loading

0 comments on commit 8c88823

Please sign in to comment.