Skip to content

Commit b25e819

Browse files
authored
Merge pull request AzureCosmosDB#119 from CityStructure/cosmosdb-addrate
include AddRate when reporting progress
2 parents 97db9a5 + 963361a commit b25e819

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosDataSinkExtension.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void ReportCount(int i)
8989
addedCount += i;
9090
if (addedCount % 500 == 0)
9191
{
92-
logger.LogInformation("{AddedCount} records added after {TotalSeconds}s", addedCount, $"{timer.ElapsedMilliseconds / 1000.0:F2}");
92+
logger.LogInformation("{AddedCount} records added after {TotalSeconds}s ({AddRate} records/s)", addedCount, $"{timer.ElapsedMilliseconds / 1000.0:F2}", $"{(int)(addedCount / (timer.ElapsedMilliseconds / 1000.0))}");
9393
}
9494
}
9595

@@ -111,7 +111,7 @@ void ReportCount(int i)
111111
throw new Exception($"Only {addedCount} of {inputCount} records were added to Cosmos");
112112
}
113113

114-
logger.LogInformation("Added {AddedCount} total records in {TotalSeconds}s", addedCount, $"{timer.ElapsedMilliseconds / 1000.0:F2}");
114+
logger.LogInformation("Added {AddedCount} total records in {TotalSeconds}s ({AddRate} records/s)", addedCount, $"{timer.ElapsedMilliseconds / 1000.0:F2}", $"{(int)(addedCount / (timer.ElapsedMilliseconds / 1000.0))}");
115115
}
116116

117117
private static AsyncRetryPolicy GetRetryPolicy(int maxRetryCount, int initialRetryDuration)

0 commit comments

Comments
 (0)