forked from dotnet/BenchmarkDotNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c963ba
commit ab86077
Showing
9 changed files
with
203 additions
and
13 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
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
78 changes: 78 additions & 0 deletions
78
src/BenchmarkDotNet/Running/CompositeBenchmarkEventHandler.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,78 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using BenchmarkDotNet.Reports; | ||
using BenchmarkDotNet.Toolchains.Results; | ||
using BenchmarkDotNet.Validators; | ||
|
||
namespace BenchmarkDotNet.Running | ||
{ | ||
public class CompositeBenchmarkEventHandler : IBenchmarkEventHandler | ||
{ | ||
private readonly IReadOnlyCollection<IBenchmarkEventHandler> eventHandlers; | ||
|
||
public CompositeBenchmarkEventHandler(IReadOnlyCollection<IBenchmarkEventHandler> eventHandlers) | ||
{ | ||
this.eventHandlers = eventHandlers; | ||
} | ||
|
||
public void HandleStartValidationStage() | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleStartValidationStage(); | ||
} | ||
|
||
public void HandleUnsupportedBenchmark(BenchmarkCase benchmarkCase) | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleUnsupportedBenchmark(benchmarkCase); | ||
} | ||
|
||
public void HandleValidationError(ValidationError validationError) | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleValidationError(validationError); | ||
} | ||
|
||
public void HandleStartBuildStage() | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleStartBuildStage(); | ||
} | ||
|
||
public void HandleBuildFailed(BenchmarkCase benchmarkCase, BuildResult buildResult) | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleBuildFailed(benchmarkCase, buildResult); | ||
} | ||
|
||
public void HandleStartRunStage() | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleStartRunStage(); | ||
} | ||
|
||
public void HandleRunBenchmarksInType(Type type, IReadOnlyList<BenchmarkCase> benchmarks) | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleRunBenchmarksInType(type, benchmarks); | ||
} | ||
|
||
public void HandleCompletedBenchmarksInType(Type type, Summary summary) | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleCompletedBenchmarksInType(type, summary); | ||
} | ||
|
||
public void HandleCompletedBenchmark(BenchmarkCase benchmarkCase, BenchmarkReport report) | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleCompletedBenchmark(benchmarkCase, report); | ||
} | ||
|
||
public void HandleRunBenchmark(BenchmarkCase benchmarkCase) | ||
{ | ||
foreach (var eventHandler in eventHandlers) | ||
eventHandler.HandleRunBenchmark(benchmarkCase); | ||
} | ||
} | ||
} |
Oops, something went wrong.