6
6
using Exceptionless . Plugins ;
7
7
using Exceptionless . Plugins . Default ;
8
8
using Exceptionless . Tests . Utility ;
9
+ using Xunit ;
9
10
10
11
namespace Exceptionless . Tests . Plugins {
11
12
public class DeduplicationBenchmarks {
@@ -22,7 +23,8 @@ public DeduplicationBenchmarks() {
22
23
}
23
24
24
25
[ Benchmark ]
25
- public void TestBenchmark1 ( ) {
26
+ [ Fact ]
27
+ public void LargeEventsFromFiles ( ) {
26
28
foreach ( var ev in _events ) {
27
29
var pluginContextData = new ContextData ( ) ;
28
30
@@ -34,5 +36,38 @@ public void TestBenchmark1() {
34
36
}
35
37
}
36
38
}
39
+
40
+ [ Benchmark ]
41
+ [ Fact ]
42
+ public void RandomExceptions ( ) {
43
+ var builder = GetException ( Guid . NewGuid ( ) . ToString ( ) ) . ToExceptionless ( ) ;
44
+ var context = new EventPluginContext ( _client , builder . Target , builder . PluginContextData ) ;
45
+
46
+ _errorPlugin . Run ( context ) ;
47
+ _duplicateCheckerPlugin . Run ( context ) ;
48
+ }
49
+
50
+ [ Benchmark ]
51
+ [ Fact ]
52
+ public void IdenticalExceptions ( )
53
+ {
54
+ var builder = GetException ( ) . ToExceptionless ( ) ;
55
+ var context = new EventPluginContext ( _client , builder . Target , builder . PluginContextData ) ;
56
+
57
+ _errorPlugin . Run ( context ) ;
58
+ _duplicateCheckerPlugin . Run ( context ) ;
59
+ }
60
+
61
+ private Exception GetException ( string message = "Test" )
62
+ {
63
+ try
64
+ {
65
+ throw new Exception ( message ) ;
66
+ }
67
+ catch ( Exception ex )
68
+ {
69
+ return ex ;
70
+ }
71
+ }
37
72
}
38
73
}
0 commit comments