New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect measurement of migration duration in case of execution several expressions #1667
Comments
It should use a PerformanceLogger abstraction that implements IDisposable. Do you want to submit a PR? |
While the problem looks pretty simple, unfortunately, I don't know the FluentMigrator code well enough to suggest a specific fix. |
@OlegUfaev Can you show me the second migration here? I dont think I have enough information to reproduce the problem without a lot of unnecessary guesswork. |
Wait, nevermind, late night coding - I see it now. |
It seems that the way it does this in 'one step' is to create a separate migration expression behind the scenes. Next steps are to figure out why it does not bubble up with the right timing. fluentmigrator/src/FluentMigrator/Builders/ColumnExpressionBuilderHelper.cs Lines 119 to 155 in 4327993
|
We have migration via Fluent API
After performing this migration on our database, we looked at the logs and saw that the overall migration execution time is incorrect. The total migration execution time is about 23 minutes (as you can see from the timestamps in the log or the sum of the durations of the individual commands: 1150+230=1380sec/60=23min), and in the last FluentMigrator record we saw that the duration is barely over the execution time of the last command from the migration.
Expected behavior
The last log entry for this migration shows the total execution time for the entire migration.
Information (please complete the following information):
Additional context
The problem seems to be that you are using the same StopWatch instance in MigrationRunner.cs to measure the execution time of both the entire migration and individual expressions. Thus, the duration of the entire migration is defined as the duration of the last expression + a small quantum of time before the final call to the _stopwatch.Stop() method.
The text was updated successfully, but these errors were encountered: