Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AbParse/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -68,7 +69,7 @@ public static void ParseFiles(AbParseCommandLineParser cl)
var req = StringUtils.ExtractString(line, ":", "[");
req = req.Trim();
decimal rps = 0;
decimal.TryParse(req, out rps);
decimal.TryParse(req, NumberStyles.Any, NumberFormatInfo.InvariantInfo, out rps);
testInfo.RequestsPerSecond = rps;
}

Expand Down
6 changes: 6 additions & 0 deletions AspNetFrameworksPerformance.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbParse", "AbParse\AbParse.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeliosSample", "HeliosSample\HeliosSample.csproj", "{FC61909E-38A4-43D0-8DCD-F0072B37B687}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NowinSample", "NowinSample\NowinSample.csproj", "{B93C6B61-24C3-4732-AC4D-9A42FA05BC8F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -35,6 +37,10 @@ Global
{FC61909E-38A4-43D0-8DCD-F0072B37B687}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC61909E-38A4-43D0-8DCD-F0072B37B687}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC61909E-38A4-43D0-8DCD-F0072B37B687}.Release|Any CPU.Build.0 = Release|Any CPU
{B93C6B61-24C3-4732-AC4D-9A42FA05BC8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B93C6B61-24C3-4732-AC4D-9A42FA05BC8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B93C6B61-24C3-4732-AC4D-9A42FA05BC8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B93C6B61-24C3-4732-AC4D-9A42FA05BC8F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions HeliosSample/HeliosSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<RootNamespace>HeliosSample</RootNamespace>
<AssemblyName>HeliosSample</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<UseIISExpress>false</UseIISExpress>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
Expand Down Expand Up @@ -111,7 +111,7 @@
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>27497</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost/HeliosSample</IISUrl>
<IISUrl>http://localhost:27497/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
Expand Down
Binary file modified LoadTests/AbParse.exe
Binary file not shown.
39 changes: 39 additions & 0 deletions LoadTests/ab_Nowin.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
REM make sure you add
REM C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin
REM to your path so ab.exe can be found
REM Start NowinSample.exe and have free port 8080

del *.txt
del AbParseResults.*

REM Warm up

ab.exe -n100 -c20 http://localhost:8080/test/person/ > NowinWebApiJson.txt
ab.exe -n20000 -c20 http://localhost:8080/test/person/ > NowinWebApiJson.txt

ab.exe -n100 -c20 http://localhost:8080/
ab.exe -n20000 -c20 http://localhost:8080/ > Nowin.txt

ab.exe -n100 -c20 http://localhost:8080/aspnetperf/handler.ashx
ab.exe -n20000 -c20 http://localhost:8080/aspnetperf/handler.ashx > HttpHandler.txt

ab.exe -n100 -c20 http://localhost:8080/aspnetperf/Handler.ashx?action=json
ab.exe -n20000 -c20 http://localhost:8080/aspnetperf/Handler.ashx?action=json > HandlerJson.txt

ab.exe -n100 -c20 http://localhost:8080/aspnetperf/api/HelloWorldCode/
ab.exe -n20000 -c20 http://localhost:8080/aspnetperf/api/HelloWorldCode/ > WebApi.txt

ab.exe -n100 -c20 http://localhost:8080/aspnetperf/api/HelloWorldJson/
ab.exe -n20000 -c20 http://localhost:8080/aspnetperf/api/HelloWorldJson/ > WebApiJson.txt

ab.exe -n100 -c20 http://localhost:8080/aspnetperf/MvcPerformance/HelloWorldCode/
ab.exe -n20000 -c20 http://localhost:8080/aspnetperf/MvcPerformance/HelloWorldCode/ > Mvc.txt

ab.exe -n100 -c20 http://localhost:8080/aspnetperf/MvcPerformance/HelloWorldJson
ab.exe -n20000 -c20 http://localhost:8080/aspnetperf/MvcPerformance/HelloWorldJson > MvcJson.txt

abParse -i"*.txt" -o"AbParseResults.html" -m"html"
abParse -i"*.txt" -o"AbParseResults.csv" -m"csv"
abParse -i"*.txt" -o"AbParseResults.xml" -m"xml"

abparseresults.html
14 changes: 14 additions & 0 deletions NowinSample/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
95 changes: 95 additions & 0 deletions NowinSample/NowinSample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B93C6B61-24C3-4732-AC4D-9A42FA05BC8F}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NowinSample</RootNamespace>
<AssemblyName>NowinSample</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Owin">
<HintPath>..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Diagnostics">
<HintPath>..\packages\Microsoft.Owin.Diagnostics.2.0.2\lib\net40\Microsoft.Owin.Diagnostics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Hosting">
<HintPath>..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Nowin">
<HintPath>..\packages\Nowin.0.11.0.0\lib\net45\Nowin.dll</HintPath>
</Reference>
<Reference Include="Owin">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.Owin">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Owin.5.0.0\lib\net45\System.Web.Http.Owin.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Person.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
<Compile Include="TestController.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
21 changes: 21 additions & 0 deletions NowinSample/Person.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NowinSample
{
public class Person
{
public Person()
{
Id = 10;
Name = "Rick";
Entered = DateTime.Now;
}

public int Id { get; set; }
public string Name { get; set; }
public DateTime Entered { get; set; }
}
}
24 changes: 24 additions & 0 deletions NowinSample/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using Microsoft.Owin.Hosting;

