Skip to content

Commit

Permalink
Fix microbenchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed May 8, 2024
1 parent 002723c commit 3bad225
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Microsoft.Extensions.Primitives;
using Microsoft.Net.Http.Headers;
using Http2HeadersEnumerator = Microsoft.AspNetCore.Server.Kestrel.Core.Tests.Http2HeadersEnumerator;
using Microsoft.AspNetCore.Connections.Features;

namespace Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks;

Expand Down Expand Up @@ -75,6 +76,8 @@ public virtual void GlobalSetup()

var featureCollection = new FeatureCollection();
featureCollection.Set<IConnectionMetricsContextFeature>(new TestConnectionMetricsContextFeature());
featureCollection.Set<IConnectionMetricsTagsFeature>(new TestConnectionMetricsTagsFeature());
featureCollection.Set<IProtocolErrorCodeFeature>(new TestProtocolErrorCodeFeature());
var connectionContext = TestContextFactory.CreateHttpConnectionContext(
serviceContext: serviceContext,
connectionContext: null,
Expand Down Expand Up @@ -191,4 +194,14 @@ private sealed class TestConnectionMetricsContextFeature : IConnectionMetricsCon
{
public ConnectionMetricsContext MetricsContext { get; }
}

private sealed class TestConnectionMetricsTagsFeature : IConnectionMetricsTagsFeature
{
public ICollection<KeyValuePair<string, object>> Tags { get; }
}

private sealed class TestProtocolErrorCodeFeature : IProtocolErrorCodeFeature
{
public long Error { get; set; } = -1;
}
}

0 comments on commit 3bad225

Please sign in to comment.