Browse Source

Merge branch 'master' into python-r10

Conflicts:
	toolset/setup/linux/installer.py
	tornado/server.py
INADA Naoki 11 years ago
parent
commit
9096c720a7
100 changed files with 2138 additions and 266 deletions
  1. 6 0
      WeberFramework/.gitignore
  2. 2 0
      WeberFramework/README.md
  3. 24 0
      WeberFramework/benchmark_config
  4. 0 0
      WeberFramework/lang/.gitkeep
  5. 18 0
      WeberFramework/lib/app.ex
  6. 36 0
      WeberFramework/lib/config.ex
  7. 0 0
      WeberFramework/lib/controllers/.keep
  8. 13 0
      WeberFramework/lib/controllers/main.ex
  9. 0 0
      WeberFramework/lib/helpers/.keep
  10. 0 0
      WeberFramework/lib/models/.keep
  11. 9 0
      WeberFramework/lib/route.ex
  12. 0 0
      WeberFramework/lib/views/.keep
  13. 235 0
      WeberFramework/lib/views/Main.html
  14. 0 0
      WeberFramework/lib/views/layout/.keep
  15. 24 0
      WeberFramework/mix.exs
  16. 0 0
      WeberFramework/public/css/.keep
  17. 0 0
      WeberFramework/public/img/.keep
  18. BIN
      WeberFramework/public/img/favicon.ico
  19. 235 0
      WeberFramework/public/index.html
  20. 0 0
      WeberFramework/public/js/.keep
  21. 18 0
      WeberFramework/setup_weber.py
  22. 7 0
      WeberFramework/start.sh
  23. 7 0
      WeberFramework/test/WeberFramework_test.exs
  24. 1 0
      WeberFramework/test/test_helper.exs
  25. 8 7
      config/benchmark_profile
  26. 1 1
      config/postgresql.conf
  27. 7 0
      curacao/.gitignore
  28. 24 0
      curacao/README.md
  29. 0 0
      curacao/__init__.py
  30. 24 0
      curacao/benchmark_config
  31. 35 0
      curacao/build.sbt
  32. 1 0
      curacao/project/build.properties
  33. 3 0
      curacao/project/plugins.sbt
  34. 35 0
      curacao/setup.py
  35. 5 0
      curacao/source_code
  36. 21 0
      curacao/src/main/java/benchmark/Benchmarks.java
  37. 52 0
      curacao/src/main/java/benchmark/Bootstrap.java
  38. 21 0
      curacao/src/main/java/benchmark/entities/HelloWorld.java
  39. 12 0
      curacao/src/main/resources/application.conf
  40. 23 0
      curacao/src/main/resources/logback.xml
  41. 0 0
      dropwizard-mongodb/__init__.py
  42. 25 0
      dropwizard-mongodb/benchmark_config
  43. 20 0
      dropwizard-mongodb/hello-world.yml
  44. 84 0
      dropwizard-mongodb/pom.xml
  45. 23 0
      dropwizard-mongodb/setup.py
  46. 11 0
      dropwizard-mongodb/source_code
  47. 27 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldConfiguration.java
  48. 47 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldService.java
  49. 40 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/core/World.java
  50. 21 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoHealthCheck.java
  51. 23 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoManaged.java
  52. 30 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/resources/JsonResource.java
  53. 47 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/resources/WorldResource.java
  54. 1 1
      grails/README.md
  55. 0 16
      grails/hello/.classpath
  56. 2 0
      grails/hello/.gitignore
  57. 0 25
      grails/hello/.project
  58. 2 2
      grails/hello/application.properties
  59. 3 3
      grails/hello/grails-app/conf/BuildConfig.groovy
  60. 0 19
      grails/hello/grails-app/conf/JsonWorkaroundBootStrap.groovy
  61. 9 15
      grails/hello/grails-app/controllers/hello/HelloController.groovy
  62. 5 5
      hapi/app.js
  63. 2 2
      netty/README.md
  64. 74 68
      netty/pom.xml
  65. 1 1
      netty/setup.py
  66. 1 0
      netty/source_code
  67. 42 43
      netty/src/main/java/hello/HelloServerHandler.java
  68. 8 1
      netty/src/main/java/hello/HelloServerInitializer.java
  69. 37 16
      netty/src/main/java/hello/HelloWebServer.java
  70. 15 0
      netty/src/main/java/hello/Message.java
  71. 2 3
      openresty/nginx.conf
  72. 7 0
      php-zend-framework/.gitignore
  73. 0 0
      php-zend-framework/__init__.py
  74. 25 0
      php-zend-framework/benchmark_config
  75. 19 0
      php-zend-framework/composer.json
  76. 16 0
      php-zend-framework/config/application.config.php
  77. 0 0
      php-zend-framework/config/autoload/.gitkeep
  78. 10 0
      php-zend-framework/config/autoload/benchmarks.local.php
  79. 1 0
      php-zend-framework/data/cache/.gitignore
  80. 133 0
      php-zend-framework/deploy/nginx.conf
  81. 9 0
      php-zend-framework/deploy/php-zend-framework
  82. 63 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Controller/DbController.php
  83. 23 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Controller/JsonController.php
  84. 41 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Entity/World.php
  85. 78 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Module.php
  86. 43 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/ServiceFactory/DbControllerServiceFactory.php
  87. 16 0
      php-zend-framework/public/.htaccess
  88. 6 0
      php-zend-framework/public/index.php
  89. 27 0
      php-zend-framework/setup.py
  90. 2 1
      ringojs-convenient/app/models.js
  91. 1 8
      ringojs-convenient/app/views.js
  92. 1 1
      ringojs-convenient/setup.py
  93. 2 1
      ringojs/ringo-main.js
  94. 1 1
      ringojs/setup.py
  95. BIN
      sbt/sbt-launch.jar
  96. 2 2
      toolset/README.md
  97. 1 2
      toolset/benchmark/benchmarker.py
  98. 44 14
      toolset/run-tests.py
  99. 37 8
      toolset/setup/linux/installer.py
  100. 21 0
      tornado/benchmark_config

+ 6 - 0
WeberFramework/.gitignore

@@ -0,0 +1,6 @@
+/ebin
+/deps
+erl_crash.dump
+/tmp
+_build
+/logs

+ 2 - 0
WeberFramework/README.md

@@ -0,0 +1,2 @@
+WeberFramework
+=====

+ 24 - 0
WeberFramework/benchmark_config

@@ -0,0 +1,24 @@
+{
+  "framework": "weber",
+  "tests": [{
+    "default": {
+      "setup_file": "setup_weber",
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "Postgres",
+      "framework": "weber",
+      "language": "Elixir",
+      "orm": "Raw",
+      "platform": "Cowboy",
+      "webserver": "Cowboy",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "weber",
+      "notes": "",
+      "versus": "",
+      "skip": "false"
+  }}]
+}

+ 0 - 0
WeberFramework/lang/.gitkeep


+ 18 - 0
WeberFramework/lib/app.ex

@@ -0,0 +1,18 @@
+defmodule WeberFramework do
+
+  require Weber.Templates.ViewsLoader
+  
+  def start(_type, _args) do
+    # Set resources
+    Weber.Templates.ViewsLoader.set_up_resources(File.cwd!)
+    # compile all views
+    Weber.Templates.ViewsLoader.compile_views(File.cwd!)
+    # start weber application
+    Weber.run_weber
+  end
+
+  def stop(_state) do
+    :ok
+  end
+  
+end

+ 36 - 0
WeberFramework/lib/config.ex

@@ -0,0 +1,36 @@
+defmodule Config do 
+
+  def config do
+    [webserver: 
+      [http_host: "localhost", 
+       http_port: 8080,
+       acceptors: 100,
+       ssl: false,
+       cacertfile_path: "",
+       certfile_path: "",
+       keyfile_path: ""
+      ],
+    ws: 
+      [ws_port: 8080,
+       ws_mod: :Handler
+      ],
+    use_internationalization: false,
+    localization:
+      [default_locale: :en_US,
+       use_locales: [:en_US]
+      ],
+    use_sessions: false,
+    session:
+      [max_age: 1440
+      ],
+    db:
+      [
+        db_host: "",
+        db_port: 5000,
+        db_username: "",
+        db_password: ""
+      ],
+    ]
+  end
+
+end

+ 0 - 0
WeberFramework/lib/controllers/.keep


+ 13 - 0
WeberFramework/lib/controllers/main.ex

@@ -0,0 +1,13 @@
+defmodule WeberFramework.Main do
+  
+  use Weber.Controller
+
+  def action_json(_, _) do
+    {:json, [message: "Hello, world!"], [{"Content-type", "application/json"}]}
+  end
+
+  def action_text(_, _) do
+  	{:text, "Hello, world!", [{"Content-type", "text/plain"}]}
+  end
+
+end

+ 0 - 0
WeberFramework/lib/helpers/.keep


+ 0 - 0
WeberFramework/lib/models/.keep


+ 9 - 0
WeberFramework/lib/route.ex

@@ -0,0 +1,9 @@
+defmodule Route do
+
+  import Weber.Route
+  require Weber.Route
+  
+  route on("GET", "/json", :WeberFramework.Main, :action_json)
+     |> on("GET", "/plaintext", :WeberFramework.Main, :action_text)
+
+end

+ 0 - 0
WeberFramework/lib/views/.keep


+ 235 - 0
WeberFramework/lib/views/Main.html

