@@ -12,40 +12,44 @@ 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+ [ Params ( 1 , 10 ) ]
17+ public int PollingIntervalMs ;
18+
19+ [ Params ( 500 , 1000 ) ]
20+ // [Params(500, 1000, 2000)]
21+ public int BatchSize ;
22+
23+ [ GlobalSetup ]
24+ public void GlobalSetup ( )
3325 {
26+ this . SetChangeTrackingForTable ( "Products" , true ) ;
3427 this . StartFunctionHost (
3528 nameof ( ProductsTrigger ) ,
3629 SupportedLanguages . CSharp ,
3730 environmentVariables : new Dictionary < string , string > ( ) {
38- { "Sql_Trigger_BatchSize" , batchSize . ToString ( ) } ,
39- { "Sql_Trigger_PollingIntervalMs" , pollingIntervalMs . ToString ( ) }
31+ { "Sql_Trigger_BatchSize" , this . BatchSize . ToString ( ) } ,
32+ { "Sql_Trigger_PollingIntervalMs" , this . PollingIntervalMs . ToString ( ) }
4033 } ) ;
34+ }
35+
36+ [ Benchmark ]
37+ [ Arguments ( 0.1 ) ]
38+ [ Arguments ( 0.5 ) ]
39+ //[Arguments(1)]
40+ //[Arguments(5)]
41+ // [Arguments(10)]
42+ public async Task Run ( double numBatches )
43+ {
44+ int count = ( int ) ( numBatches * this . BatchSize ) ;
4145 await this . WaitForProductChanges (
4246 1 ,
4347 count ,
4448 SqlChangeOperation . Insert ,
4549 ( ) => { this . InsertProducts ( 1 , count ) ; return Task . CompletedTask ; } ,
4650 id => $ "Product { id } ",
4751 id => id * 100 ,
48- this . GetBatchProcessingTimeout ( 1 , count , batchSize : batchSize ) ) ;
52+ this . GetBatchProcessingTimeout ( 1 , count , batchSize : this . BatchSize ) ) ;
4953 }
5054 }
5155}
0 commit comments