diff --git a/AbParse/Program.cs b/AbParse/Program.cs index 489f192..fd7602f 100644 --- a/AbParse/Program.cs +++ b/AbParse/Program.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Text; @@ -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; } diff --git a/AspNetFrameworksPerformance.sln b/AspNetFrameworksPerformance.sln index 04ae4ac..a175016 100644 --- a/AspNetFrameworksPerformance.sln +++ b/AspNetFrameworksPerformance.sln @@ -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 @@ -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 diff --git a/HeliosSample/HeliosSample.csproj b/HeliosSample/HeliosSample.csproj index 5c65888..a46b826 100644 --- a/HeliosSample/HeliosSample.csproj +++ b/HeliosSample/HeliosSample.csproj @@ -15,7 +15,7 @@ HeliosSample HeliosSample v4.5.1 - false + true @@ -111,7 +111,7 @@ True 27497 / - http://localhost/HeliosSample + http://localhost:27497/ False False diff --git a/LoadTests/AbParse.exe b/LoadTests/AbParse.exe index be72a53..b3fc623 100644 Binary files a/LoadTests/AbParse.exe and b/LoadTests/AbParse.exe differ diff --git a/LoadTests/ab_Nowin.bat b/LoadTests/ab_Nowin.bat new file mode 100644 index 0000000..15b974f --- /dev/null +++ b/LoadTests/ab_Nowin.bat @@ -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 diff --git a/NowinSample/App.config b/NowinSample/App.config new file mode 100644 index 0000000..0e899e9 --- /dev/null +++ b/NowinSample/App.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NowinSample/NowinSample.csproj b/NowinSample/NowinSample.csproj new file mode 100644 index 0000000..b8d86e0 --- /dev/null +++ b/NowinSample/NowinSample.csproj @@ -0,0 +1,95 @@ + + + + + Debug + AnyCPU + {B93C6B61-24C3-4732-AC4D-9A42FA05BC8F} + Exe + Properties + NowinSample + NowinSample + v4.5 + 512 + ..\ + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll + + + ..\packages\Microsoft.Owin.Diagnostics.2.0.2\lib\net40\Microsoft.Owin.Diagnostics.dll + + + ..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll + + + ..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll + + + ..\packages\Nowin.0.11.0.0\lib\net45\Nowin.dll + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + + + + + + False + ..\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll + + + False + ..\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.0.0\lib\net45\System.Web.Http.Owin.dll + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NowinSample/Person.cs b/NowinSample/Person.cs new file mode 100644 index 0000000..9cd7337 --- /dev/null +++ b/NowinSample/Person.cs @@ -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; } + } +} diff --git a/NowinSample/Program.cs b/NowinSample/Program.cs new file mode 100644 index 0000000..0abc91d --- /dev/null +++ b/NowinSample/Program.cs @@ -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(options)) + { + Console.WriteLine("Running a http server on port 8080"); + Console.ReadKey(); + } + + } + } +} diff --git a/NowinSample/Properties/AssemblyInfo.cs b/NowinSample/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..97e7c1d --- /dev/null +++ b/NowinSample/Properties/AssemblyInfo.cs @@ -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")] diff --git a/NowinSample/Startup.cs b/NowinSample/Startup.cs new file mode 100644 index 0000000..bdee631 --- /dev/null +++ b/NowinSample/Startup.cs @@ -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 = "

Helios Vars

"; + await context.Response.WriteAsync(header); + + foreach (KeyValuePair keyvalue in context.Environment) + { + if (keyvalue.Value == null) + continue; + + string t = keyvalue.Key + ": " + keyvalue.Value.ToString() + "
\r\n"; + + await context.Response.WriteAsync(t); + //await Task.Delay(1000); // no output buffering - text just goes + } + + await context.Response.WriteAsync(""); + }); + + + } + + } +} diff --git a/NowinSample/TestController.cs b/NowinSample/TestController.cs new file mode 100644 index 0000000..1748f7c --- /dev/null +++ b/NowinSample/TestController.cs @@ -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(); + } + + + } +} \ No newline at end of file diff --git a/NowinSample/packages.config b/NowinSample/packages.config new file mode 100644 index 0000000..208aaf5 --- /dev/null +++ b/NowinSample/packages.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file