@@ -0,0 +1,235 @@
+<!DOCTYPE html>
+<html itemscope itemtype="http://schema.org/WebPage" lang="en">
+
+<head>
+  <meta charset="utf-8">
+  <title>Welcome to Weber!</title>
+  <link href="img/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
+
+  <style>
+    /* Reset */
+    * {
+      margin: 0;
+      padding: 0;
+    }
+
+    /* Default */
+    body {
+      font: normal 13px proxima-nova, sans-serif;
+      color: #666;
+    }
+
+    a {
+      color: #4c0066;
+    }
+
+    code, pre {
+      background: #f9f9f9;
+      border: 1px solid #ddd;
+      border-radius: 3px;
+      display: block;
+      font-family: monospace;
+      margin: 5px 0;
+      padding: 20px 0 20px 30px;
+      white-space: pre;
+    }
+
+    blockquote {
+      background: #f9f9f9;
+      border-left: 10px solid #eee;
+      border-radius: 3px;
+      color: #888;
+      margin: 20px 0 20px 20px;
+      padding: 10px 12px;
+      quotes: "\201C""\201D""\2018""\2019";
+    }
+
+    blockquote:before {
+      color: #ccc;
+      content: open-quote;
+      font-size: 55px;
+      line-height: 1px;
+      margin-right: 15px;
+      vertical-align: -25px;
+    }
+
+    blockquote p {
+      display: inline;
+    }
+
+    p {
+      font-size: 120%;
+      line-height: 25px;
+      margin: 10px 0;
+    }
+
+    /* Classes */
+    .content {
+      margin: 0 auto;
+      padding: 0 10px;
+      width: 960px;
+    }
+
+    /* Structure */
+    header:after, main:after,
+    header:before, main:before {
+      content: " ";
+      display: table;
+    }
+
+    header:after, main:after {
+      clear: both;
+    }
+
+    header {
+      background: #4c0066;
+      height: 150px;
+      margin-bottom: 50px;
+    }
+
+    header .logo {
+      border-radius: 100%;
+      display: block;
+      float: left;
+      padding-top: 25px;
+    }
+
+    header .title {
+      color: #fff;
+      float: left;
+      line-height: 30px;
+      margin: 101px 0 0;
+      text-align: right;
+      width: 660px;
+    }
+
+    header .title h1 {
+      font-size: 100px;
+    }
+
+    main .guide {
+      float: right;
+      width: 610px;
+    }
+
+    main .guide article {
+      margin-bottom: 50px;
+    }
+
+    main .guide h3 {
+      color: #4c0066;
+      font-size: 150%;
+      text-transform: uppercase;
+    }
+
+    main aside {
+      float: left;
+      margin-right: 50px;
+      width: 300px;
+    }
+
+    .sidebar-box {
+      margin: 25px 20px;
+    }
+
+    .sidebar-box h3 {
+      font-size: 110%;
+      margin-bottom: 5px;
+      text-transform: uppercase;
+    }
+
+    .sidebar-box p {
+      font-size: 90%;
+      line-height: 100%;
+      margin: 0;
+    }
+
+    .sidebar-box ol {
+      background: #f9f9f9;
+      border: 1px solid #eee;
+      border-radius: 3px;
+      list-style: none;
+    }
+    
+    .sidebar-box ol a {
+      border-bottom: 1px solid #eee;
+      display: block;
+      padding: 10px 10px;
+      text-decoration: none;
+    }
+    
+    .sidebar-box ol li:last-child a {
+      border-bottom: none;
+    }
+
+    .sidebar-box ol a:hover {
+      background: #f5f5f5;
+    }
+
+    li {
+      margin-left: 20px;
+      font-size: 120%;
+    }
+
+    h4 {
+      font-size: 120%;
+    }
+
+
+  </style>
+</head>
+
+<body>
+  <header role="banner">
+    <div class="content">
+      <a class="logo" href="http://0xAX.github.io/weber" target="_blank">
+        <svg height="300" width="300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+          <g>
+            <circle cx="150" cy="150" fill="#4c0066" r="147" stroke="#ffffff" stroke-width="6" />
+            <path d="M191.75,213.42l34.57-126.24c2.39-8.71-4.36-15.78-15.08-15.78c-10.721,0-21.02,7.06-23.01,15.78l-28.82,126.24c-1.99,8.71,3.47,15.78,12.21,15.78C180.35,229.2,189.359,222.141,191.75,213.42z" fill="#ffffff" />
+            <path d="M148.77,213.42l26.74-126.24c1.85-8.71-5.289-15.78-15.939-15.78c-10.66,0-20.47,7.06-21.92,15.78l-21.03,126.24c-1.45,8.71,4.41,15.78,13.09,15.78S146.92,222.141,148.77,213.42z" fill="#ffffff" />
+            <path d="M106.05,213.45l4.78-31.511c1.33-8.689-5.28-15.739-14.76-15.739c-9.47,0-17.9,7.05-18.82,15.739l-3.36,31.511c-0.92,8.7,5.36,15.75,14.05,15.75C96.62,229.2,104.73,222.15,106.05,213.45z" fill="#ffffff" />
+          </g>
+        </svg>
+      </a>
+
+      <div class="title">
+        <h1 style="margin-top: -20px;">Weber</h1>
+      </div>
+    </div>
+  </header>
+
+  <main class="content" role="main">
+    <div class="guide">
+      <article id="getting-started">
+        <h3>Getting started</h3>
+        <p>Welcome to the default <a href="https://github.com/0xAX/weber">Weber's</a> page. Weber is a MVC Rails like web framework which was built with <a href="http://elixir-lang.org/">Elixir</a> programming language. Build web applications quickly and efficiently as possible. Let's build Web with Elixir.</p>
+        <h4>Weber features:</h4>
+        <br/>
+        <ul>
+          <li>MVC web framework;</li>
+          <li>New project generation;</li>
+          <li>Json generation with exjson;</li>
+          <li>Websocket support;</li>
+          <li>HTML helpers;</li>
+          <li>Site internationalization</li>
+          <li>Sessions support;</li>
+          <li>and many more</li>
+        </ul>
+      </article>
+    </div>
+    
+    <aside role="contentinfo">
+      <div class="sidebar-box">
+        <h3>Links</h3>
+        <ol>
+          <li><a href="https://github.com/0xAX/weber">Weber source code</a></li>
+          <li><a href="http://0xax.github.io/weber/index.html">Weber site</a></li>
+          <li><a href="http://elixir-lang.org/">Elixir</a></li>
+        </ol>
+      </div>
+    </aside>
+  </main>
+</body>
+
+</html>

+ 0 - 0
WeberFramework/lib/views/layout/.keep


+ 24 - 0
WeberFramework/mix.exs

@@ -0,0 +1,24 @@
+defmodule WeberFramework.Mixfile do
+  use Mix.Project
+
+  def project do
+    [ 
+      app: :WeberFramework,
+      version: "0.0.1",
+      deps: deps
+    ]
+  end
+
+  def application do
+    [
+      applications: [],
+      mod: {WeberFramework, []}
+    ]
+  end
+
+  defp deps do
+    [ 
+      { :weber, github: "0xAX/weber" } 
+    ]
+  end
+end

+ 0 - 0
WeberFramework/public/css/.keep


+ 0 - 0
WeberFramework/public/img/.keep


BIN
WeberFramework/public/img/favicon.ico


+ 235 - 0
WeberFramework/public/index.html

@@ -0,0 +1,235 @@
+<!DOCTYPE html>
+<html itemscope itemtype="http://schema.org/WebPage" lang="en">
+
+<head>
+  <meta charset="utf-8">
+  <title>Welcome to Weber!</title>
+  <link href="img/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
+
+  <style>
+    /* Reset */
+    * {
+      margin: 0;
+      padding: 0;
+    }
+
+    /* Default */
+    body {
+      font: normal 13px proxima-nova, sans-serif;
+      color: #666;
+    }
+
+    a {
+      color: #4c0066;
+    }
+
+    code, pre {
+      background: #f9f9f9;
+      border: 1px solid #ddd;
+      border-radius: 3px;
+      display: block;
+      font-family: monospace;
+      margin: 5px 0;
+      padding: 20px 0 20px 30px;
+      white-space: pre;
+    }
+
+    blockquote {
+      background: #f9f9f9;
+      border-left: 10px solid #eee;
+      border-radius: 3px;
+      color: #888;
+      margin: 20px 0 20px 20px;
+      padding: 10px 12px;
+      quotes: "\201C""\201D""\2018""\2019";
+    }
+
+    blockquote:before {
+      color: #ccc;
+      content: open-quote;
+      font-size: 55px;
+      line-height: 1px;
+      margin-right: 15px;
+      vertical-align: -25px;
+    }
+
+    blockquote p {
+      display: inline;
+    }
+
+    p {
+      font-size: 120%;
+      line-height: 25px;
+      margin: 10px 0;
+    }
+
+    /* Classes */
+    .content {
+      margin: 0 auto;
+      padding: 0 10px;
+      width: 960px;
+    }
+
+    /* Structure */
+    header:after, main:after,
+    header:before, main:before {
+      content: " ";
+      display: table;
+    }
+
+    header:after, main:after {
+      clear: both;
+    }
+
+    header {
+      background: #4c0066;
+      height: 150px;
+      margin-bottom: 50px;
+    }
+
+    header .logo {
+      border-radius: 100%;
+      display: block;
+      float: left;
+      padding-top: 25px;
+    }
+
+    header .title {
+      color: #fff;
+      float: left;
+      line-height: 30px;
+      margin: 101px 0 0;
+      text-align: right;
+      width: 660px;
+    }
+
+    header .title h1 {
+      font-size: 100px;
+    }
+
+    main .guide {
+      float: right;
+      width: 610px;
+    }
+
+    main .guide article {
+      margin-bottom: 50px;
+    }
+
+    main .guide h3 {
+      color: #4c0066;
+      font-size: 150%;
+      text-transform: uppercase;
+    }
+
+    main aside {
+      float: left;
+      margin-right: 50px;
+      width: 300px;
+    }
+
+    .sidebar-box {
+      margin: 25px 20px;
+    }
+
+    .sidebar-box h3 {
+      font-size: 110%;
+      margin-bottom: 5px;
+      text-transform: uppercase;
+    }
+
+    .sidebar-box p {
+      font-size: 90%;
+      line-height: 100%;
+      margin: 0;
+    }
+
+    .sidebar-box ol {
+      background: #f9f9f9;
+      border: 1px solid #eee;
+      border-radius: 3px;
+      list-style: none;
+    }
+    
+    .sidebar-box ol a {
+      border-bottom: 1px solid #eee;
+      display: block;
+      padding: 10px 10px;
+      text-decoration: none;
+    }
+    
+    .sidebar-box ol li:last-child a {
+      border-bottom: none;
+    }
+
+    .sidebar-box ol a:hover {
+      background: #f5f5f5;
+    }
+
+    li {
+      margin-left: 20px;
+      font-size: 120%;
+    }
+
+    h4 {
+      font-size: 120%;
+    }
+
+
+  </style>
+</head>
+
+<body>
+  <header role="banner">
+    <div class="content">
+      <a class="logo" href="http://0xAX.github.io/weber" target="_blank">
+        <svg height="300" width="300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+          <g>
+            <circle cx="150" cy="150" fill="#4c0066" r="147" stroke="#ffffff" stroke-width="6" />
+            <path d="M191.75,213.42l34.57-126.24c2.39-8.71-4.36-15.78-15.08-15.78c-10.721,0-21.02,7.06-23.01,15.78l-28.82,126.24c-1.99,8.71,3.47,15.78,12.21,15.78C180.35,229.2,189.359,222.141,191.75,213.42z" fill="#ffffff" />
+            <path d="M148.77,213.42l26.74-126.24c1.85-8.71-5.289-15.78-15.939-15.78c-10.66,0-20.47,7.06-21.92,15.78l-21.03,126.24c-1.45,8.71,4.41,15.78,13.09,15.78S146.92,222.141,148.77,213.42z" fill="#ffffff" />
+            <path d="M106.05,213.45l4.78-31.511c1.33-8.689-5.28-15.739-14.76-15.739c-9.47,0-17.9,7.05-18.82,15.739l-3.36,31.511c-0.92,8.7,5.36,15.75,14.05,15.75C96.62,229.2,104.73,222.15,106.05,213.45z" fill="#ffffff" />
+          </g>
+        </svg>
+      </a>
+
+      <div class="title">
+        <h1 style="margin-top: -20px;">Weber</h1>
+      </div>
+    </div>
+  </header>
+
+  <main class="content" role="main">
+    <div class="guide">
+      <article id="getting-started">
+        <h3>Getting started</h3>
+        <p>Welcome to the default <a href="https://github.com/0xAX/weber">Weber's</a> page. Weber is a MVC Rails like web framework which was built with <a href="http://elixir-lang.org/">Elixir</a> programming language. Build web applications quickly and efficiently as possible. Let's build Web with Elixir.</p>
+        <h4>Weber features:</h4>
+        <br/>
+        <ul>
+          <li>MVC web framework;</li>
+          <li>New project generation;</li>
+          <li>Json generation with exjson;</li>
+          <li>Websocket support;</li>
+          <li>HTML helpers;</li>
+          <li>Site internationalization</li>
+          <li>Sessions support;</li>
+          <li>and many more</li>
+        </ul>
+      </article>
+    </div>
+    
+    <aside role="contentinfo">
+      <div class="sidebar-box">
+        <h3>Links</h3>
+        <ol>
+          <li><a href="https://github.com/0xAX/weber">Weber source code</a></li>
+          <li><a href="http://0xax.github.io/weber/index.html">Weber site</a></li>
+          <li><a href="http://elixir-lang.org/">Elixir</a></li>
+        </ol>
+      </div>
+    </aside>
+  </main>
+</body>
+
+</html>

+ 0 - 0
WeberFramework/public/js/.keep


+ 18 - 0
WeberFramework/setup_weber.py

@@ -0,0 +1,18 @@
+import sys
+import subprocess
+
+def start(args, logfile, errfile):
+    try:
+        subprocess.check_call("mix deps.get", cwd="WeberFramework", shell=True, stderr=errfile, stdout=logfile)
+        subprocess.check_call("mix compile --all --force", cwd="WeberFramework", shell=True, stderr=errfile, stdout=logfile)
+        subprocess.check_call("./start.sh", cwd="WeberFramework", shell=True, stderr=errfile, stdout=logfile)
+        return 0
+    except subprocess.CalledProcessError:
+        return 1
+ 
+def stop(logfile, errfile):
+    try:
+        subprocess.check_call("killall beam", shell=True, cwd="/usr/bin")
+        return 0
+    except subprocess.CalledProcessError:
+        return 1

+ 7 - 0
WeberFramework/start.sh

@@ -0,0 +1,7 @@
+#!/usr/bin/env sh
+
+if [ ! -f deps ]; then
+  mix deps.get && mix compile
+fi
+
+exec elixir --detached -S mix run --no-halt

+ 7 - 0
WeberFramework/test/WeberFramework_test.exs

@@ -0,0 +1,7 @@
+defmodule WeberFrameworkTest do
+  use ExUnit.Case
+
+  test "the truth" do
+    assert(true)
+  end
+end

+ 1 - 0
WeberFramework/test/test_helper.exs

@@ -0,0 +1 @@
+ExUnit.start

+ 8 - 7
config/benchmark_profile

@@ -1,7 +1,7 @@
 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 export RESIN_HOME=~/FrameworkBenchmarks/installs/resin-4.0.36
