@@ -12,40 +12,42 @@ namespace Microsoft.Azure.WebJobs.Extensions.Sql.Performance
1212 [ MemoryDiagnoser ]
1313 public class SqlTriggerPerformance_Overrides : SqlTriggerBindingPerformanceTestBase
1414 {
15- [ Benchmark ]
16- [ Arguments ( 10 , 1000 , 500 ) ]
17- [ Arguments ( 10 , 1000 , 100 ) ]
18- [ Arguments ( 10 , 1000 , 10 ) ]
19- [ Arguments ( 10 , 1000 , 1 ) ]
20- [ Arguments ( 100 , 1000 , 500 ) ]
21- [ Arguments ( 100 , 1000 , 100 ) ]
22- [ Arguments ( 100 , 1000 , 10 ) ]
23- [ Arguments ( 100 , 1000 , 1 ) ]
24- [ Arguments ( 1000 , 1000 , 500 ) ]
25- [ Arguments ( 1000 , 1000 , 100 ) ]
26- [ Arguments ( 1000 , 1000 , 10 ) ]
27- [ Arguments ( 1000 , 1000 , 1 ) ]
28- [ Arguments ( 5000 , 1000 , 500 ) ]
29- [ Arguments ( 5000 , 1000 , 100 ) ]
30- [ Arguments ( 5000 , 1000 , 10 ) ]
31- [ Arguments ( 5000 , 1000 , 1 ) ]
32- public async Task Run ( int count , int batchSize , int pollingIntervalMs )
15+ [ Params ( 1 , 10 , 100 , 500 ) ]
16+ public int PollingIntervalMs ;
17+
18+ [ Params ( 500 , 1000 , 2000 ) ]
19+ public int BatchSize ;
20+
21+ [ GlobalSetup ]
22+ public void GlobalSetup ( )
3323 {
24+ this . SetChangeTrackingForTable ( "Products" , true ) ;
3425 this . StartFunctionHost (
3526 nameof ( ProductsTrigger ) ,
3627 SupportedLanguages . CSharp ,
3728 environmentVariables : new Dictionary < string , string > ( ) {
38- { "Sql_Trigger_BatchSize" , batchSize . ToString ( ) } ,
39- { "Sql_Trigger_PollingIntervalMs" , pollingIntervalMs . ToString ( ) }
29+ { "Sql_Trigger_BatchSize" , this . BatchSize . ToString ( ) } ,
30+ { "Sql_Trigger_PollingIntervalMs" , this . PollingIntervalMs . ToString ( ) }
4031 } ) ;
32+ }
33+
34+ [ Benchmark ]
35+ [ Arguments ( 0.1 ) ]
36+ [ Arguments ( 0.5 ) ]
37+ [ Arguments ( 1 ) ]
38+ [ Arguments ( 5 ) ]
39+ [ Arguments ( 10 ) ]
40+ public async Task Run ( double numBatches )
41+ {
42+ int count = ( int ) ( numBatches * this . BatchSize ) ;
4143 await this . WaitForProductChanges (
4244 1 ,
4345 count ,
4446 SqlChangeOperation . Insert ,
4547 ( ) => { this . InsertProducts ( 1 , count ) ; return Task . CompletedTask ; } ,
4648 id => $ "Product { id } ",
4749 id => id * 100 ,
48- this . GetBatchProcessingTimeout ( 1 , count , batchSize : batchSize ) ) ;
50+ this . GetBatchProcessingTimeout ( 1 , count , batchSize : this . BatchSize ) ) ;
4951 }
5052 }
5153}
0 commit comments