@@ -118,7 +118,6 @@ public async Task AddAsync(T item, CancellationToken cancellationToken = default
118118 if ( item != null )
119119 {
120120 await this . _rowLock . WaitAsync ( cancellationToken ) ;
121- TelemetryInstance . TrackEvent ( TelemetryEventName . AddAsync ) ;
122121 try
123122 {
124123 this . _rows . Add ( item ) ;
@@ -170,7 +169,7 @@ public async Task FlushAsync(CancellationToken cancellationToken = default)
170169 /// <param name="rows"> The rows to be upserted </param>
171170 /// <param name="attribute"> Contains the name of the table to be modified and SQL connection information </param>
172171 /// <param name="configuration"> Used to build up the connection </param>
173- private async Task UpsertRowsAsync ( IEnumerable < T > rows , SqlAttribute attribute , IConfiguration configuration )
172+ private async Task UpsertRowsAsync ( IList < T > rows , SqlAttribute attribute , IConfiguration configuration )
174173 {
175174 this . _logger . LogDebugWithThreadId ( "BEGIN UpsertRowsAsync" ) ;
176175 var upsertRowsAsyncSw = Stopwatch . StartNew ( ) ;
@@ -237,7 +236,6 @@ private async Task UpsertRowsAsync(IEnumerable<T> rows, SqlAttribute attribute,
237236 string mergeOrInsertQuery = tableInfo . QueryType == QueryType . Insert ? TableInformation . GetInsertQuery ( table , bracketedColumnNamesFromItem ) :
238237 TableInformation . GetMergeQuery ( tableInfo . PrimaryKeys , table , bracketedColumnNamesFromItem ) ;
239238
240- TelemetryInstance . TrackEvent ( TelemetryEventName . UpsertStart , props ) ;
241239 this . _logger . LogDebugWithThreadId ( "BEGIN UpsertRowsTransaction" ) ;
242240 var transactionSw = Stopwatch . StartNew ( ) ;
243241 int batchSize = 1000 ;
@@ -266,10 +264,12 @@ private async Task UpsertRowsAsync(IEnumerable<T> rows, SqlAttribute attribute,
266264 {
267265 { TelemetryMeasureName . BatchCount , batchCount } ,
268266 { TelemetryMeasureName . TransactionDurationMs , transactionSw . ElapsedMilliseconds } ,
269- { TelemetryMeasureName . CommandDurationMs , commandSw . ElapsedMilliseconds }
267+ { TelemetryMeasureName . CommandDurationMs , commandSw . ElapsedMilliseconds } ,
268+ { TelemetryMeasureName . BatchSize , batchSize } ,
269+ { TelemetryMeasureName . NumRows , rows . Count }
270270 } ;
271- TelemetryInstance . TrackEvent ( TelemetryEventName . UpsertEnd , props , measures ) ;
272- this . _logger . LogDebugWithThreadId ( $ "END UpsertRowsTransaction Duration={ transactionSw . ElapsedMilliseconds } ms Upserted { rows . Count ( ) } row(s) into database: { connection . Database } and table: { fullTableName } .") ;
271+ TelemetryInstance . TrackEvent ( TelemetryEventName . Upsert , props , measures ) ;
272+ this . _logger . LogDebugWithThreadId ( $ "END UpsertRowsTransaction Duration={ transactionSw . ElapsedMilliseconds } ms Upserted { rows . Count } row(s) into database: { connection . Database } and table: { fullTableName } .") ;
273273 this . _logger . LogDebugWithThreadId ( $ "END UpsertRowsAsync Duration={ upsertRowsAsyncSw . ElapsedMilliseconds } ms") ;
274274 }
275275 catch ( Exception ex )
0 commit comments