Skip to content

Commit fc1d63f

Browse files
committed
fixup kestrel microbenchmarks
1 parent 8d5ee5d commit fc1d63f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Servers/Kestrel/perf/Microbenchmarks/Http2FrameWriterBenchmark.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
using System.Buffers;
55
using System.IO.Pipelines;
66
using BenchmarkDotNet.Attributes;
7+
using Microsoft.AspNetCore.Server.Kestrel.Core;
78
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
89
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2;
910
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl;
1011
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
12+
using Microsoft.AspNetCore.Testing;
1113
using Microsoft.Extensions.Logging.Abstractions;
1214

1315
namespace Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks
@@ -27,6 +29,12 @@ public void GlobalSetup()
2729
var options = new PipeOptions(_memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
2830
_pipe = new Pipe(options);
2931

32+
var serviceContext = TestContextFactory.CreateServiceContext(
33+
serverOptions: new KestrelServerOptions(),
34+
httpParser: new HttpParser<Http1ParsingHandler>(),
35+
dateHeaderValueManager: new DateHeaderValueManager(),
36+
log: new MockTrace());
37+
3038
_frameWriter = new Http2FrameWriter(
3139
new NullPipeWriter(),
3240
connectionContext: null,
@@ -36,7 +44,7 @@ public void GlobalSetup()
3644
minResponseDataRate: null,
3745
"TestConnectionId",
3846
_memoryPool,
39-
new Core.Internal.ServiceContext());
47+
serviceContext);
4048

4149
_responseHeaders = new HttpResponseHeaders();
4250
_responseHeaders.HeaderContentType = "application/json";

src/Servers/Kestrel/perf/Microbenchmarks/ResponseHeaderCollectionBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public void Setup()
179179
var serviceContext = TestContextFactory.CreateServiceContext(
180180
serverOptions: new KestrelServerOptions(),
181181
httpParser: new HttpParser<Http1ParsingHandler>(),
182-
dateHeaderValueManager: new DateHeaderValueManager(),
182+
dateHeaderValueManager: _dateHeaderValueManager,
183183
log: new MockTrace());
184184

185185
var connectionContext = TestContextFactory.CreateHttpConnectionContext(

0 commit comments

Comments
 (0)