4
4
using System . Buffers ;
5
5
using System . IO . Pipelines ;
6
6
using BenchmarkDotNet . Attributes ;
7
+ using Microsoft . AspNetCore . Server . Kestrel . Core ;
7
8
using Microsoft . AspNetCore . Server . Kestrel . Core . Internal . Http ;
8
9
using Microsoft . AspNetCore . Server . Kestrel . Core . Internal . Http2 ;
9
10
using Microsoft . AspNetCore . Server . Kestrel . Core . Internal . Http2 . FlowControl ;
10
11
using Microsoft . AspNetCore . Server . Kestrel . Core . Internal . Infrastructure ;
12
+ using Microsoft . AspNetCore . Testing ;
11
13
using Microsoft . Extensions . Logging . Abstractions ;
12
14
13
15
namespace Microsoft . AspNetCore . Server . Kestrel . Microbenchmarks
@@ -27,6 +29,12 @@ public void GlobalSetup()
27
29
var options = new PipeOptions ( _memoryPool , readerScheduler : PipeScheduler . Inline , writerScheduler : PipeScheduler . Inline , useSynchronizationContext : false ) ;
28
30
_pipe = new Pipe ( options ) ;
29
31
32
+ var serviceContext = TestContextFactory . CreateServiceContext (
33
+ serverOptions : new KestrelServerOptions ( ) ,
34
+ httpParser : new HttpParser < Http1ParsingHandler > ( ) ,
35
+ dateHeaderValueManager : new DateHeaderValueManager ( ) ,
36
+ log : new MockTrace ( ) ) ;
37
+
30
38
_frameWriter = new Http2FrameWriter (
31
39
new NullPipeWriter ( ) ,
32
40
connectionContext : null ,
@@ -36,7 +44,7 @@ public void GlobalSetup()
36
44
minResponseDataRate : null ,
37
45
"TestConnectionId" ,
38
46
_memoryPool ,
39
- new Core . Internal . ServiceContext ( ) ) ;
47
+ serviceContext ) ;
40
48
41
49
_responseHeaders = new HttpResponseHeaders ( ) ;
42
50
_responseHeaders . HeaderContentType = "application/json" ;
0 commit comments