-export GRAILS_HOME=~/FrameworkBenchmarks/installs/grails-2.3.3
-export VERTX_HOME=~/FrameworkBenchmarks/installs/vert.x-2.1M3
+export GRAILS_HOME=~/FrameworkBenchmarks/installs/grails-2.3.6
+export VERTX_HOME=~/FrameworkBenchmarks/installs/vert.x-2.1RC3
 export GOROOT=~/FrameworkBenchmarks/installs/go
 export GOPATH=~/FrameworkBenchmarks/go:~/FrameworkBenchmarks/webgo:~/FrameworkBenchmarks/revel
 export TOMCAT_HOME=~/FrameworkBenchmarks/installs/apache-tomcat-7.0.35
@@ -15,15 +15,16 @@ export PYTHON_HOME=~/FrameworkBenchmarks/installs/python-2.7.5
 export RACKET_HOME=~/FrameworkBenchmarks/installs/racket-5.3.6
 export NIMROD_HOME=~/FrameworkBenchmarks/installs/nimrod
 export NGINX_HOME=/usr/local/nginx
+export ELIXIR_HOME=~/FrameworkBenchmarks/installs/elixir-0.13.3
 
-export PATH="$PYTHON_HOME/bin:$PATH$JAVA_HOME/bin:$GRAILS_HOME/bin:$PLAY_HOME:$PLAY1_HOME:$VERTX_HOME/bin:$GOROOT/bin:$NODE_HOME/bin:$HOME/FrameworkBenchmarks/installs/bin:$MAVEN_HOME/bin:$PERL_HOME/bin:$PERL_HOME/site/bin:$DART_HOME/bin:$RACKET_HOME/bin:$NIMROD_HOME/bin:$NGINX_HOME/sbin:$PATH"
+export PATH="$PYTHON_HOME/bin:$PATH$JAVA_HOME/bin:$GRAILS_HOME/bin:$PLAY_HOME:$PLAY1_HOME:$VERTX_HOME/bin:$GOROOT/bin:$NODE_HOME/bin:$HOME/FrameworkBenchmarks/installs/bin:$MAVEN_HOME/bin:$PERL_HOME/bin:$PERL_HOME/site/bin:$DART_HOME/bin:$RACKET_HOME/bin:$NIMROD_HOME/bin:$NGINX_HOME/sbin:$ELIXIR_HOME/bin:$PATH"
 
 export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
 
-export TFB_SERVER_HOST='172.16.98.122'
-export TFB_CLIENT_HOST='172.16.98.98'
+export TFB_SERVER_HOST='localhost'
+export TFB_CLIENT_HOST='localhost'
 export TFB_CLIENT_USER='tfb'
-export TFB_CLIENT_IDENTITY_FILE='/home/tfb/.ssh/id_rsa-tfb-1'
-export TFB_DATABASE_HOST='172.16.98.118'
+export TFB_CLIENT_IDENTITY_FILE='/home/tfb/.ssh/id_rsa'
+export TFB_DATABASE_HOST='localhost'
 
 . ~/.rvm/scripts/'rvm'

+ 1 - 1
config/postgresql.conf

@@ -61,7 +61,7 @@ listen_addresses = '*'		# what IP address(es) to listen on;
 					# defaults to 'localhost', '*' = all
 					# (change requires restart)
 port = 5432				# (change requires restart)
-max_connections = 512			# (change requires restart)
+max_connections = 2000			# (change requires restart)
 # Note:  Increasing max_connections costs ~400 bytes of shared memory per
 # connection slot, plus lock space (see max_locks_per_transaction).
 #superuser_reserved_connections = 3	# (change requires restart)

+ 7 - 0
curacao/.gitignore

@@ -0,0 +1,7 @@
+/project/.*
+/project/target
+/target
+/.project
+/.classpath
+/.cache
+/dist

+ 24 - 0
curacao/README.md

