@@ -118,7 +118,6 @@ public async Task AddAsync(T item, CancellationToken cancellationToken = default
118
118
if ( item != null )
119
119
{
120
120
await this . _rowLock . WaitAsync ( cancellationToken ) ;
121
- TelemetryInstance . TrackEvent ( TelemetryEventName . AddAsync ) ;
122
121
try
123
122
{
124
123
this . _rows . Add ( item ) ;
@@ -170,7 +169,7 @@ public async Task FlushAsync(CancellationToken cancellationToken = default)
170
169
/// <param name="rows"> The rows to be upserted </param>
171
170
/// <param name="attribute"> Contains the name of the table to be modified and SQL connection information </param>
172
171
/// <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 )
174
173
{
175
174
this . _logger . LogDebugWithThreadId ( "BEGIN UpsertRowsAsync" ) ;
176
175
var upsertRowsAsyncSw = Stopwatch . StartNew ( ) ;
@@ -237,7 +236,6 @@ private async Task UpsertRowsAsync(IEnumerable<T> rows, SqlAttribute attribute,
237
236
string mergeOrInsertQuery = tableInfo . QueryType == QueryType . Insert ? TableInformation . GetInsertQuery ( table , bracketedColumnNamesFromItem ) :
238
237
TableInformation . GetMergeQuery ( tableInfo . PrimaryKeys , table , bracketedColumnNamesFromItem ) ;
239
238
240
- TelemetryInstance . TrackEvent ( TelemetryEventName . UpsertStart , props ) ;
241
239
this . _logger . LogDebugWithThreadId ( "BEGIN UpsertRowsTransaction" ) ;
242
240
var transactionSw = Stopwatch . StartNew ( ) ;
243
241
int batchSize = 1000 ;
@@ -266,10 +264,12 @@ private async Task UpsertRowsAsync(IEnumerable<T> rows, SqlAttribute attribute,
266
264
{
267
265
{ TelemetryMeasureName . BatchCount , batchCount } ,
268
266
{ TelemetryMeasureName . TransactionDurationMs , transactionSw . ElapsedMilliseconds } ,
269
- { TelemetryMeasureName . CommandDurationMs , commandSw . ElapsedMilliseconds }
267
+ { TelemetryMeasureName . CommandDurationMs , commandSw . ElapsedMilliseconds } ,
268
+ { TelemetryMeasureName . BatchSize , batchSize } ,
269
+ { TelemetryMeasureName . NumRows , rows . Count }
270
270
} ;
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 } .") ;
273
273
this . _logger . LogDebugWithThreadId ( $ "END UpsertRowsAsync Duration={ upsertRowsAsyncSw . ElapsedMilliseconds } ms") ;
274
274
}
275
275
catch ( Exception ex )
0 commit comments