Skip to content

Commit

Permalink
Merge pull request #119 from CityStructure/cosmosdb-addrate
Browse files Browse the repository at this point in the history
include AddRate when reporting progress
  • Loading branch information
bowencode committed Mar 29, 2024
2 parents 97db9a5 + 963361a commit b25e819
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void ReportCount(int i)
addedCount += i;
if (addedCount % 500 == 0)
{
logger.LogInformation("{AddedCount} records added after {TotalSeconds}s", addedCount, $"{timer.ElapsedMilliseconds / 1000.0:F2}");
logger.LogInformation("{AddedCount} records added after {TotalSeconds}s ({AddRate} records/s)", addedCount, $"{timer.ElapsedMilliseconds / 1000.0:F2}", $"{(int)(addedCount / (timer.ElapsedMilliseconds / 1000.0))}");
}
}

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

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

private static AsyncRetryPolicy GetRetryPolicy(int maxRetryCount, int initialRetryDuration)
Expand Down

0 comments on commit b25e819

Please sign in to comment.