Skip to content

Commit 46971f7

Browse files
committed
Merge branch 'master' into deduplication
2 parents 58febea + 90331f9 commit 46971f7

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

Source/Tests/Plugins/DeduplicationBenchmarks.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public DeduplicationBenchmarks() {
2323
}
2424

2525
[Benchmark]
26-
[Fact]
2726
public void LargeEventsFromFiles() {
2827
foreach (var ev in _events) {
2928
var pluginContextData = new ContextData();
@@ -37,22 +36,29 @@ public void LargeEventsFromFiles() {
3736
}
3837
}
3938

39+
private EventBuilder _randomEventBuilder;
40+
private EventBuilder _fixedEventBuilder;
41+
42+
[Setup]
43+
public void Setup() {
44+
_randomEventBuilder = GetException(Guid.NewGuid().ToString()).ToExceptionless();
45+
_fixedEventBuilder = GetException().ToExceptionless();
46+
}
47+
4048
[Benchmark]
41-
[Fact]
4249
public void RandomExceptions() {
43-
var builder = GetException(Guid.NewGuid().ToString()).ToExceptionless();
44-
var context = new EventPluginContext(_client, builder.Target, builder.PluginContextData);
50+
var context = new EventPluginContext(_client, _randomEventBuilder.Target, _randomEventBuilder.PluginContextData);
4551

4652
_errorPlugin.Run(context);
4753
_duplicateCheckerPlugin.Run(context);
4854
}
4955

56+
57+
5058
[Benchmark]
51-
[Fact]
5259
public void IdenticalExceptions()
5360
{
54-
var builder = GetException().ToExceptionless();
55-
var context = new EventPluginContext(_client, builder.Target, builder.PluginContextData);
61+
var context = new EventPluginContext(_client, _fixedEventBuilder.Target, _fixedEventBuilder.PluginContextData);
5662

5763
_errorPlugin.Run(context);
5864
_duplicateCheckerPlugin.Run(context);

Source/Tests/Utility/ErrorDataReader.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Threading.Tasks;
77
using Exceptionless.Extensions;
88
using Exceptionless.Models;
9+
using Exceptionless.Models.Data;
910
using Exceptionless.Serializer;
1011

1112
namespace Exceptionless.Tests.Utility
@@ -21,7 +22,9 @@ static Event GetEvent(string fileName)
2122
{
2223
var json = File.ReadAllText(fileName);
2324
var serializer = GetSerializer();
24-
return serializer.Deserialize<Event>(json);
25+
var ev = serializer.Deserialize<Event>(json);
26+
ev.Data[Event.KnownDataKeys.Error] = ev.Data.GetValue<Error>(Event.KnownDataKeys.Error);
27+
return ev;
2528
}
2629
public static IEnumerable<Event> GetEvents() {
2730
return Directory.EnumerateFiles(@"..\..\ErrorData", "*.json").Select(GetEvent);

0 commit comments

Comments
 (0)