@@ -0,0 +1,24 @@
+# Curacao Benchmarking Test
+
+This is the Curacao portion of TechEmpower's [benchmarking test suite](../) comparing a variety of web development platforms.
+
+## Versions
+
+Curacao 2.0-M10 https://github.com/markkolich/curacao
+
+## Tests
+
+### JSON Serialization
+
+Uses [Google's GSON](https://code.google.com/p/google-gson/) under-the-hood.
+
+See the `json` method in [Benchmarks.java](src/main/java/benchmark/Benchmarks.java)
+
+    http://localhost:8080/json
+
+### Plaintext
+
+See the `plainText` method in [Benchmarks.java](src/main/java/benchmark/Benchmarks.java)
+
+    http://localhost:8080/plaintext
+

+ 0 - 0
curacao/__init__.py


+ 24 - 0
curacao/benchmark_config

@@ -0,0 +1,24 @@
+{
+  "framework" : "curacao",
+  "tests" : [{
+    "default" : {
+      "setup_file" : "setup",
+      "json_url" : "/json",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Micro",
+      "database": "None",
+      "framework": "curacao",
+      "language": "Java",
+      "orm": "Raw",
+      "platform": "Curacao",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "Curacao",
+      "notes": "",
+      "versus": ""
+    }
+  }]
+}

+ 35 - 0
curacao/build.sbt

@@ -0,0 +1,35 @@
+import AssemblyKeys._
+
+name := "curacao-benchmark"
+
+organization := "com.kolich"
+
+scalaVersion := "2.10.3"
+
+version := "1.0"
+
+resolvers ++= Seq(
+  "markkolich.github.io repo" at "http://markkolich.github.io/repo"
+)
+
+libraryDependencies ++= Seq(
+  "com.kolich.curacao" % "curacao" % "2.6.2" % "compile",
+  "com.kolich.curacao" % "curacao-gson" % "2.6.2" % "compile",
+  "org.eclipse.jetty" % "jetty-webapp" % "9.2.0.v20140526" % "compile",
+  "javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided",
+  "org.slf4j" % "slf4j-api" % "1.7.2" % "compile",
+  "ch.qos.logback" % "logback-core" % "1.0.7" % "compile",
+  "ch.qos.logback" % "logback-classic" % "1.0.7" % "compile"
+)
+
+classDirectory in Compile <<= baseDirectory(new File(_, "target/classes"))
+
+sbtassembly.Plugin.assemblySettings
+
+mainClass in assembly := Some("benchmark.Bootstrap")
+
+outputPath in assembly := file("dist/curacao-standalone.jar")
+
+assemblyOption in assembly ~= { _.copy(includeScala = false) }
+
+test in assembly := {}

+ 1 - 0
curacao/project/build.properties

@@ -0,0 +1 @@
+sbt.version=0.13.2

+ 3 - 0
curacao/project/plugins.sbt

@@ -0,0 +1,3 @@
+addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")
+
+addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")

+ 35 - 0
curacao/setup.py

@@ -0,0 +1,35 @@
+
+import subprocess
+import sys
+import time
+import os
+
+def start(args, logfile, errfile):
+  if os.name == 'nt':
+    subprocess.check_call('"..\\sbt\\sbt.bat" assembly', shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
+  else:
+    subprocess.check_call("../sbt/sbt assembly", shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
+
+  subprocess.Popen("java -jar dist/curacao-standalone.jar", shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
+   
+  time.sleep(5)
+  return 0
+
+def stop(logfile, errfile):
+  if os.name == 'nt':
+    subprocess.check_call("wmic process where \"CommandLine LIKE '%curacao-standalone%'\" call terminate", stderr=errfile, stdout=logfile)
+  else:
+    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+    out, err = p.communicate()
+    for line in out.splitlines():
+      if 'curacao-standalone' in line:
+        try:
+          pid = int(line.split(None, 2)[1])
+          os.kill(pid, 15)
+        except OSError:
+          pass
+  
+  return 0
+
+##start([], open('log.out','a'), open('error.out','a'))
+##stop(open('log.out','a'), open('error.out','a'))

+ 5 - 0
curacao/source_code

@@ -0,0 +1,5 @@
+./curacao/src/main/java/benchmark
+./curacao/src/main/java/benchmark/Bootstrap.java
+./curacao/src/main/java/benchmark/Benchmarks.java
+./curacao/src/main/java/benchmark/entities
+./curacao/src/main/java/benchmark/entities/HelloWorld.java

+ 21 - 0
curacao/src/main/java/benchmark/Benchmarks.java

@@ -0,0 +1,21 @@
+package benchmark;
+
+import benchmark.entities.HelloWorld;
+import com.kolich.curacao.annotations.Controller;
+import com.kolich.curacao.annotations.methods.RequestMapping;
+import com.kolich.curacao.handlers.requests.matchers.AntPathMatcher;
+
+@Controller
+public final class Benchmarks {
+
+    @RequestMapping(value="/json", matcher=AntPathMatcher.class)
+    public final HelloWorld json() {
+        return new HelloWorld("Hello, World!");
+    }
+
+    @RequestMapping(value="/plaintext", matcher=AntPathMatcher.class)
+    public final String plainText() {
+        return "Hello, World!";
+    }
+
+}

+ 52 - 0
curacao/src/main/java/benchmark/Bootstrap.java

@@ -0,0 +1,52 @@
+package benchmark;
+
+import com.kolich.curacao.CuracaoContextListener;
+import com.kolich.curacao.CuracaoDispatcherServlet;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.webapp.WebAppContext;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public final class Bootstrap {
+
+    private static final int DEFAULT_SERVER_LISTEN_PORT = 8080;
+
+    public static void main(final String[] args) throws Exception {
+
+        final File workingDir = getWorkingDir();
+
+        int port;
+        try {
+            port = Integer.parseInt(args[0]);
+        } catch (Exception e) {
+            port = DEFAULT_SERVER_LISTEN_PORT;
+        }
+
+        final Server server = new Server(port);
+
+        final ServletHolder holder = new ServletHolder(CuracaoDispatcherServlet.class);
+        holder.setAsyncSupported(true); // Async supported = true
+        holder.setInitOrder(1); // Load on startup = true
+
+        final WebAppContext context = new WebAppContext();
+        context.addEventListener(new CuracaoContextListener()); // Required
+        context.setContextPath("/");
+        context.setResourceBase(workingDir.getAbsolutePath());
+        context.addServlet(holder, "/*");
+
+        server.setHandler(context);
+
+        server.start();
+        server.join();
+
+    }
+
+    private static final File getWorkingDir() {
+        final Path currentRelativePath = Paths.get("");
+        return currentRelativePath.toAbsolutePath().toFile();
+    }
+
+}

+ 21 - 0
curacao/src/main/java/benchmark/entities/HelloWorld.java

@@ -0,0 +1,21 @@
+package benchmark.entities;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.annotations.SerializedName;
+import com.kolich.curacao.gson.GsonAppendableCuracaoEntity;
+
+public final class HelloWorld extends GsonAppendableCuracaoEntity {
+
+    private static final Gson gson__ =
+        new GsonBuilder().serializeNulls().create();
+
+    @SerializedName("message")
+    private final String message_;
+
+    public HelloWorld(final String message) {
+        super(gson__);
+        message_ = message;
+    }
+
+}

+ 12 - 0
curacao/src/main/resources/application.conf

@@ -0,0 +1,12 @@
+curacao {
+
+  boot-package = "benchmark"
+
+  ## Never timeout.
+  async-context-timeout = 0
+
+  ## Both the request and response thread pools are "unbounded" intentionally.
+  pools.request.size = 0
+  pools.response.size = 0
+
+}

+ 23 - 0
curacao/src/main/resources/logback.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <target>System.out</target>
+        <encoder>
+            <pattern>%date{MM/dd HH:mm:ss.SSS} %-5level[%.15thread] %logger{1} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <logger name="org.reflections" additivity="false" level="WARN">
+        <appender-ref ref="CONSOLE"/>
+    </logger>
+
+    <logger name="com.kolich.curacao" additivity="false" level="ERROR">
+        <appender-ref ref="CONSOLE"/>
+    </logger>
+
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+    </root>
+
+</configuration>

+ 0 - 0
dropwizard-mongodb/__init__.py


+ 25 - 0
dropwizard-mongodb/benchmark_config

@@ -0,0 +1,25 @@
+{
+  "framework": "dropwizard-mongodb",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "db_url": "/db",
+      "query_url": "/db?queries=",
+      "port": 9000,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "MongoDB",
+      "framework": "dropwizard",
+      "language": "Java",
+      "orm": "Full",
+      "platform": "Jetty",
+      "webserver": "Jetty",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "dropwizard-mongodb",
+      "notes": "mongodb implementation of dropwizard example",
+      "versus": ""
+    }
+  }]
+}

+ 20 - 0
dropwizard-mongodb/hello-world.yml

@@ -0,0 +1,20 @@
+http:
+  port: 9000
+
+  requestLog:
+
+    # Settings for logging to stdout.
+    console:
+      # If true, log requests to stdout.
+      enabled: false
+
+logging:
+
+  # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
+  level: OFF
+
+  console:
+
+    # If true, write log statements to stdout.
+    enabled: false
+

+ 84 - 0
dropwizard-mongodb/pom.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.danielt</groupId>
+    <artifactId>dropwizard-mongodb</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.yammer.dropwizard</groupId>
+            <artifactId>dropwizard-core</artifactId>
+            <version>0.6.2</version>
+        </dependency>
+		<dependency>
+			<groupId>org.mongojack</groupId>
+			<artifactId>mongojack</artifactId>
+			<version>2.0.0</version>
+		</dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>1.6</version>
+                <configuration>
+                    <createDependencyReducedPom>true</createDependencyReducedPom>
+                    <filters>
+                        <filter>
+                            <artifact>*:*</artifact>
+                            <excludes>
+                                <exclude>META-INF/*.SF</exclude>
+                                <exclude>META-INF/*.DSA</exclude>
+                                <exclude>META-INF/*.RSA</exclude>
+                            </excludes>
+                        </filter>
+                    </filters>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <transformers>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>com.example.helloworld.HelloWorldService</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 23 - 0
dropwizard-mongodb/setup.py

@@ -0,0 +1,23 @@
+import subprocess
+import sys
+import setup_util
+from os.path import expanduser
+import os
+
+home = expanduser("~")
+
+def start(args, logfile, errfile):
+    try:
+        subprocess.check_call("mvn clean package;", shell=True, cwd="dropwizard-mongodb", stderr=errfile, stdout=logfile)
+        subprocess.Popen("java -jar target/dropwizard-mongodb-0.0.1-SNAPSHOT.jar server hello-world.yml", shell=True, cwd="dropwizard-mongodb", stderr=errfile, stdout=logfile)
+        return 0
+    except subprocess.CalledProcessError:
+        return 1
+def stop(logfile, errfile):
+  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+  out, err = p.communicate()
+  for line in out.splitlines():
+    if 'hello-world' in line:
+      pid = int(line.split(None, 2)[1])
+      os.kill(pid, 15)
+  return 0

+ 11 - 0
dropwizard-mongodb/source_code

@@ -0,0 +1,11 @@
+./dropwizard-mongodb/src/main/java/com/example/helloworld/
+./dropwizard-mongodb/src/main/java/com/example/helloworld/db
+./dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoHealthCheck.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoManaged.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldService.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/resources
+./dropwizard-mongodb/src/main/java/com/example/helloworld/resources/WorldResource.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/resources/JsonResource.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/core
+./dropwizard-mongodb/src/main/java/com/example/helloworld/core/World.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldConfiguration.java

+ 27 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldConfiguration.java

@@ -0,0 +1,27 @@
+
+package com.example.helloworld;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+import org.hibernate.validator.constraints.NotEmpty;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.yammer.dropwizard.config.Configuration;
+
+public class HelloWorldConfiguration
+    extends Configuration
+{
+	@JsonProperty
+    @NotEmpty
+    public String mongohost = "localhost";
+ 
+    @JsonProperty
+    @Min(1)
+    @Max(65535)
+    public int mongoport = 27017;
+ 
+    @JsonProperty
+    @NotEmpty
+    public String mongodb = "hello_world";
+}

+ 47 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldService.java

@@ -0,0 +1,47 @@
+
+package com.example.helloworld;
+
+import java.net.UnknownHostException;
+
+import org.mongojack.JacksonDBCollection;
+
+import com.example.helloworld.core.World;
+import com.example.helloworld.db.MongoHealthCheck;
+import com.example.helloworld.db.MongoManaged;
+import com.example.helloworld.resources.JsonResource;
+import com.example.helloworld.resources.WorldResource;
+import com.mongodb.DB;
+import com.mongodb.Mongo;
+import com.yammer.dropwizard.Service;
+import com.yammer.dropwizard.config.Bootstrap;
+import com.yammer.dropwizard.config.Environment;
+
+public class HelloWorldService
+    extends Service<HelloWorldConfiguration>
+{
+
+  public static void main(String[] args) throws Exception
+  {
+    new HelloWorldService().run(args);
+  }
+
+  @Override
+  public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap)
+  {
+    bootstrap.setName("hello-world");
+  }
+
+  @Override
+  public void run(HelloWorldConfiguration config, Environment environment) throws UnknownHostException
+  {
+    Mongo mongo = new Mongo(config.mongohost, config.mongoport);
+    MongoManaged mongoManaged = new MongoManaged(mongo);
+    environment.manage(mongoManaged);
+    environment.addHealthCheck(new MongoHealthCheck(mongo));
+    DB db = mongo.getDB(config.mongodb);
+    JacksonDBCollection<World, String> worlds = JacksonDBCollection.wrap(db.getCollection("world"), World.class, String.class);
+    environment.addResource(new WorldResource(worlds));
+    environment.addResource(new JsonResource());
+  }
+
+}

+ 40 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/core/World.java

@@ -0,0 +1,40 @@
+
+package com.example.helloworld.core;
+
+import javax.persistence.*;
+
+import org.mongojack.Id;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+@Entity
+@Table(name = "World")
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class World
+{
+  @Id
+  private long id;
+
+  @Column(name = "randomNumber", nullable = false)
+  private long randomNumber;
+
+  public long getId()
+  {
+    return id;
+  }
+
+  public void setId(long id)
+  {
+    this.id = id;
+  }
+
+  public long getRandomNumber()
+  {
+    return this.randomNumber;
+  }
+
+  public void setRandomNumber(long randomNumber)
+  {
+    this.randomNumber = randomNumber;
+  }
+}

+ 21 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoHealthCheck.java

@@ -0,0 +1,21 @@
+package com.example.helloworld.db;
+
+import com.mongodb.Mongo;
+import com.yammer.metrics.core.HealthCheck;
+ 
+public class MongoHealthCheck extends HealthCheck {
+ 
+    private Mongo mongo;
+ 
+    public MongoHealthCheck(Mongo mongo) {
+        super("MongoDBHealthCheck");
+        this.mongo = mongo;
+    }
+ 
+    @Override
+    protected Result check() throws Exception {
+        mongo.getDatabaseNames();
+        return Result.healthy();
+    }
+ 
+}

+ 23 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoManaged.java

@@ -0,0 +1,23 @@
+package com.example.helloworld.db;
+
+import com.mongodb.Mongo;
+import com.yammer.dropwizard.lifecycle.Managed;
+ 
+public class MongoManaged implements Managed {
+ 
+    private Mongo mongo;
+ 
+    public MongoManaged(Mongo mongo) {
+        this.mongo = mongo;
+    }
+ 
+    @Override
+    public void start() throws Exception {
+    }
+ 
+    @Override
+    public void stop() throws Exception {
+        mongo.close();
+    }
+ 
+}

+ 30 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/resources/JsonResource.java

@@ -0,0 +1,30 @@
+
+package com.example.helloworld.resources;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Path("/json")
+@Produces(MediaType.APPLICATION_JSON)
+public class JsonResource
+{
+  // Response message class (copied from 'servlet' test)
+  public final static class HelloMessage {
+    public final String message;
+
+    public HelloMessage(String m) { message = m; }
+  }
+
+  public JsonResource() { }
+
+  @GET
+  public HelloMessage sayHello()
+  {
+    return new HelloMessage("Hello, World!");
+  }
+}

+ 47 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/resources/WorldResource.java

@@ -0,0 +1,47 @@
+package com.example.helloworld.resources;
+
+import java.util.Random;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.mongojack.DBCursor;
+import org.mongojack.JacksonDBCollection;
+
+import com.example.helloworld.core.World;
+import com.google.common.base.Optional;
+import com.mongodb.BasicDBObject;
+import com.mongodb.DBObject;
+
+@Path("/db")
+@Produces(MediaType.APPLICATION_JSON)
+public class WorldResource
+{
+
+  private JacksonDBCollection<World, String> collection;
+ 
+  public WorldResource(JacksonDBCollection<World, String> collection)
+  {
+    this.collection = collection;
+  }
+
+  @GET
+  public World[] dbTest(@QueryParam("queries") Optional<Integer> queries)
+  {
+    final int totalQueries = queries.or(1);
+    final World[] worlds = new World[queries.or(1)];
+    final Random random = new Random(System.currentTimeMillis());
+
+    for (int i = 0; i < totalQueries; i++)
+    {
+    	DBObject query = new BasicDBObject();
+    	query.put("_id", (random.nextInt(10000) + 1));
+    	DBCursor<World> dbCursor = collection.find(query);
+        worlds[i] = (dbCursor.hasNext()) ? dbCursor.next() : null;
+    }
+    return worlds;
+  }
+}

+ 1 - 1
grails/README.md

@@ -4,7 +4,7 @@ This is the Grails portion of a [benchmarking test suite](../) comparing a varie
 
 ## Infrastructure Software Versions
 The tests were run with:
-* [Grails 2.3.3](http://grails.org/)
+* [Grails 2.3.6](http://grails.org/)
 * [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
 * [Resin 4.0.34](http://www.caucho.com/)
 * [MySQL 5.5.29](https://dev.mysql.com/)

+ 0 - 16
grails/hello/.classpath

@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/java"/>
-	<classpathentry kind="src" path="src/groovy"/>
-	<classpathentry kind="src" path="grails-app/conf"/>
-	<classpathentry kind="src" path="grails-app/controllers"/>
-	<classpathentry kind="src" path="grails-app/domain"/>
-	<classpathentry kind="src" path="grails-app/services"/>
-	<classpathentry kind="src" path="grails-app/taglib"/>
-	<classpathentry kind="src" path="grails-app/utils"/>
-	<classpathentry kind="src" path="test/integration"/>
-	<classpathentry kind="src" path="test/unit"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.grails.ide.eclipse.core.CLASSPATH_CONTAINER"/>
-	<classpathentry kind="output" path="target-eclipse/classes"/>
-</classpath>

+ 2 - 0
grails/hello/.gitignore

@@ -15,3 +15,5 @@ stacktrace.log
 /web-app/WEB-INF/classes
 /.link_to_grails_plugins/
 /target-eclipse/
+.project
+.classpath

+ 0 - 25
grails/hello/.project

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>hello</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.wst.common.project.facet.core.builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.grails.ide.eclipse.core.nature</nature>
-		<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
-	</natures>
-</projectDescription>

+ 2 - 2
grails/hello/application.properties

@@ -1,6 +1,6 @@
 #Grails Metadata file
-#Sun Oct 20 22:08:59 EEST 2013
-app.grails.version=2.3.3
+#Tue Feb 25 10:29:09 EET 2014
+app.grails.version=2.3.6
 app.name=hello
 app.servlet.version=2.5
 app.version=0.1

+ 3 - 3
grails/hello/grails-app/conf/BuildConfig.groovy

@@ -59,11 +59,11 @@ grails.project.dependency.resolution = {
     dependencies {
         // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
 
-        runtime 'mysql:mysql-connector-java:5.1.27'
+        runtime 'mysql:mysql-connector-java:5.1.29'
     }
 
     plugins {
-        runtime ":hibernate:3.6.10.4"
+        runtime ":hibernate:3.6.10.8"
         //runtime ":jquery:1.10.2"
         //runtime ":resources:1.2.1"
 
@@ -72,6 +72,6 @@ grails.project.dependency.resolution = {
         //runtime ":cached-resources:1.0"
         //runtime ":yui-minify-resources:0.1.4"
 
-        build ":tomcat:7.0.47"
+        build ":tomcat:7.0.50.1"
     }
 }

+ 0 - 19
grails/hello/grails-app/conf/JsonWorkaroundBootStrap.groovy

@@ -1,19 +0,0 @@
-import org.codehaus.groovy.grails.web.json.JSONObject
-import org.springframework.util.ClassUtils
-import org.springframework.util.ReflectionUtils
-
-class JsonWorkaroundBootStrap {
-    def init = { servletContext ->
-        // activate workaround for GRAILS-10823
-        println("activating workaround for GRAILS-10823 - use this only for Grails 2.3.3")
-        def encoderInstance = ClassUtils.forName("org.codehaus.groovy.grails.plugins.codecs.JSONEncoder", JSONObject.class.getClassLoader()).newInstance()
-        ['javascriptEncoderStateless', 'javascriptEncoder'].each { fieldName ->
-            ReflectionUtils.findField(JSONObject, fieldName).with {
-                accessible = true
-                set(null, encoderInstance)
-            }
-        }
-    }
-    def destroy = {
-    }
-}

+ 9 - 15
grails/hello/grails-app/controllers/hello/HelloController.groovy

@@ -47,33 +47,27 @@ class HelloController {
         if(queries > 500) queries=500
         def random = ThreadLocalRandom.current()
 
-        List<Integer> worldIds = new ArrayList<Integer>(queries)
+        int[] worldIds = new int[queries]
         for (int i = 0; i < queries; i++) {
-            worldIds.add(random.nextInt(10000) + 1)
+            worldIds[i] = (random.nextInt(10000) + 1)
         }
-        List<World> worlds
+
+        List<World> worlds = new ArrayList<World>(queries)
         if (updateAlso) {
-            worlds = getAllLocked(worldIds as Serializable[])
-            for (World world : worlds) {
+            Arrays.sort(worldIds)
+            for (int id : worldIds) {
+                World world = World.lock(id)
                 world.randomNumber = random.nextInt(10000) + 1
+                worlds.add(world)
             }
         } else {
-            worlds = new ArrayList<World>(queries)
-            for (Integer id : worldIds) {
+            for (int id : worldIds) {
                 worlds.add(World.read(id))
             }
         }
         return worlds
     }
     
-    @CompileStatic(TypeCheckingMode.SKIP)
-    private List<World> getAllLocked(Serializable[] worldIds) {
-        World.withCriteria {
-            'in'('id', worldIds as Serializable[])
-            lock true
-        }
-    }
-    
     // Test type 4: Fortunes
     @Transactional(readOnly=true)
     def fortunes() {

+ 5 - 5
hapi/app.js

@@ -9,7 +9,7 @@ var cluster = require('cluster'),
 	mongoose = require('mongoose'),
 	async = require('async'),
 	conn = mongoose.connect('mongodb://localhost/hello_world'),
-	connMap = { user: 'benchmarkdbuser', password: 'benchmarkdbpass', database: 'hello_world', host: 'localhost' };
+	connMap = { user: 'benchmarkdbuser', password: 'benchmarkdbpass', database: 'hello_world', host: 'localhost', charset: 'utf8' };
 
 var WorldSchema = new mongoose.Schema({
 		id          : Number,
@@ -80,10 +80,10 @@ if (cluster.isMaster) {
 	server.route({
 		method: 'GET',
 		path: '/mysql-orm/{queries?}',
-		handler: function(req){
+		handler: function(req, reply){
 			if (windows) return req.reply(Hapi.error.internal('Not supported on windows'));
 
-			var queries = req.params.queries || 1,
+			var queries = isNaN(req.params.queries) ? 1 : parseInt(req.params.queries, 10),
 				queryFunctions = [];
 
 			queries = Math.min(Math.max(queries, 1), 500);
@@ -95,10 +95,10 @@ if (cluster.isMaster) {
 			}
 
 			async.parallel(queryFunctions, function(err, results){
-				if (queries == 1) {
+				if (!req.params.queries) {
 					results = results[0];
 				}
-				req.reply(results).header('Server', 'hapi');
+				reply(results).header('Server', 'hapi');
 			});
 		}
 	});

+ 2 - 2
netty/README.md

@@ -8,8 +8,8 @@ This is the netty portion of a [benchmarking test suite](../) comparing a variet
 ## Versions
 
 * [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
-* [Netty 4.0.14.Beta1](http://netty.io/)
-* [Jackson 2.3.0](http://wiki.fasterxml.com/JacksonHome)
+* [Netty 4.0.16](http://netty.io/)
+* [Jackson 2.3.1](http://wiki.fasterxml.com/JacksonHome)
 
 ## References
 * https://github.com/netty/netty/tree/master/example/src/main/java/io/netty/example/http/snoop

+ 74 - 68
netty/pom.xml

@@ -1,72 +1,78 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
-  <modelVersion>4.0.0</modelVersion>
+	<modelVersion>4.0.0</modelVersion>
 
-  <groupId>com.techempower</groupId>
-  <artifactId>netty-example</artifactId>
-  <version>0.1</version>
-  
-  <packaging>jar</packaging>
+	<groupId>com.techempower</groupId>
+	<artifactId>netty-example</artifactId>
+	<version>0.1</version>
 
-  <dependencies>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-codec-http</artifactId>
-      <version>4.0.14.Beta1</version>
-    </dependency>
-	 <dependency>
-		<groupId>com.fasterxml.jackson.core</groupId>
-		<artifactId>jackson-databind</artifactId>
-		<version>2.3.0</version>
-	 </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-      <version>2.1.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.javassist</groupId>
-      <artifactId>javassist</artifactId>
-      <version>3.18.0-GA</version>
-    </dependency>
-  </dependencies>
-  
-  <build>
-    <plugins>
-      <plugin>
-        <inherited>true</inherited>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.3.2</version>
-        <configuration>
-          <source>1.7</source>
-          <target>1.7</target>
-          <optimize>true</optimize>
-          <debug>false</debug>
-        </configuration>
-      </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>hello.HelloWebServer</mainClass>
-            </manifest>
-          </archive>
-          <descriptorRefs>
-            <descriptorRef>jar-with-dependencies</descriptorRef>
-          </descriptorRefs>
-        </configuration>
-        <executions>
-          <execution>
-            <id>make-assembly</id> <!-- this is used for inheritance merges -->
-            <phase>package</phase> <!-- bind to the packaging phase -->
-            <goals>
-              <goal>single</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
+	<packaging>jar</packaging>
+
+	<dependencies>
+		<dependency>
+			<groupId>io.netty</groupId>
+			<artifactId>netty-codec-http</artifactId>
+			<version>4.0.17.Final</version>
+		</dependency>
+		<dependency>
+			<groupId>io.netty</groupId>
+			<artifactId>netty-transport-native-epoll</artifactId>
+			<version>4.0.17.Final</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>2.3.1</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.module</groupId>
+			<artifactId>jackson-module-afterburner</artifactId>
+			<version>2.3.1</version>
+		</dependency>
+		<dependency>
+			<groupId>javassist</groupId>
+			<artifactId>javassist</artifactId>
+			<version>RELEASE</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<inherited>true</inherited>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<source>1.7</source>
+					<target>1.7</target>
+					<optimize>true</optimize>
+					<debug>false</debug>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<configuration>
+					<archive>
+						<manifest>
+							<mainClass>hello.HelloWebServer</mainClass>
+						</manifest>
+					</archive>
+					<descriptorRefs>
+						<descriptorRef>jar-with-dependencies</descriptorRef>
+					</descriptorRefs>
+				</configuration>
+				<executions>
+					<execution>
+						<id>make-assembly</id> <!-- this is used for inheritance merges -->
+						<phase>package</phase> <!-- bind to the packaging phase -->
+						<goals>
+							<goal>single</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
 </project>

+ 1 - 1
netty/setup.py

@@ -6,7 +6,7 @@ import os
 def start(args, logfile, errfile):
   try:
     subprocess.check_call("mvn clean compile assembly:single", shell=True, cwd="netty", stderr=errfile, stdout=logfile)
-    subprocess.Popen("java -jar netty-example-0.1-jar-with-dependencies.jar".rsplit(" "), cwd="netty/target", stderr=errfile, stdout=logfile)
+    subprocess.Popen("java -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts -jar netty-example-0.1-jar-with-dependencies.jar".rsplit(" "), cwd="netty/target", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1

+ 1 - 0
netty/source_code

@@ -5,3 +5,4 @@
 ./netty/src/main/java/hello/HelloServerInitializer.java
 ./netty/src/main/java/hello/HelloWebServer.java
 ./netty/src/main/java/hello/HelloServerHandler.java
+./netty/src/main/java/hello/Message.java

+ 42 - 43
netty/src/main/java/hello/HelloServerHandler.java

@@ -2,16 +2,8 @@ package hello;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-import com.fasterxml.jackson.databind.*;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelFutureListener;
+import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.SimpleChannelInboundHandler;
 import io.netty.handler.codec.http.DefaultFullHttpResponse;
@@ -22,23 +14,56 @@ import io.netty.handler.codec.http.HttpResponseStatus;
 import io.netty.handler.codec.http.HttpVersion;
 import io.netty.util.CharsetUtil;
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.module.afterburner.AfterburnerModule;
 
[email protected]
 public class HelloServerHandler extends SimpleChannelInboundHandler<Object> {
-    private final SimpleDateFormat format = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z");
-    private CharSequence date;
+	private static final ThreadLocal<DateFormat> FORMAT = new ThreadLocal<DateFormat>() {
+        @Override
+        protected DateFormat initialValue() {
+            return new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z");
+        }
+    };
+
 
-    private static final ObjectMapper MAPPER = new ObjectMapper();
-    private final ByteBuf buffer = Unpooled.directBuffer().writeBytes("Hello, World!".getBytes(CharsetUtil.UTF_8));
-    private final CharSequence contentLength = HttpHeaders.newEntity(String.valueOf(buffer.readableBytes()));
+    private static final ByteBuf CONTENT_BUFFER = Unpooled.unreleasableBuffer(
+            Unpooled.directBuffer().writeBytes("Hello, World!".getBytes(CharsetUtil.UTF_8)));
+    private static final CharSequence contentLength = HttpHeaders.newEntity(
+            String.valueOf(CONTENT_BUFFER.readableBytes()));
 
     private static final CharSequence TYPE_PLAIN = HttpHeaders.newEntity("text/plain; charset=UTF-8");
     private static final CharSequence TYPE_JSON = HttpHeaders.newEntity("application/json; charset=UTF-8");
-
     private static final CharSequence SERVER_NAME = HttpHeaders.newEntity("Netty");
     private static final CharSequence CONTENT_TYPE_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.CONTENT_TYPE);
     private static final CharSequence DATE_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.DATE);
     private static final CharSequence CONTENT_LENGTH_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.CONTENT_LENGTH);
     private static final CharSequence SERVER_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.SERVER);
+    private static final ObjectMapper MAPPER;
+    
+    static{
+    	MAPPER = new ObjectMapper();
+    	MAPPER.registerModule(new AfterburnerModule());
+    }
+    
+    private volatile CharSequence date = HttpHeaders.newEntity(FORMAT.get().format(new Date()));
+
+    HelloServerHandler(ScheduledExecutorService service) {
+        service.scheduleWithFixedDelay(new Runnable() {
+            private final DateFormat format = FORMAT.get();
+            @Override
+            public void run() {
+                date = HttpHeaders.newEntity(format.format(new Date()));
+            }
+        }, 1000, 1000, TimeUnit.MILLISECONDS);
+
+    }
 
     @Override
     public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
@@ -47,10 +72,10 @@ public class HelloServerHandler extends SimpleChannelInboundHandler<Object> {
             String uri = request.getUri();
             switch (uri) {
                 case "/plaintext":
-                    writeResponse(ctx, request, buffer.duplicate().retain(), TYPE_PLAIN, contentLength);
+                    writeResponse(ctx, request, CONTENT_BUFFER.duplicate(), TYPE_PLAIN, contentLength);
                     return;
                 case "/json":
-                    byte[] json = MAPPER.writeValueAsBytes(Collections.singletonMap("message", "Hello, World!"));
+                    byte[] json = MAPPER.writeValueAsBytes(new Message("Hello, World!"));
                     writeResponse(ctx, request, Unpooled.wrappedBuffer(json), TYPE_JSON,
                             String.valueOf(json.length));
                     return;
@@ -94,30 +119,4 @@ public class HelloServerHandler extends SimpleChannelInboundHandler<Object> {
     public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
         ctx.flush();
     }
-
-    @Override
-    public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
-        super.handlerRemoved(ctx);
-        buffer.release();
-    }
-
-    @Override
-    public void channelActive(ChannelHandlerContext ctx) throws Exception {
-        date = HttpHeaders.newEntity(format.format(new Date()));
-
-        Channel channel = ctx.channel();
-        final ScheduledFuture<?> future = channel.eventLoop().scheduleWithFixedDelay(new Runnable() {
-            @Override
-            public void run() {
-                date = HttpHeaders.newEntity(format.format(new Date()));
-            }
-        }, 1000, 1000, TimeUnit.MILLISECONDS);
-
-        channel.closeFuture().addListener(new ChannelFutureListener() {
-            @Override
-            public void operationComplete(ChannelFuture channelFuture) throws Exception {
-                future.cancel(false);
-            }
-        });
-    }
 }

+ 8 - 1
netty/src/main/java/hello/HelloServerInitializer.java

@@ -1,17 +1,24 @@
 package hello;
 
+import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelInitializer;
 import io.netty.channel.ChannelPipeline;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.handler.codec.http.HttpRequestDecoder;
 import io.netty.handler.codec.http.HttpResponseEncoder;
 
+import java.util.concurrent.ScheduledExecutorService;
+
 public class HelloServerInitializer extends ChannelInitializer<SocketChannel> {
+    private final ChannelHandler httpHandler;
+    public HelloServerInitializer(ScheduledExecutorService service) {
+        this.httpHandler = new HelloServerHandler(service);
+    }
     @Override
     public void initChannel(SocketChannel ch) throws Exception {
         ChannelPipeline p = ch.pipeline();
         p.addLast("encoder", new HttpResponseEncoder());
         p.addLast("decoder", new HttpRequestDecoder(4096, 8192, 8192, false));
-        p.addLast("handler", new HelloServerHandler());
+        p.addLast("handler", httpHandler);
     }
 }

+ 37 - 16
netty/src/main/java/hello/HelloWebServer.java

@@ -5,14 +5,19 @@ import io.netty.buffer.PooledByteBufAllocator;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelOption;
 import io.netty.channel.EventLoopGroup;
+import io.netty.channel.ServerChannel;
+import io.netty.channel.epoll.EpollEventLoopGroup;
+import io.netty.channel.epoll.EpollServerSocketChannel;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.channel.socket.nio.NioServerSocketChannel;
 import io.netty.util.ResourceLeakDetector;
+import io.netty.util.ResourceLeakDetector.Level;
 
 
 public class HelloWebServer {
+	private static int IO_THREADS = Runtime.getRuntime().availableProcessors() * 2;
     static {
-        ResourceLeakDetector.setEnabled(false);
+        ResourceLeakDetector.setLevel(Level.DISABLED);
     }
 
     private final int port;
@@ -22,22 +27,38 @@ public class HelloWebServer {
     }
 
     public void run() throws Exception {
-        // Configure the server.
-        EventLoopGroup group = new NioEventLoopGroup();
-        try {
-            ServerBootstrap b = new ServerBootstrap();
-            b.group(group)
-             .childHandler(new HelloServerInitializer())
-             .channel(NioServerSocketChannel.class)
-             .option(ChannelOption.SO_BACKLOG, 1024)
-             .childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
-             
-            Channel ch = b.bind(port).sync().channel();
-            ch.closeFuture().sync();
-        } finally {
-            group.shutdownGracefully().sync();
-        }
+		// Configure the server.
+
+		String os = System.getProperty("os.name").toLowerCase();
+
+		boolean is_linux = os.contains("linux");
+		
+		if (is_linux) {
+			doRun( new EpollEventLoopGroup(), EpollServerSocketChannel.class);
+		}
+		else {
+			doRun(new NioEventLoopGroup(), NioServerSocketChannel.class);
+		} 
     }
+    
+	private void doRun(EventLoopGroup loupGroup, Class<? extends ServerChannel> serverChannelClass) throws InterruptedException	{
+		try {
+			ServerBootstrap b = new ServerBootstrap();
+			b.option(ChannelOption.SO_BACKLOG, 1024);
+			b.option(ChannelOption.SO_REUSEADDR, true);
+			b.group(loupGroup).channel(serverChannelClass).childHandler(new HelloServerInitializer(loupGroup.next()));			
+            b.option(ChannelOption.MAX_MESSAGES_PER_READ, Integer.MAX_VALUE);
+            b.childOption(ChannelOption.ALLOCATOR, new PooledByteBufAllocator(true, IO_THREADS, IO_THREADS, 8192, 11));
+            b.childOption(ChannelOption.SO_REUSEADDR, true);
+            b.childOption(ChannelOption.MAX_MESSAGES_PER_READ, Integer.MAX_VALUE);
+
+			Channel ch = b.bind(port).sync().channel();
+			ch.closeFuture().sync();
+		}
+		finally {
+			loupGroup.shutdownGracefully().sync();
+		}
+	}
 
     public static void main(String[] args) throws Exception {
         int port;

+ 15 - 0
netty/src/main/java/hello/Message.java

@@ -0,0 +1,15 @@
+package hello;
+
+public class Message {
+	
+	private final String message;
+
+	public Message(String message) {
+		super();
+		this.message = message;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+}

+ 2 - 3
openresty/nginx.conf

@@ -1,4 +1,3 @@
-#worker_processes  1;
 pid        /tmp/nginx.pid;
 error_log stderr error;
 
@@ -9,8 +8,8 @@ events {
 http {
     resolver 127.0.0.1;
     access_log off;
-    lua_package_path 'CWD/openresty/?.lua;;';
-    init_by_lua 'encode = require("cjson").encode mysql = require("resty.mysql")';
+    lua_package_path '/home/tfb/FrameworkBenchmarks/openresty/?.lua;;';
+    init_by_lua 'require "resty.core" encode = require("cjson").encode mysql = require("resty.mysql")';
     server {
         listen       8080;
         location /plaintext {

+ 7 - 0
php-zend-framework/.gitignore

@@ -0,0 +1,7 @@
+/vendor
+/build
+/dist
+.DS_Store
+/tags
+.idea
+composer.lock

+ 0 - 0
php-zend-framework/__init__.py


+ 25 - 0
php-zend-framework/benchmark_config

@@ -0,0 +1,25 @@
+{
+  "framework": "ZendFramework",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "db_url": "/db",
+      "query_url": "/db-multi?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "MySQL",
+      "framework": "Zend",
+      "language": "PHP",
+      "orm": "Full",
+      "platform": "PHP-FPM",
+      "webserver": "nginx",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "zend",
+      "notes": "",
+      "versus": "php"
+    }
+  }]
+}

+ 19 - 0
php-zend-framework/composer.json

@@ -0,0 +1,19 @@
+{
+    "name": "zendframework/skeleton-application",
+    "description": "Skeleton Application for ZF2",
+    "license": "BSD-3-Clause",
+    "keywords": [
+        "framework",
+        "zf2"
+    ],
+    "homepage": "http://framework.zend.com/",
+    "require": {
+        "php": ">=5.3.3",
+        "zendframework/zendframework": "~2.2"
+    },
+    "autoload": {
+        "psr-0": {
+            "FrameworkBenchmarks": "module/FrameworkBenchmarks/src"
+        }
+    }
+}

+ 16 - 0
php-zend-framework/config/application.config.php

@@ -0,0 +1,16 @@
+<?php
+return array(
+    'modules' => array(
+        'FrameworkBenchmarks',
+    ),
+    'module_listener_options' => array(
+        'module_paths' => array(),
+        'config_glob_paths' => array(
+            'config/autoload/{,*.}{global,local}.php',
+        ),
+        'config_cache_enabled' => true,
+        'config_cache_key'     => 'config_cache',
+        'cache_dir'            => 'data/cache',
+        'check_dependencies'   => false,
+    ),
+);

+ 0 - 0
php-zend-framework/config/autoload/.gitkeep


+ 10 - 0
php-zend-framework/config/autoload/benchmarks.local.php

@@ -0,0 +1,10 @@
+<?php
+
+return array(
+    'db' => array(
+        'driver'   => 'Pdo',
+        'dsn'      => 'mysql:dbname=hello_world;host=localhost;port=3306',
+        'username' => 'benchmarkdbuser',
+        'password' => 'benchmarkdbpass'
+    ),
+);

+ 1 - 0
php-zend-framework/data/cache/.gitignore

@@ -0,0 +1 @@
+*

+ 133 - 0
php-zend-framework/deploy/nginx.conf

@@ -0,0 +1,133 @@
+#user  nobody;
+worker_processes  8;
+
+#error_log  logs/error.log;
+#error_log  logs/error.log  notice;
+#error_log  logs/error.log  info;
+error_log stderr error;
+
+#pid        logs/nginx.pid;
+
+
+events {
+    worker_connections  1024;
+}
+
+
+http {
+    include       /usr/local/nginx/conf/mime.types;
+    default_type  application/octet-stream;
+
+    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+    #                  '$status $body_bytes_sent "$http_referer" '
+    #                  '"$http_user_agent" "$http_x_forwarded_for"';
+
+    #access_log  logs/access.log  main;
+    access_log off;
+
+    sendfile        on;
+    #tcp_nopush     on;
+
+    #keepalive_timeout  0;
+    keepalive_timeout  65;
+
+    #gzip  on;
+
+    upstream fastcgi_backend {
+        server 127.0.0.1:9001;
+        keepalive 32;
+    }
+
+    server {
+        listen       8080;
+        server_name  localhost;
+
+        #charset koi8-r;
+
+        #access_log  logs/host.access.log  main;
+
+        #location / {
+        #    root   html;
+        #    index  index.html index.htm;
+        #}
+
+        #error_page  404              /404.html;
+
+        # redirect server error pages to the static page /50x.html
+        #
+        #error_page   500 502 503 504  /50x.html;
+        #location = /50x.html {
+        #    root   html;
+        #}
+
+        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+        #
+        #location ~ \.php$ {
+        #    proxy_pass   http://127.0.0.1;
+        #}
+
+        root /home/tfb/FrameworkBenchmarks/php-zend-framework/public/;
+        index  index.php;
+
+        location / {
+            try_files $uri $uri/ /index.php?$uri&$args;
+        }
+
+        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+        #
+        location ~ \.php$ {
+            try_files $uri =404;
+            fastcgi_pass   fastcgi_backend;
+            fastcgi_keep_conn on;
+            fastcgi_index  index.php;
+#            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            include        /usr/local/nginx/conf/fastcgi_params;
+        }
+
+        # deny access to .htaccess files, if Apache's document root
+        # concurs with nginx's one
+        #
+        #location ~ /\.ht {
+        #    deny  all;
+        #}
+    }
+
+
+    # another virtual host using mix of IP-, name-, and port-based configuration
+    #
+    #server {
+    #    listen       8000;
+    #    listen       somename:8080;
+    #    server_name  somename  alias  another.alias;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+
+    # HTTPS server
+    #
+    #server {
+    #    listen       443;
+    #    server_name  localhost;
+
+    #    ssl                  on;
+    #    ssl_certificate      cert.pem;
+    #    ssl_certificate_key  cert.key;
+
+    #    ssl_session_timeout  5m;
+
+    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
+    #    ssl_ciphers  HIGH:!aNULL:!MD5;
+    #    ssl_prefer_server_ciphers   on;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+}

+ 9 - 0
php-zend-framework/deploy/php-zend-framework

@@ -0,0 +1,9 @@
+<VirtualHost *:8080>
+  Alias /php-zend-framework/ "/home/ubuntu/FrameworkBenchmarks/php-zend-framework/public/"
+  <Directory /home/ubuntu/FrameworkBenchmarks/php-zend-framework/public/>
+          Options Indexes FollowSymLinks MultiViews
+          #AllowOverride None
+          Order allow,deny
+          allow from all
+  </Directory>
+</VirtualHost>

+ 63 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Controller/DbController.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace FrameworkBenchmarks\Controller;
+
+use Zend\Mvc\Controller\AbstractActionController;
+use Zend\Stdlib\ArrayUtils;
+use Zend\View\Model\JsonModel;
+use Zend\Db\TableGateway\TableGateway;
+
+/**
+ * Controller that produces the json for the DB benchmarks of FrameworkBenchmarks
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class DbController extends AbstractActionController
+{
+    /**
+     * @var \Zend\Db\TableGateway\TableGateway
+     */
+    protected $tableGateway;
+
+    /**
+     * @param TableGateway $tableGateway
+     */
+    public function __construct(TableGateway $tableGateway)
+    {
+        $this->tableGateway = $tableGateway;
+    }
+
+    /**
+     * @return \Zend\View\Model\JsonModel
+     */
+    public function dbAction()
+    {
+        $result = $this->tableGateway->select(array('id' => mt_rand(1, 10000)));
+
+        foreach ($result as $return) {
+            return new JsonModel($return);
+        }
+
+        return $this->notFoundAction();
+    }
+
+    /**
+     * @return \Zend\View\Model\JsonModel
+     */
+    public function dbMultiAction()
+    {
+        /* @var $request \Zend\Http\Request */
+        $request = $this->getRequest();
+        $queries = $request->getQuery('queries', 1);
+        $worlds  = array();
+
+        for ($i = 0; $i < $queries; $i += 1) {
+            foreach ($this->tableGateway->select(array('id' => mt_rand(1, 10000))) as $found) {
+                $worlds[] = $found;
+            }
+        }
+
+        return new JsonModel($worlds);
+    }
+}

