|
10 | 10 | namespace Exceptionless.Tests.Plugins {
|
11 | 11 | public class DeduplicationBenchmarks {
|
12 | 12 | private readonly List<Event> _events;
|
| 13 | + private readonly ExceptionlessClient _client; |
| 14 | + private readonly ErrorPlugin _errorPlugin; |
| 15 | + private readonly DuplicateCheckerPlugin _duplicateCheckerPlugin; |
| 16 | + |
13 | 17 | public DeduplicationBenchmarks() {
|
14 | 18 | _events = ErrorDataReader.GetEvents().ToList();
|
| 19 | + _client = new ExceptionlessClient(); |
| 20 | + _errorPlugin = new ErrorPlugin(); |
| 21 | + _duplicateCheckerPlugin = new DuplicateCheckerPlugin(); |
15 | 22 | }
|
16 | 23 |
|
17 | 24 | [Benchmark]
|
18 | 25 | public void TestBenchmark1() {
|
19 |
| - var client = new ExceptionlessClient(); |
20 |
| - var errorPlugin = new ErrorPlugin(); |
21 |
| - var duplicateCheckerPlugin = new DuplicateCheckerPlugin(); |
22 |
| - |
23 | 26 | foreach (var ev in _events) {
|
24 | 27 | var pluginContextData = new ContextData();
|
25 | 28 |
|
26 | 29 | for (int index = 0; index < 2; index++) {
|
27 |
| - var context = new EventPluginContext(client, ev, pluginContextData); |
| 30 | + var context = new EventPluginContext(_client, ev, pluginContextData); |
28 | 31 |
|
29 |
| - errorPlugin.Run(context); |
30 |
| - duplicateCheckerPlugin.Run(context); |
| 32 | + _errorPlugin.Run(context); |
| 33 | + _duplicateCheckerPlugin.Run(context); |
31 | 34 | }
|
32 | 35 | }
|
33 | 36 | }
|
|
0 commit comments