Skip to content

Commit

Permalink
Dispose loggerFactory in benchmark (#5330)
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang committed Feb 9, 2024
1 parent 5ac06dd commit 93038e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/Benchmarks/Logs/LogBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ public LogBenchmarks()
this.loggerWithThreeProcessors = this.loggerFactoryWithThreeProcessor.CreateLogger<LogBenchmarks>();
}

[GlobalCleanup]
public void GlobalCleanup()
{
this.loggerFactoryWithNoListener.Dispose();
this.loggerFactoryWithOneProcessor.Dispose();
this.loggerFactoryWithTwoProcessor.Dispose();
this.loggerFactoryWithThreeProcessor.Dispose();
}

[Benchmark]
public void NoListenerStringInterpolation()
{
Expand Down

0 comments on commit 93038e2

Please sign in to comment.