+ 23 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Controller/JsonController.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace FrameworkBenchmarks\Controller;
+
+use Zend\Mvc\Controller\AbstractActionController;
+use Zend\View\Model\JsonModel;
+
+/**
+ * Controller that produces the `hello world` json for the benchmarks of FrameworkBenchmarks
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class JsonController extends AbstractActionController
+{
+    /**
+     * @return \Zend\View\Model\JsonModel
+     */
+    public function indexAction()
+    {
+        return new JsonModel(array('message' => 'Hello, World!'));
+    }
+}

+ 41 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Entity/World.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace FrameworkBenchmarks\Entity;
+
+use Zend\Stdlib\ArrayObject;
+
+/**
+ * Entity that represents a single entry in the `World` collection of the benchmarks in FrameworkBenchmarks
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class World extends ArrayObject
+{
+    /**
+     * @var int
+     */
+    public $id;
+
+    /**
+     * @var int
+     */
+    public $randomNumber;
+
+    /**
+     * @param array $data
+     */
+    public function exchangeArray($data)
+    {
+        $this->id           = $data['id'];
+        $this->randomNumber = $data['randomNumber'];
+    }
+
+    /**
+     * @return array
+     */
+    public function toArray()
+    {
+        return array('id' => $this->id, 'randomNumber' => $this->randomNumber);
+    }
+}

