@@ -63,7 +63,7 @@ CREATE TABLE t.test (x INT PRIMARY KEY);
6363 sqlServer := s .SQLServer ().(* sql.Server )
6464
6565 // Flush stats at the beginning of the test.
66- sqlServer .GetSQLStatsController ().ResetLocalSQLStats (ctx )
66+ require . NoError ( t , sqlServer .GetLocalSQLStatsProvider ().Reset (ctx ) )
6767 sqlServer .GetReportedSQLStatsController ().ResetLocalSQLStats (ctx )
6868
6969 // Run some queries mixed with diagnostics, and ensure that the statistics
@@ -213,7 +213,7 @@ func TestSQLStatCollection(t *testing.T) {
213213
214214 // Reset the SQL statistics, which will dump stats into the
215215 // reported statistics pool.
216- sqlServer .GetSQLStatsController ().ResetLocalSQLStats (ctx )
216+ require . NoError ( t , sqlServer .GetLocalSQLStatsProvider ().Reset (ctx ) )
217217
218218 // Query the reported statistics.
219219 stats , err = sqlServer .GetScrubbedReportingStats (ctx , 1000 , true )
@@ -271,7 +271,7 @@ func TestSQLStatCollection(t *testing.T) {
271271 }
272272
273273 // Flush the SQL stats again.
274- sqlServer .GetSQLStatsController ().ResetLocalSQLStats (ctx )
274+ require . NoError ( t , sqlServer .GetLocalSQLStatsProvider ().Reset (ctx ) )
275275
276276 // Find our statement stat from the reported stats pool.
277277 stats , err = sqlServer .GetScrubbedReportingStats (ctx , 1000 , true )
@@ -396,7 +396,7 @@ func TestScrubbedReportingStatsLimit(t *testing.T) {
396396 sqlRunner := sqlutils .MakeSQLRunner (sqlDB )
397397 sqlServer := srv .ApplicationLayer ().SQLServer ().(* sql.Server )
398398 // Flush stats at the beginning of the test.
399- sqlServer .GetSQLStatsController ().ResetLocalSQLStats (ctx )
399+ require . NoError ( t , sqlServer .GetLocalSQLStatsProvider ().Reset (ctx ) )
400400 sqlServer .GetReportedSQLStatsController ().ResetLocalSQLStats (ctx )
401401
402402 hashedAppName := "hashed app name"
@@ -409,13 +409,13 @@ func TestScrubbedReportingStatsLimit(t *testing.T) {
409409 sqlRunner .Exec (t , `DELETE FROM t.test WHERE x=5` )
410410
411411 // verify that with low limit, number of stats is within that limit
412- sqlServer .GetSQLStatsController ().ResetLocalSQLStats (ctx )
412+ require . NoError ( t , sqlServer .GetLocalSQLStatsProvider ().Reset (ctx ) )
413413 stats , err := sqlServer .GetScrubbedReportingStats (ctx , 5 , true )
414414 require .NoError (t , err )
415415 require .LessOrEqual (t , len (stats ), 5 )
416416
417417 // verify that with high limit, the number of queries is as much as the above
418- sqlServer .GetSQLStatsController ().ResetLocalSQLStats (ctx )
418+ require . NoError ( t , sqlServer .GetLocalSQLStatsProvider ().Reset (ctx ) )
419419 stats , err = sqlServer .GetScrubbedReportingStats (ctx , 1000 , true )
420420 require .NoError (t , err )
421421 require .GreaterOrEqual (t , len (stats ), 7 )
0 commit comments