From 0ac478858d19c17c1422e09d001ad34ad0c0c255 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 14 Apr 2017 20:15:16 -0700 Subject: [PATCH] Fixed benchmarks after refactoring - Added MockTimeoutControl --- .../Mocks/MockTimeoutControl.cs | 22 +++++++++++++++++++ .../RequestParsingBenchmark.cs | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 test/Microsoft.AspNetCore.Server.Kestrel.Performance/Mocks/MockTimeoutControl.cs diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/Mocks/MockTimeoutControl.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/Mocks/MockTimeoutControl.cs new file mode 100644 index 0000000000..3acf5e626c --- /dev/null +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/Mocks/MockTimeoutControl.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance.Mocks +{ + public class MockTimeoutControl : ITimeoutControl + { + public void CancelTimeout() + { + } + + public void ResetTimeout(long ticks, TimeoutAction timeoutAction) + { + } + + public void SetTimeout(long ticks, TimeoutAction timeoutAction) + { + } + } +} diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/RequestParsingBenchmark.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/RequestParsingBenchmark.cs index 593b4b8d46..ab6b4e93d4 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/RequestParsingBenchmark.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/RequestParsingBenchmark.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines; +using Microsoft.AspNetCore.Server.Kestrel.Performance.Mocks; namespace Microsoft.AspNetCore.Server.Kestrel.Performance { @@ -33,6 +34,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance }; Frame = new Frame(application: null, frameContext: frameContext); + Frame.TimeoutControl = new MockTimeoutControl(); PipelineFactory = new PipeFactory(); Pipe = PipelineFactory.Create(); }