+ 78 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Module.php

@@ -0,0 +1,78 @@
+<?php
+
+namespace FrameworkBenchmarks;
+
+/**
+ * Module class for the benchmarks of FrameworkBenchmarks
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class Module
+{
+    /**
+     * @return array
+     */
+    public function getConfig()
+    {
+        return array(
+            'router' => array(
+                'routes' => array(
+                    'json' => array(
+                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                        'options' => array(
+                            'route' => '/json',
+                            'defaults' => array(
+                                'controller' => 'FrameworkBenchmarks\Controller\JsonController',
+                                'action' => 'index',
+                            ),
+                        ),
+                    ),
+                    'db' => array(
+                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                        'options' => array(
+                            'route' => '/db',
+                            'defaults' => array(
+                                'controller' => 'FrameworkBenchmarks\Controller\DbController',
+                                'action' => 'db',
+                            ),
+                        ),
+                    ),
+                    'db-multi' => array(
+                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                        'options' => array(
+                            'route' => '/db-multi',
+                            'defaults' => array(
+                                'controller' => 'FrameworkBenchmarks\Controller\DbController',
+                                'action' => 'db-multi',
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+            'db' => array(
+                'driver' => 'Pdo',
+                'dsn'    => 'mysql:dbname=hello_world;host=localhost',
+            ),
+            'controllers' => array(
+                'invokables' => array(
+                    'FrameworkBenchmarks\Controller\JsonController' => 'FrameworkBenchmarks\Controller\JsonController',
+                ),
+                'factories' => array(
+                    'FrameworkBenchmarks\Controller\DbController'
+                        => 'FrameworkBenchmarks\ServiceFactory\DbControllerServiceFactory'
+                ),
+            ),
+            'service_manager' => array(
+                'factories' => array(
+                    'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory',
+                ),
+            ),
+            'view_manager' => array(
+                'strategies' => array(
+                    'ViewJsonStrategy',
+                ),
+            ),
+        );
+    }
+}

+ 43 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/ServiceFactory/DbControllerServiceFactory.php

@@ -0,0 +1,43 @@
+<?php
+/**
+ * Created by JetBrains PhpStorm.
+ * User: ocramius
+ * Date: 4/28/13
+ * Time: 9:29 PM
+ * To change this template use File | Settings | File Templates.
+ */
+
+namespace FrameworkBenchmarks\ServiceFactory;
+
+use FrameworkBenchmarks\Controller\DbController;
+use FrameworkBenchmarks\Entity\World;
+use Zend\Db\ResultSet\ResultSet;
+use Zend\Db\TableGateway\TableGateway;
+use Zend\ServiceManager\FactoryInterface;
+use Zend\ServiceManager\ServiceLocatorInterface;
+
+/**
+ * Factory responsible for instantiating {@see \FrameworkBenchmarks\Controller\DbController}
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class DbControllerServiceFactory implements FactoryInterface
+{
+    /**
+     * {@inheritDoc}
+     *
+     * @return \FrameworkBenchmarks\Controller\DbController
+     */
+    public function createService(ServiceLocatorInterface $serviceLocator)
+    {
+        /* @var $serviceLocator \Zend\ServiceManager\AbstractPluginManager */
+        /* @var $dbAdapter \Zend\Db\Adapter\AdapterInterface */
+        $dbAdapter          = $serviceLocator->getServiceLocator()->get('Zend\Db\Adapter\Adapter');
+        $resultSetPrototype = new ResultSet();
+
+        $resultSetPrototype->setArrayObjectPrototype(new World());
+
+        return new DbController(new TableGateway('World', $dbAdapter, null, $resultSetPrototype));
+    }
+}

+ 16 - 0
php-zend-framework/public/.htaccess

@@ -0,0 +1,16 @@
+RewriteEngine On
+# The following rule tells Apache that if the requested filename
+# exists, simply serve it.
+RewriteCond %{REQUEST_FILENAME} -s [OR]
+RewriteCond %{REQUEST_FILENAME} -l [OR]
+RewriteCond %{REQUEST_FILENAME} -d
+RewriteRule ^.*$ - [NC,L]
+# The following rewrites all other queries to index.php. The
+# condition ensures that if you are using Apache aliases to do
+# mass virtual hosting, the base path will be prepended to
+# allow proper resolution of the index.php file; it will work
+# in non-aliased environments as well, providing a safe, one-size
+# fits all solution.
+RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
+RewriteRule ^(.*) - [E=BASE:%1]
+RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

+ 6 - 0
php-zend-framework/public/index.php

@@ -0,0 +1,6 @@
+<?php
+chdir(dirname(__DIR__));
+
+require __DIR__ . '/../vendor/autoload.php';
+
+Zend\Mvc\Application::init(require 'config/application.config.php')->run();

+ 27 - 0
php-zend-framework/setup.py

@@ -0,0 +1,27 @@
+import subprocess
+import sys
+import setup_util
+from os.path import expanduser
+
+home = expanduser("~")
+
+def start(args, logfile, errfile):
+  setup_util.replace_text("php-zend-framework/config/autoload/benchmarks.local.php", "host=localhost", "host=" + args.database_host)
+  setup_util.replace_text("php-zend-framework/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks")
+
+  try:
+    subprocess.check_call("composer.phar install --optimize-autoloader", shell=True, cwd="php-zend-framework", stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo chown -R www-data:www-data php-zend-framework", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo php-fpm --fpm-config config/php-fpm.conf -g " + home + "/FrameworkBenchmarks/php-zend-framework/deploy/php-fpm.pid", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-zend-framework/deploy/nginx.conf", shell=True, stderr=errfile, stdout=logfile)
+    return 0
+  except subprocess.CalledProcessError:
+    return 1
+def stop(logfile, errfile):
+  try:
+    subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.call("sudo kill -QUIT $( cat php-zend-framework/deploy/php-fpm.pid )", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo chown -R $USER:$USER php-zend-framework", shell=True, stderr=errfile, stdout=logfile)
+    return 0
+  except subprocess.CalledProcessError:
+    return 1

+ 2 - 1
ringojs-convenient/app/models.js

@@ -6,8 +6,9 @@ var dbHost = '172.16.98.98';
 
 // create and configure store
 var connectionPool = module.singleton("connectionPool", function() {
+    var mysqlConnectionProperties = "?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useServerPrepStmts&enableQueryTimeouts=false&useUnbufferedIO=false&useReadAheadInput=false&maintainTimeStats=false&cacheRSMetadata=true";
     return new ConnectionPool({
-        "url": "jdbc:mysql://" + dbHost + "/hello_world",
+        "url": "jdbc:mysql://" + dbHost + "/hello_world" + mysqlConnectionProperties,
         "driver": "com.mysql.jdbc.Driver",
         "username": "benchmarkdbuser",
         "password": "benchmarkdbpass"

+ 1 - 8
ringojs-convenient/app/views.js

@@ -23,7 +23,6 @@ app.get('/db/:queries?', function(request, queries) {
    for (var i = 0; i < queries; i++) {
       randId = ((Math.random() * 10000) | 0) + 1;
       world = models.store.query('select World.* from World where World.id = :id', {id: randId})[0];
-      //worlds.push(world.toJSON());
       worlds.push({"id": world._id, "randomNumber" : world.randomNumber});
    }
    if (queries == 1) {
@@ -43,13 +42,7 @@ app.get('/fortune', function() {
 });
 
 app.get('/plaintext', function() {
-   // @@ not available in ringojs 0.9
-   // return response.text('Hello World');
-   return {
-     status: 200,
-     headers: {"Content-Type": 'text/plain'},
-     body: ['Hello, World!']
-   };
+   return response.text('Hello, World!');
 });
 
 app.get('/updates/:queries?', function(request, queries) {

+ 1 - 1
ringojs-convenient/setup.py

@@ -17,7 +17,7 @@ def start(args, logfile, errfile):
 
     subprocess.check_call("sudo mkdir -p /usr/share/ringojs/packages/ringo-sqlstore/jars/", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo cp /usr/share/ringojs//packages/sql-ringojs-client/jars/mysql.jar /usr/share/ringojs/packages/ringo-sqlstore/jars/", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.Popen("ringo --production -Dserver -DXmx=512m -DXms=512m ringo-main.js", shell=True, cwd="ringojs-convenient", stderr=errfile, stdout=logfile)
+    subprocess.Popen("ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js", shell=True, cwd="ringojs-convenient", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1

+ 2 - 1
ringojs/ringo-main.js

@@ -120,7 +120,8 @@ exports.app = function(req) {
 
 
 var datasource = module.singleton('pooling-datasource', function() {
-  return sql.connect("jdbc:mysql://" + dbHost + "/hello_world", 'benchmarkdbuser', 'benchmarkdbpass');
+  var mysqlConnectionProperties = "?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useServerPrepStmts&enableQueryTimeouts=false&useUnbufferedIO=false&useReadAheadInput=false&maintainTimeStats=false&cacheRSMetadata=true";
+  return sql.connect("jdbc:mysql://" + dbHost + "/hello_world" + mysqlConnectionProperties, 'benchmarkdbuser', 'benchmarkdbpass');
 });
 
 if (require.main == module) {

+ 1 - 1
ringojs/setup.py

@@ -10,7 +10,7 @@ def start(args, logfile, errfile):
   try:
     subprocess.check_call("sudo rm -rf /usr/share/ringojs/packages/*", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo ringo-admin install oberhamsi/sql-ringojs-client", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.Popen("ringo --production -Dserver -DXmx=512m -DXms=512m ringo-main.js", shell=True, cwd="ringojs", stderr=errfile, stdout=logfile)
+    subprocess.Popen("ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js", shell=True, cwd="ringojs", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1

BIN
sbt/sbt-launch.jar


+ 2 - 2
toolset/README.md

@@ -10,9 +10,9 @@ For deployment instructions, refer to the [Benchmark Suite Deployment README fil
 
 Assuming the deployment finished without error, we're ready to start the test suite. On the Linux server host, type:
 
-	nohup toolset/run-tests.py -s server-private-ip -d database-private-ip -c client-private-ip -i path-to-private-ssh-key -u username --max-threads 8 --duration 15 &
+	nohup toolset/run-tests.py -s server-private-ip -d database-private-ip -c client-private-ip -i path-to-private-ssh-key -u username --max-threads number-of-cores --duration 15 &
 
-For the number-of-cores parameter, you will need to know your application server's core count. For example, Amazon EC2 large instances have 2 cores.
+For the `number-of-cores` parameter, you will need to know your application server's core count. For example, Amazon EC2 large instances have 2 cores.
 
 `path-to-private-ssh-key` is the pathname of the private SSH key file of the Linux client's user. This file is set up during deployment.  `username` is the username associated with the private SSH key.
 

+ 1 - 2
toolset/benchmark/benchmarker.py

@@ -402,8 +402,7 @@ class Benchmarker:
     try:
       if os.name == 'nt':
         return True
-      # This doesn't seem to ever run correctly, which causes the rest to not be run.
-      #subprocess.check_call(["sudo","bash","-c","cd /sys/devices/system/cpu; ls -d cpu*|while read x; do echo performance > $x/cpufreq/scaling_governor; done"])
+      subprocess.check_call(["sudo","bash","-c","cd /sys/devices/system/cpu; ls -d cpu[0-9]*|while read x; do echo performance > $x/cpufreq/scaling_governor; done"])
       subprocess.check_call("sudo sysctl -w net.ipv4.tcp_max_syn_backlog=65535".rsplit(" "))
       subprocess.check_call("sudo sysctl -w net.core.somaxconn=65535".rsplit(" "))
       subprocess.check_call("sudo -s ulimit -n 65535".rsplit(" "))

+ 44 - 14
toolset/run-tests.py

@@ -62,39 +62,69 @@ def main(argv=None):
     # Set up argument parser
     ##########################################################
     parser = argparse.ArgumentParser(description='Run the Framework Benchmarking test suite.',
-        parents=[conf_parser])
+        parents=[conf_parser],
+        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+
+    # SSH options
     parser.add_argument('-s', '--server-host', default=serverHost, help='The application server.')
-    parser.add_argument('-c' ,'--client-host', default=clientHost, help='The client / load generation server.')
+    parser.add_argument('-c', '--client-host', default=clientHost, help='The client / load generation server.')
     parser.add_argument('-u', '--client-user', default=clientUser, help='The username to use for SSH to the client instance.')
-    parser.add_argument('-i', '--client-identity-file', default=clientIden, help='The key to use for SSH to the client instance.')
-    parser.add_argument('-d', '--database-host', default=databaHost, help='The database server.  If not provided, defaults to the value of --client-host.')
-    parser.add_argument('--database-user', default=databaUser, help='The username to use for SSH to the database instance.  If not provided, defaults to the value of --client-user.')
-    parser.add_argument('--database-identity-file', default=dbIdenFile, dest='database_identity_file', help='The key to use for SSH to the database instance.  If not provided, defaults to the value of --client-identity-file.')
-    parser.add_argument('-p', dest='password_prompt', action='store_true')
+    parser.add_argument('-i', '--client-identity-file', dest='client_identity_file', default=clientIden,
+                        help='The key to use for SSH to the client instance.')
+    parser.add_argument('-d', '--database-host', default=databaHost,
+                        help='The database server.  If not provided, defaults to the value of --client-host.')
+    parser.add_argument('--database-user', default=databaUser,
+                        help='The username to use for SSH to the database instance.  If not provided, defaults to the value of --client-user.')
+    parser.add_argument('--database-identity-file', default=dbIdenFile, dest='database_identity_file',
+                        help='The key to use for SSH to the database instance.  If not provided, defaults to the value of --client-identity-file.')
+    parser.add_argument('-p', dest='password_prompt', action='store_true', help='Prompt for password')
     parser.add_argument('--install-software', action='store_true', help='runs the installation script before running the rest of the commands')
-    parser.add_argument('--install', choices=['client', 'database', 'server', 'all'], default='all', help='Allows you to only install the server, client, or database software')
+    
+    # Install options
+    parser.add_argument('--install', choices=['client', 'database', 'server', 'all'], default=None,
+                        help='Runs installation script(s) before continuing on to execute the tests.')
     parser.add_argument('--install-error-action', choices=['abort', 'continue'], default='continue', help='action to take in case of error during installation')
+
+    # Test options
     parser.add_argument('--test', nargs='+', help='names of tests to run')
     parser.add_argument('--exclude', nargs='+', help='names of tests to exclude')
     parser.add_argument('--type', choices=['all', 'json', 'db', 'query', 'fortune', 'update', 'plaintext'], default='all', help='which type of test to run')
     parser.add_argument('-m', '--mode', choices=['benchmark', 'verify'], default='benchmark', help='verify mode will only start up the tests, curl the urls and shutdown')
     parser.add_argument('--list-tests', action='store_true', default=False, help='lists all the known tests that can run')
     parser.add_argument('--list-test-metadata', action='store_true', default=False, help='writes all the test metadata as a JSON file in the results directory')
-    parser.add_argument('--max-concurrency', default=256, help='the maximum concurrency that the tests will run at. The query tests will run at this concurrency', type=int)
+    parser.add_argument('--name', default="ec2", help='The name to give this test. Results will be placed in a folder using this name.')
+    parser.add_argument('--os', choices=['linux', 'windows'], default='linux', help='The operating system of the application/framework server (the one running' +
+                        'this binary')
+    parser.add_argument('--database-os', choices=['linux', 'windows'], default='linux', help='The operating system of the database server.')
+
+    # Benchmark options
+    parser.add_argument('--max-concurrency', default=256, help='the maximum number of HTTP connections that wrk will keep open. The query tests will run at this maximum', type=int)
     parser.add_argument('--max-queries', default=20, help='The maximum number of queries to run during the query test', type=int)
-    parser.add_argument('--query-interval', default=5, type=int)
-    parser.add_argument('--max-threads', default=maxThreads, help='The max number of threads to run weight at, this should be set to the number of cores for your system.', type=int)
+    parser.add_argument('--query-interval', default=5, type=int, help='Query tests will go from 1 query to max queries in increments of interval queries')
+    parser.add_argument('--max-threads', default=maxThreads, help='The max number of threads to run wrk at. This should be set to the number of cores for your client system.', type=int)
     parser.add_argument('--duration', default=15, help='Time in seconds that each test should run for.')
     parser.add_argument('--starting-concurrency', default=8, type=int)
     parser.add_argument('--sleep', type=int, default=60, help='the amount of time to sleep after starting each test to allow the server to start up.')
+
+    # Misc Options
     parser.add_argument('--parse', help='Parses the results of the given timestamp and merges that with the latest results')
-    parser.add_argument('--name', default="ec2", help='The name to give this test. Results will be placed in a folder using this name.')
-    parser.add_argument('--os', choices=['linux', 'windows'], default='linux', help='The operating system of the application server.')
-    parser.add_argument('--database-os', choices=['linux', 'windows'], default='linux', help='The operating system of the database server.')
     parser.add_argument('-v', '--verbose', action='store_true', default=False, help='Causes the configuration to print before any other commands are executed.')
     parser.set_defaults(**defaults) # Must do this after add, or each option's default will override the configuration file default
     args = parser.parse_args(remaining_argv)
 
+    # Verify and massage options
+    if args.client_user is None:
+      print 'Usernames (e.g. --client-user and --database-user) are required!'
+      print 'The system will SSH into the client and the database for the install stage'
+      print 'Aborting'
+      exit(1)
+
+    if args.database_user is None:
+      args.database_user = args.client_user
+
+    if args.database_host is None:
+      args.database_host = args.client_host
+
     if args.verbose:
         print 'Configuration options: '
         pprint(args)

+ 37 - 8
toolset/setup/linux/installer.py

@@ -18,6 +18,7 @@ class Installer:
 
     if self.benchmarker.install == 'all' or self.benchmarker.install == 'client':
         self.__install_client_software()
+
   ############################################################
   # End install_software
   ############################################################
@@ -93,6 +94,14 @@ class Installer:
     self.__run_command("sudo apt-get install openjdk-7-jdk", True)
     self.__run_command("sudo apt-get remove --purge openjdk-6-jre openjdk-6-jre-headless", True)
 
+    #
+    # Elixir
+    #
+    self.__run_command("wget https://github.com/elixir-lang/elixir/archive/v0.13.3.tar.gz");
+    self.__run_command("sudo tar -zxf v0.13.3.tar.gz");
+    self.__run_command("sudo make clean", cwd="elixir-0.13.3");
+    self.__run_command("sudo make test", cwd="elixir-0.13.3");
+
     #
     # Ruby/JRuby
     #
@@ -150,10 +159,10 @@ class Installer:
     #
     # RingoJs
     #
-    self.__download("http://www.ringojs.org/downloads/ringojs_0.9-1_all.deb")
+    self.__download("http://www.ringojs.org/downloads/ringojs_0.10-1_all.deb")
     self.__run_command("sudo apt-get install jsvc", True)
-    self.__run_command("sudo dpkg -i ringojs_0.9-1_all.deb", True)
-    self.__run_command("rm ringojs_0.9-1_all.deb")
+    self.__run_command("sudo dpkg -i ringojs_0.10-1_all.deb", True)
+    self.__run_command("rm ringojs_0.10-1_all.deb")
 
     #
     # Mono
@@ -272,6 +281,13 @@ class Installer:
     self.__run_command("mv -f zmq_compat.h mongrel2/src/")
     self.__run_command("make clean all && sudo make install", cwd="mongrel2")
 
+    #
+    # Weber
+    #
+    self.__run_command("git clone https://github.com/elixir-web/weber.git");
+    self.__run_command("make", cwd="weber");
+    self.__run_command("make test", cwd="weber");
+
     ##############################################################
     # Frameworks
     ##############################################################
@@ -279,8 +295,8 @@ class Installer:
     #
     # Grails
     #
-    self.__download("http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.3.3.zip")
-    self.__run_command("unzip -o grails-2.3.3.zip")
+    self.__download("http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.3.6.zip")
+    self.__run_command("unzip -o grails-2.3.6.zip")
 
     #
     # Play 2
@@ -314,8 +330,8 @@ class Installer:
     #
     # Vert.x
     #
-    self.__download("http://dl.bintray.com/vertx/downloads/vert.x-2.1M3.tar.gz?direct=true", "vert.x-2.1M3.tar.gz")
-    self.__run_command("tar xzf vert.x-2.1M3.tar.gz")
+    self.__download("http://dl.bintray.com/vertx/downloads/vert.x-2.1RC3.tar.gz?direct=true", "vert.x-2.1RC3.tar.gz")
+    self.__run_command("tar xzf vert.x-2.1RC3.tar.gz")
 
     #
     # Yesod
@@ -340,6 +356,19 @@ class Installer:
     #
     self.__run_command("git clone git://github.com/idlewan/nawak.git nawak/nawak", retry=True)
 
+    #
+    # Wt
+    #
+    self.__run_command("sudo apt-get install libboost1.48-all-dev", True)
+    self.__download("http://downloads.sourceforge.net/witty/wt-3.3.3.tar.gz", filename="wt.tar.gz")
+    self.__run_command("tar xf wt.tar.gz")
+    self.__run_command("rm wt.tar.gz")
+    self.__run_command("bash -c 'mv wt-* wt'")
+    self.__run_command("mkdir build", cwd="wt")
+    self.__run_command("cmake .. -DWT_CPP_11_MODE=-std=c++0x -DCMAKE_BUILD_TYPE=Release", cwd="wt/build")
+    self.__run_command("make", cwd="wt/build")
+    self.__run_command("sudo make install", cwd="wt/build")
+
     print("\nINSTALL: Finished installing server software\n")
   ############################################################
   # End __install_server_software
@@ -351,7 +380,7 @@ class Installer:
     f = "pypy-2.3.1-linux64.tar.bz2"
     if not os.path.exists(f):
       self.__download("https://bitbucket.org/pypy/pypy/downloads/" + f, f)
-    self.__run_command("tar xjf " + f)
+    self.__run_command("tar xf " + f)
     self.__run_command('ln -sf pypy-2.3.1-linux64 pypy')
 
     # CPython 2.7.7

+ 21 - 0
tornado/benchmark_config

@@ -22,6 +22,27 @@
       "notes": "CPython 2.7",
       "versus": ""
     },
+    "postgresql-raw": {
+      "setup_file": "setup_pg",
+      "json_url": "/json",
+      "db_url": "/dbraw",
+      "query_url": "/queriesraw?queries=",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "Postgres",
+      "framework": "tornado",
+      "language": "Python",
+      "orm": "Raw",
+      "platform": "Tornado",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "tornado",
+      "notes": "CPython 2.7",
+      "versus": ""
+    },
     "py3": {
       "setup_file": "setup_py3",
       "json_url": "/json",

Some files were not shown because too many files changed in this diff