namespace NowinSample
{
class Program
{
static void Main(string[] args)
{
var options = new StartOptions
{
ServerFactory = "Nowin",
Port = 8080
};

using (WebApp.Start<Startup>(options))
{
Console.WriteLine("Running a http server on port 8080");
Console.ReadKey();
}

}
}
}
36 changes: 36 additions & 0 deletions NowinSample/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NowinSample")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NowinSample")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1cc3925f-f53c-4380-a26d-77bd9725b73f")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
53 changes: 53 additions & 0 deletions NowinSample/Startup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using Microsoft.Owin;
using System.Web.Http;
using Owin;

namespace NowinSample
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
//app.UseErrorPage();
//app.UseWelcomePage();

// Configure Web API for self-host.
HttpConfiguration config = new HttpConfiguration();
config.MapHttpAttributeRoutes();
config.Formatters.Remove(config.Formatters.XmlFormatter);
app.UseWebApi(config);



app.Run(async (context) => // IOWinContext
{
context.Response.StatusCode = 200;
context.Response.ContentType = "text/html";

await context.Response.WriteAsync("Hello World. Time is: " + DateTime.Now.ToString());
return;

string header = "<html><body><h1>Helios Vars</h1>";
await context.Response.WriteAsync(header);

foreach (KeyValuePair<string, object> keyvalue in context.Environment)
{
if (keyvalue.Value == null)
continue;

string t = keyvalue.Key + ": " + keyvalue.Value.ToString() + "<hr />\r\n";

await context.Response.WriteAsync(t);
//await Task.Delay(1000); // no output buffering - text just goes
}

await context.Response.WriteAsync("</body></html>");
});


}

}
}
35 changes: 35 additions & 0 deletions NowinSample/TestController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.Http;

namespace NowinSample
{
public class TestController : ApiController
{
[HttpGet]
[Route("test/HelloWorld/{name?}")]
public string HelloWorld(string name = null)
{
return "Hello cruel World, " + name + ". " + DateTime.Now;
}

[HttpGet]
[Route("test/WorkingSet")]
public string WorkingSet()
{
return "Helios - Working set is: " + Process.GetCurrentProcess().WorkingSet.ToString("n0") + " bytes";
}

[HttpGet]
[Route("test/Person")]
public Person GetPerson()
{
return new Person();
}


}
}
12 changes: 12 additions & 0 deletions NowinSample/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.WebApi.Client" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Owin" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.Owin" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Owin.Diagnostics" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Owin.Hosting" version="2.0.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="5.0.8" targetFramework="net45" />
<package id="Nowin" version="0.11.0.0" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
</packages>