-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance logging for calls to external services (#307)
* added Microsoft.Extensions.Logging.Abstractions dependency * added ILoggerExtensions class used for time tracking * added System.Linq.Async needed in ILogger.TraceTimeAsyncEnumeration * added custom method to log the time needed to complete the FindAllAsync * _logger used to trace time for all awaited calls * removed leftover comment * all awaited calls in EventBus methods wrapped in time tracing _logger statements * tracing the time needed to complete the datawallet modification * Console.WriteLine() statement removed * removed an unnecessary TraceTime() statement * removed TraceTimeAsyncEnumeration() method and its calls * time logged for the whole UploadChangedBlobs() method * saving changes async time elapsed logging (hopefully with latency) * fixing formatting issues * removed redundant logging for blob storage operations * extracted DEBUG_PERFORMANCE into a separate static class * adding interceptors only if DEBUG_PERFORMANCE var is set * Upgrade Helm chart for Consumer API and Admin UI (#316) * feat: set consumer api version to 3.0.0 * feat: set admin ui version to 2.0.0 * EVENT_ID_EXECUTION_TIME extracted into static LogEventIds class * fixing the "Run Admin UI Checks" ci/cd test fail * SaveChangesInterceptor moved to BuildingBlocks.Infrastructure.Persistence.Database * removed the unused _logger reference * unused directives in file removed * performance logging interceptor as DbContextOptionsBuilder extension * unused directives removed from file * performance tracking interceptors added to all db context options * fixed the missing parameter in CreateModification() method * more errors fixed by restoring the class to its original state * fixing the formatting pipeline * refactor: renamed the class to differentiate from built-in SaveChangesInterceptor * refactor: method renamed for consistency fix: AddTransient() changed to TryAddScoped() * fix: added refactored SaveChangesTime Interceptor to all db contexts * fix: fixing the formatting issues that caused the ci/cd test to fail * fix: DeleteRemovedBlobs calls wrapped in _logger.TraceTime() * chore: pin all versions and add comments for them * Revert "chore: pin all versions and add comments for them" This reverts commit 60ee17a. * refactor: add interceptor in Program.cs instead of in each module * refactor: move AddInterceptors call to OnConfiguring method of AbstractDbContextBase * refactor: simplify AddDbContext calls * chore: remove unused references * chore: some minor PR fixes * chore: reformat TraceTime calls * chore: unset DEBUG_PERFORMANCE flag in docker-compsoe.yml * chore: fix formatting * chore: add missing constructors to AdminUiDbContext * fix: use correct migrations assembly for Quotas module * ci: rename containers in docker-compsoe.test.*.yml files * ci: trigger pipelines * fix: readd call to UseNpgsql for Synchronization module * chore: remove duplicated code * test: remove unnecessary constructor parameters * chore: change log message phrasing * test: remove unnecessary parameter * ci: trigger pipelines --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Daniel Almeida <[email protected]> Co-authored-by: Timo Notheisen <[email protected]>
- Loading branch information
1 parent
048624f
commit 40a7fa4
Showing
54 changed files
with
513 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
AdminUi/src/AdminUi/Extensions/QuotasServiceCollectionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
AdminUi/test/AdminUi.Tests.Integration/StepDefinitions/LogsStepDefinitions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...c/BuildingBlocks.Infrastructure/Persistence/Database/DbContextOptionsBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Enmeshed.BuildingBlocks.Infrastructure.Persistence.Database; | ||
|
||
public static class DbContextOptionsBuilderExtensions | ||
{ | ||
public static void AddSaveChangesTimeInterceptor(this DbContextOptionsBuilder builder, IServiceProvider serviceProvider) | ||
{ | ||
builder.AddInterceptors(serviceProvider.GetRequiredService<SaveChangesTimeInterceptor>()); | ||
} | ||
} |
Oops, something went wrong.