Pārlūkot izejas kodu

Merge branch 'master' into mojolicious

Conflicts:
	toolset/setup/linux/installer.py
Joel Berger 11 gadi atpakaļ
vecāks
revīzija
7449297b7f
100 mainītis faili ar 2143 papildinājumiem un 205 dzēšanām
  1. 1 0
      HttpListener/install.sh
  2. 219 66
      README.md
  3. 6 0
      WeberFramework/.gitignore
  4. 2 0
      WeberFramework/README.md
  5. 24 0
      WeberFramework/benchmark_config
  6. 3 0
      WeberFramework/install.sh
  7. 0 0
      WeberFramework/lang/.gitkeep
  8. 18 0
      WeberFramework/lib/app.ex
  9. 36 0
      WeberFramework/lib/config.ex
  10. 0 0
      WeberFramework/lib/controllers/.keep
  11. 13 0
      WeberFramework/lib/controllers/main.ex
  12. 0 0
      WeberFramework/lib/helpers/.keep
  13. 0 0
      WeberFramework/lib/models/.keep
  14. 9 0
      WeberFramework/lib/route.ex
  15. 0 0
      WeberFramework/lib/views/.keep
  16. 235 0
      WeberFramework/lib/views/Main.html
  17. 0 0
      WeberFramework/lib/views/layout/.keep
  18. 24 0
      WeberFramework/mix.exs
  19. 0 0
      WeberFramework/public/css/.keep
  20. 0 0
      WeberFramework/public/img/.keep
  21. BIN
      WeberFramework/public/img/favicon.ico
  22. 235 0
      WeberFramework/public/index.html
  23. 0 0
      WeberFramework/public/js/.keep
  24. 18 0
      WeberFramework/setup_weber.py
  25. 7 0
      WeberFramework/start.sh
  26. 7 0
      WeberFramework/test/WeberFramework_test.exs
  27. 1 0
      WeberFramework/test/test_helper.exs
  28. 3 0
      activeweb/install.sh
  29. 3 0
      aspnet-stripped/install.sh
  30. 3 0
      aspnet/install.sh
  31. 4 2
      beego/benchmark_config
  32. 3 0
      beego/install.sh
  33. 55 0
      beego/src/hello/hello.go
  34. 1 1
      bottle/app.py
  35. 1 1
      bottle/benchmark_config
  36. 11 0
      bottle/gunicorn_conf.py
  37. 3 0
      bottle/install.sh
  38. 2 9
      bottle/setup.py
  39. 2 9
      bottle/setup_py3.py
  40. 3 0
      cake/install.sh
  41. 3 0
      compojure/install.sh
  42. 1 1
      config/10gen.list
  43. 16 9
      config/benchmark_profile
  44. 51 0
      config/create.sql
  45. 3 0
      config/database_sftp_batch
  46. 1 8
      config/erlang.list
  47. 188 0
      config/mysql
  48. 63 0
      config/mysql.conf
  49. 6 6
      config/postgresql.conf
  50. 37 0
      config/requirements-py3.txt
  51. 36 0
      config/requirements-pypy.txt
  52. 38 0
      config/requirements.txt
  53. 3 0
      cowboy/install.sh
  54. 2 0
      cpoll_cppsp/install.sh
  55. 9 4
      cpoll_cppsp/www/db
  56. 9 4
      cpoll_cppsp/www/db_pg_async
  57. 9 4
      cpoll_cppsp/www/db_pg_threadpool
  58. 7 0
      curacao/.gitignore
  59. 24 0
      curacao/README.md
  60. 0 0
      curacao/__init__.py
  61. 24 0
      curacao/benchmark_config
  62. 35 0
      curacao/build.sbt
  63. 3 0
      curacao/install.sh
  64. 1 0
      curacao/project/build.properties
  65. 3 0
      curacao/project/plugins.sbt
  66. 35 0
      curacao/setup.py
  67. 5 0
      curacao/source_code
  68. 21 0
      curacao/src/main/java/benchmark/Benchmarks.java
  69. 52 0
      curacao/src/main/java/benchmark/Bootstrap.java
  70. 21 0
      curacao/src/main/java/benchmark/entities/HelloWorld.java
  71. 12 0
      curacao/src/main/resources/application.conf
  72. 23 0
      curacao/src/main/resources/logback.xml
  73. 3 0
      dancer/install.sh
  74. 3 0
      dart-start/install.sh
  75. 2 2
      dart-start/setup.py
  76. 3 0
      dart-stream/install.sh
  77. 2 2
      dart-stream/setup.py
  78. 3 0
      dart/install.sh
  79. 3 0
      django/install.sh
  80. 0 0
      dropwizard-mongodb/__init__.py
  81. 25 0
      dropwizard-mongodb/benchmark_config
  82. 20 0
      dropwizard-mongodb/hello-world.yml
  83. 3 0
      dropwizard-mongodb/install.sh
  84. 84 0
      dropwizard-mongodb/pom.xml
  85. 23 0
      dropwizard-mongodb/setup.py
  86. 11 0
      dropwizard-mongodb/source_code
  87. 27 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldConfiguration.java
  88. 47 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldService.java
  89. 5 1
      dropwizard-mongodb/src/main/java/com/example/helloworld/core/World.java
  90. 21 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoHealthCheck.java
  91. 23 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoManaged.java
  92. 30 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/resources/JsonResource.java
  93. 47 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/resources/WorldResource.java
  94. 3 0
      dropwizard/benchmark_config
  95. 10 26
      dropwizard/hello-world.yml
  96. 3 0
      dropwizard/install.sh
  97. 20 10
      dropwizard/pom.xml
  98. 14 10
      dropwizard/setup.py
  99. 15 5
      dropwizard/source_code
  100. 0 25
      dropwizard/src/main/java/com/example/helloworld/HelloWorldConfiguration.java

+ 1 - 0
HttpListener/install.sh

@@ -0,0 +1 @@
+#!/bin/bash

+ 219 - 66
README.md

@@ -6,11 +6,164 @@ Read more and see the results of our tests on Amazon EC2 and physical hardware a
 
 Join in the conversation at our Google Group: https://groups.google.com/forum/?fromgroups=#!forum/framework-benchmarks
 
-## Running the test suite
+### Prerequisites
+
+Before starting setup, all the required hosts must be provisioned, with the respective operating system and required software installed, and with connectivity for remote management (SSH on Linux, RDP and WinRM on Windows).
+
+Refer to [Benchmark Suite Deployment README file](../deployment/README.md) for the provisioning procedures documentation.
+
+### App, load, and database servers
+
+**NOTE:** If testing a pull request or doing development, it is usually adequate to only use one computer. In that case, your server, client, and database IPs will be 127.0.0.1
+
+#### Installing the Framework Benchmark App Server
+
+* Install [Ubuntu 14.04](http://www.ubuntu.com/download/server) with username `tfb`. Ensure that OpenSSH is selected when you install. If not, run the following command
+```bash
+$ sudo apt-get install openssh-server
+```
+* If Ubuntu is already installed, run the following command and follow the prompts.
+```bash
+$ sudo adduser tfb
+$ sudo usermod -a -G sudo tfb
+```
+* Log in as `tfb`
+* Fully update **NOTE**: If you update the kernel (linux-firmware), it is generally a good idea to reboot aftewards.
+```bash
+$ sudo apt-get update && sudo apt-get upgrade
+```
+* Run the command: `sudo visudo`
+* Change line 20 in from `%sudo   ALL=(ALL:ALL) ALL` to `%sudo   ALL=NOPASSWD: ALL`
+* Run the following **(Don't enter a password, just hit enter when the prompt pops up)**. **NOTE** This is still necessary if the client and database are on the same computer as the server
+```bash
+$ ssh-keygen
+$ ssh-copy-id <database ip>
+$ ssh-copy-id <client ip>
+```
+* Install git and clone the Framework Benchmarks repository
+```bash
+$ sudo apt-get install git
+$ cd ~
+$ git clone https://github.com/TechEmpower/FrameworkBenchmarks.git
+$ cd FrameworkBenchmarks
+```
+* Install the server software. This will take a long time
+```bash
+$ nohup python toolset/run-tests.py -s <server hostname/ip> -c <client hostname/ip> -u tfb --install-software --install server --list-tests &
+```
+* If you want to view the process of installing, do the following. The session can be interrupted easily so no need to worry about keeping a connection.
+```bash
+$ tail -f nohup.out
+```
+* Reboot when the install is done
+* Edit your ~/.bashrc file to change the following
+ * Change `TFB_SERVER_HOST=<ip address>` to the server's IP address
+ * Change `TFB_CLIENT_HOST=<ip address>` to the client's ip address
+ * Change `TFB_DATABASE_HOST=<ip address>` to the database's ip address.
+ * Change `TFB_CLIENT_IDENTITY_FILE=<path>` to the id file you specified when you ran ssh-keygen (probably /home/tfb/.ssh/id_rsa if you don't know what it is)
+ * Run the command `source ~/.bashrc`
+* If you are setting up any other servers, do so before proceeding.
+* Run the following commands
+```bash
+cd ~/FrameworkBenchmarks
+source ~/.bash_profile
+# For your first time through the tests, set the ulimit for open files
+ulimit -n 8192
+# Most software is installed automatically by the script, but running the mongo command below from
+# the install script was causing some errors. For now this needs to be run manually.
+cd installs && curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
+cd ..
+sudo apt-get remove --purge openjdk-6-jre openjdk-6-jre-headless
+# Change database-private-ip to the database ip
+mongo --host database-private-ip < config/create.js
+```
+* Before running the tests, do the following
+```bash
+$ source ~/.bashrc
+```
+
+---
+
+#### Installing the Framework Benchmark Database Server
+
+* Install [Ubuntu 14.04](http://www.ubuntu.com/download/server) with username `tfb`
+* Log in as `tfb`
+* Fully update **NOTE**: If you update the kernel (linux-firmware), it is generally a good idea to reboot aftewards.
+```bash
+$ sudo apt-get update && sudo apt-get upgrade
+```
+* Run the command: `sudo visudo`
+* Change line 20 in from `%sudo   ALL=(ALL:ALL) ALL` to `%sudo   ALL=NOPASSWD: ALL`
+* On the app server, run the following from the FrameworkBenchmark directory (this should only take a small amount of time, several minutes or so):
+```bash
+$ toolset/run-tests.py --install-software --install database --list-tests
+```
+
+---
+
+#### Installing the Framework Benchmark Load Server
+
+* Install [Ubuntu 14.04](http://www.ubuntu.com/download/server) with username `tfb`
+* Log in as `tfb`
+* Fully update **NOTE**: If you update the kernel (linux-firmware), it is generally a good idea to reboot aftewards.
+```bash
+$ sudo apt-get update && sudo apt-get upgrade
+```
+* Run the command: `sudo visudo`
+* Change line 20 in from `%sudo   ALL=(ALL:ALL) ALL` to `%sudo   ALL=NOPASSWD: ALL`
+* On the app server, run the following from the FrameworkBenchmark directory (this should only take a small amount of time, several minutes or so):
+```bash
+$ toolset/run-tests.py --install-software --install client --list-tests
+```
+
+You can validate that the setup worked by running a smoke test like this:
+
+    toolset/run-tests.py --max-threads 1 --name smoketest --test servlet-raw --type all -m verify
+
+This should run the verification step for a single framework.
+
+---
+
+#### Windows server setup
+
+* Connect to the Windows server via Remote Desktop.
+* Copy `installer-bootstrap.ps1` from "toolset/setup/windows" to the server (use CTRL-C and CTRL-V).
+* Copy your Linux client private key too.
+* Right click on the installer script and select `Run with PowerShell`.
+* Press Enter to confirm.
+* It will install git and then launch `installer.ps1` from the repository, which will install everything else.
+* The installation takes about 20 minutes.
+* Then you have a working console: try `python`, `git`, `ssh`, `curl`, `node` etc. and verify that everything works + PowerShell goodies.
+
+The client/database machine is still assumed to be a Linux box. You can install just the client software via
+
+    python toolset\run-tests.py -s server-private-ip -c client-private-ip -i "C:\Users\Administrator\Desktop\client.key" --install-software --install client --list-tests
+
+but this step is not required if you already installed the Linux server and client as described above.
+
+Now you can run tests:
+
+    python toolset\run-tests.py -s server-private-ip -c client-private-ip -i "C:\Users\Administrator\Desktop\client.key" --max-threads 2 --duration 30 --sleep 5 --name win --test aspnet --type all
+
+---
+
+#### SQL Server setup
+
+* Connect to the SQL Server host via Remote Desktop.
+* Run a `Command Prompt` as Administrator.
+* Enter this command:
+
+        powershell -ExecutionPolicy Bypass -Command "iex (New-Object Net.WebClient).DownloadString('https://raw.github.com/TechEmpower/FrameworkBenchmarks/master/toolset/setup/sqlserver/setup-sqlserver-bootstrap.ps1')"
+
+* This will configure SQL Server, the Windows Firewall, and populate the database.
+
+Now, when running `run-tests.py`, just add `-d <ip of SQL Server instance>`. This works for the (Windows Server-based) `aspnet-sqlserver-raw` and `aspnet-sqlserver-entityframework` tests.
+
+---
 
-We ran our tests using two dedicated i7 2600k machines as well as two EC2 m1.large instances.
+## Running the test suite
 
-On the [Benchmark Tools README file](toolset/README.md) you will find tools and instructions to replicate our tests using EC2, Windows Azure or your own dedicated machines.
+We ran our tests using three dedicated i7 2600k machines, three EC2 m1.large instances, and three servers from Peak Hosting
 
 ## Updating Tests
 
@@ -52,52 +205,52 @@ This file should exist at the root of the test directory.
 
 Here is the basic structure of benchmark_config, using the Compojure framework as an example.  Compojure has two test *permutations*, which are identified as the "tests" list in the JSON structure below.
 
-	{
-	  "framework": "compojure",
-	  "tests": [{
-	    "default": {
-	      "setup_file": "setup",
-	      "json_url": "/compojure/json",
-	      "db_url": "/compojure/db/1",
-	      "query_url": "/compojure/db/",
-	      "fortune_url": "/compojure/fortune-hiccup",
-	      "plaintext_url": "/compojure/plaintext",
-	      "port": 8080,
-	      "approach": "Realistic",
-	      "classification": "Micro",
-	      "database": "MySQL",
-	      "framework": "compojure",
-	      "language": "Clojure",
-	      "orm": "Micro",
-	      "platform": "Servlet",
-	      "webserver": "Resin",
-	      "os": "Linux",
-	      "database_os": "Linux",
-	      "display_name": "compojure",
-	      "notes": "",
-	      "versus": "servlet"
-	    },
-	    "raw": {
-	      "setup_file": "setup",
-	      "db_url": "/compojure/dbraw/1",
-	      "query_url": "/compojure/dbraw/",
-	      "port": 8080,
-	      "approach": "Realistic",
-	      "classification": "Micro",
-	      "database": "MySQL",
-	      "framework": "compojure",
-	      "language": "Clojure",
-	      "orm": "Raw",
-	      "platform": "Servlet",
-	      "webserver": "Resin",
-	      "os": "Linux",
-	      "database_os": "Linux",
-	      "display_name": "compojure-raw",
-	      "notes": "",
-	      "versus": "servlet"
-	    }
-	  }]
-	}
+    {
+      "framework": "compojure",
+      "tests": [{
+        "default": {
+          "setup_file": "setup",
+          "json_url": "/compojure/json",
+          "db_url": "/compojure/db/1",
+          "query_url": "/compojure/db/",
+          "fortune_url": "/compojure/fortune-hiccup",
+          "plaintext_url": "/compojure/plaintext",
+          "port": 8080,
+          "approach": "Realistic",
+          "classification": "Micro",
+          "database": "MySQL",
+          "framework": "compojure",
+          "language": "Clojure",
+          "orm": "Micro",
+          "platform": "Servlet",
+          "webserver": "Resin",
+          "os": "Linux",
+          "database_os": "Linux",
+          "display_name": "compojure",
+          "notes": "",
+          "versus": "servlet"
+        },
+        "raw": {
+          "setup_file": "setup",
+          "db_url": "/compojure/dbraw/1",
+          "query_url": "/compojure/dbraw/",
+          "port": 8080,
+          "approach": "Realistic",
+          "classification": "Micro",
+          "database": "MySQL",
+          "framework": "compojure",
+          "language": "Clojure",
+          "orm": "Raw",
+          "platform": "Servlet",
+          "webserver": "Resin",
+          "os": "Linux",
+          "database_os": "Linux",
+          "display_name": "compojure-raw",
+          "notes": "",
+          "versus": "servlet"
+        }
+      }]
+    }
 
 * framework: Specifies the framework name.
 * tests: An list of tests that can be run for this framework. In many cases, this contains a single element for the "default" test, but additional tests can be specified.  Each test name must be unique when concatenated with the framework name.
@@ -159,17 +312,17 @@ Using `localhost` in the raw configuration file is not a requirement as long as
 
 Here is an example of Wicket's setup file.
 
-	import subprocess
-	import sys
-	import setup_util
+    import subprocess
+    import sys
+    import setup_util
 
-	##################################################
-	# start(args, logfile, errfile)
-	#
-	# Starts the server for Wicket
-	# returns 0 if everything completes, 1 otherwise
-	##################################################
-	def start(args, logfile, errfile):
+    ##################################################
+    # start(args, logfile, errfile)
+    #
+    # Starts the server for Wicket
+    # returns 0 if everything completes, 1 otherwise
+    ##################################################
+    def start(args, logfile, errfile):
 
     # setting the database url
     setup_util.replace_text("wicket/src/main/webapp/WEB-INF/resin-web.xml", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306")
@@ -187,13 +340,13 @@ Here is an example of Wicket's setup file.
     except subprocess.CalledProcessError:
       return 1
 
-	##################################################
-	# stop(logfile, errfile)
-	#
-	# Stops the server for Wicket
-	# returns 0 if everything completes, 1 otherwise
-	##################################################
-	def stop(logfile):
+    ##################################################
+    # stop(logfile, errfile)
+    #
+    # Stops the server for Wicket
+    # returns 0 if everything completes, 1 otherwise
+    ##################################################
+    def stop(logfile):
     try:
       subprocess.check_call("$RESIN_HOME/bin/resinctl shutdown", shell=True, stderr=errfile, stdout=logfile)
       return 0

+ 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"
+  }}]
+}

+ 3 - 0
WeberFramework/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends weber elixir

+ 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

+ 3 - 0
activeweb/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends java resin

+ 3 - 0
aspnet-stripped/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends mono

+ 3 - 0
aspnet/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends mono

+ 4 - 2
beego/benchmark_config

@@ -4,13 +4,15 @@
     "default": {
       "setup_file": "setup",
       "json_url": "/json",
+      "db_url": "/db",
+      "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Micro",
-      "database": "None",
+      "database": "MySQL",
       "framework": "beego",
       "language": "Go",
-      "orm": "Raw",
+      "orm": "beego ORM",
       "platform": "Go",
       "webserver": "None",
       "os": "Linux",

+ 3 - 0
beego/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends go

+ 55 - 0
beego/src/hello/hello.go

@@ -1,14 +1,38 @@
 package main
 
 import (
+	"log"
+	"math/rand"
 	"github.com/astaxie/beego"
+	"github.com/astaxie/beego/orm"
+
+	_ "github.com/go-sql-driver/mysql"
 	//"runtime"
 )
 
+const (
+	// Database
+	connectionString   = "benchmarkdbuser:benchmarkdbpass@tcp(localhost:3306)/hello_world"
+	worldRowCount      = 10000
+	macIdleConnection  = 30
+	maxConnectionCount = 256
+
+	helloWorldString = "Hello, World!"
+)
+
+var (
+	helloWorldBytes = []byte(helloWorldString)
+)
+
 type MessageStruct struct {
 	Message string `json:"message"`
 }
 
+type World struct {
+	Id           uint16 `orm:"pk" json:"id"`
+	RandomNumber uint16 `orm:"column(randomNumber)" json:"randomNumber"`
+}
+
 type JsonController struct {
 	beego.Controller
 }
@@ -19,10 +43,41 @@ func (this *JsonController) Get() {
 	this.ServeJson()
 }
 
+type PlaintextController struct {
+	beego.Controller
+}
+
+func (this *PlaintextController) Get() {
+	this.Ctx.Output.Header("Content-Type", "text/plain")
+	this.Ctx.Output.Body(helloWorldBytes)
+}
+
+type DBController struct {
+	beego.Controller
+}
+
+func (this *DBController) Get() {
+	o := orm.NewOrm()
+	w := World{Id: uint16(rand.Intn(worldRowCount) + 1)}
+	err := o.Read(&w)
+	if err != nil {
+		log.Fatalf("Error read world row: %s", err.Error())
+	}
+	this.Data["json"] = &w
+	this.ServeJson()
+}
+
 func main() {
 	//don't need this set, beego default set it
 	//runtime.GOMAXPROCS(runtime.NumCPU())
 	beego.RunMode = "prod"
 	beego.Router("/json", &JsonController{})
+	beego.Router("/db", &DBController{})
+	beego.Router("/plaintext", &PlaintextController{})
 	beego.Run()
 }
+
+func init() {
+	orm.RegisterModel(new(World))
+	orm.RegisterDataBase("default", "mysql", connectionString, macIdleConnection, maxConnectionCount)
+}

+ 1 - 1
bottle/app.py

@@ -13,7 +13,7 @@ except ImportError:
     import json
 
 app = Bottle()
-app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://benchmarkdbuser:benchmarkdbpass@DBHOSTNAME:3306/hello_world?charset=utf8'
+app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://benchmarkdbuser:benchmarkdbpass@localhost:3306/hello_world?charset=utf8'
 Base = declarative_base()
 db_engine = create_engine(app.config['SQLALCHEMY_DATABASE_URI'])
 plugin = sqlalchemy.Plugin(db_engine, keyword='db', )

+ 1 - 1
bottle/benchmark_config

@@ -44,7 +44,7 @@
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "bottle-py3",
-      "notes": "CPython 3.3",
+      "notes": "CPython 3.4",
       "versus": "wsgi"
     },
     "pypy": {

+ 11 - 0
bottle/gunicorn_conf.py

@@ -0,0 +1,11 @@
+import multiprocessing
+
+workers = multiprocessing.cpu_count() * 3
+bind = "0.0.0.0:8080"
+worker_class = "meinheld.gmeinheld.MeinheldWorker"
+keepalive = 120
+
+def post_fork(server, worker):
+    # Disalbe access log
+    import meinheld.server
+    meinheld.server.set_access_logger(None)

+ 3 - 0
bottle/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends python2 python3 pypy

+ 2 - 9
bottle/setup.py

@@ -1,10 +1,8 @@
 import subprocess
 import setup_util
-import multiprocessing
 import os
 
 bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
-NCPU = multiprocessing.cpu_count()
 
 proc = None
 
@@ -12,13 +10,8 @@ proc = None
 def start(args, logfile, errfile):
     global proc
     setup_util.replace_text("bottle/app.py", "DBHOSTNAME", args.database_host)
-    proc = subprocess.Popen([
-        bin_dir + "/gunicorn",
-        "app:app",
-        "-k", "meinheld.gmeinheld.MeinheldWorker",
-        "-b", "0.0.0.0:8080",
-        '-w', str(NCPU*3),
-        "--log-level=critical"],
+    proc = subprocess.Popen(
+        [bin_dir + "/gunicorn", "-c", "gunicorn_conf.py", "app:app"],
         cwd="bottle", stderr=errfile, stdout=logfile)
     return 0
 

+ 2 - 9
bottle/setup_py3.py

@@ -1,10 +1,8 @@
 import subprocess
 import setup_util
-import multiprocessing
 import os
 
 bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py3/bin')
-NCPU = multiprocessing.cpu_count()
 
 proc = None
 
@@ -12,13 +10,8 @@ proc = None
 def start(args, logfile, errfile):
     global proc
     setup_util.replace_text("bottle/app.py", "DBHOSTNAME", args.database_host)
-    proc = subprocess.Popen([
-        bin_dir + "/gunicorn",
-        "app:app",
-        "-k", "meinheld.gmeinheld.MeinheldWorker",
-        "-b", "0.0.0.0:8080",
-        '-w', str(NCPU*3),
-        "--log-level=critical"],
+    proc = subprocess.Popen(
+        [bin_dir + "/gunicorn", "-c", "gunicorn_conf.py", "app:app"],
         cwd="bottle", stderr=errfile, stdout=logfile)
     return 0
 

+ 3 - 0
cake/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends php nginx

+ 3 - 0
compojure/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends resin java

+ 1 - 1
config/10gen.list

@@ -1 +1 @@
-deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
+deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

+ 16 - 9
config/benchmark_profile

@@ -1,7 +1,9 @@
+# Start Benchmark profile
+
 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.4.2
+export VERTX_HOME=~/FrameworkBenchmarks/installs/vert.x-2.1.1
 export GOROOT=~/FrameworkBenchmarks/installs/go
 export GOPATH=~/FrameworkBenchmarks/go:~/FrameworkBenchmarks/webgo:~/FrameworkBenchmarks/revel
 export TOMCAT_HOME=~/FrameworkBenchmarks/installs/apache-tomcat-7.0.35
@@ -9,20 +11,25 @@ export NODE_HOME=~/FrameworkBenchmarks/installs/node-v0.10.8-linux-x64
 export PLAY_HOME=~/FrameworkBenchmarks/installs/play-2.2.0
 export PLAY1_HOME=~/FrameworkBenchmarks/installs/play-1.2.5
 export MAVEN_HOME=~/FrameworkBenchmarks/installs/apache-maven-3.0.5
-export PERL_HOME=/opt/ActivePerl-5.16
+export PERL_HOME=~/FrameworkBenchmarks/installs/perl-5.18
 export DART_HOME=~/FrameworkBenchmarks/installs/dart-sdk
 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:$PATH"
+export PATH="$PYTHON_HOME/bin:$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:$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'
 
-source ~/.rvm/scripts/'rvm'
+[ -e ~/.rvm ] && . ~/.rvm/scripts/'rvm'
+export LC_ALL='en_US.UTF-8'
+export NUMCPUS=`grep -c '^processor' /proc/cpuinfo`
+export MAKEFLAGS="-j $NUMCPUS -l $NUMCPUS"

+ 51 - 0
config/create.sql

@@ -57,3 +57,54 @@ INSERT INTO Fortune (message) VALUES ('Feature: A bug with seniority.');
 INSERT INTO Fortune (message) VALUES ('Computers make very fast, very accurate mistakes.');
 INSERT INTO Fortune (message) VALUES ('<script>alert("This should not be displayed in a browser alert box.");</script>');
 INSERT INTO Fortune (message) VALUES ('フレームワークのベンチマーク');
+
+DROP TABLE IF EXISTS world;
+CREATE TABLE  world (
+  id int(10) unsigned NOT NULL auto_increment,
+  randomNumber int NOT NULL default 0,
+  PRIMARY KEY  (id)
+)
+ENGINE=INNODB;
+
+DROP PROCEDURE IF EXISTS load_data;
+
+DELIMITER #
+CREATE PROCEDURE load_data()
+BEGIN
+
+declare v_max int unsigned default 10000;
+declare v_counter int unsigned default 0;
+
+  TRUNCATE TABLE world;
+  START TRANSACTION;
+  while v_counter < v_max do
+    INSERT INTO world (randomNumber) VALUES ( floor(0 + (rand() * 10000)) );
+    SET v_counter=v_counter+1;
+  end while;
+  commit;
+END #
+
+DELIMITER ;
+
+CALL load_data();
+
+DROP TABLE IF EXISTS fortune;
+CREATE TABLE  fortune (
+  id int(10) unsigned NOT NULL auto_increment,
+  message varchar(2048) CHARACTER SET 'utf8' NOT NULL,
+  PRIMARY KEY  (id)
+)
+ENGINE=INNODB;
+
+INSERT INTO fortune (message) VALUES ('fortune: No such file or directory');
+INSERT INTO fortune (message) VALUES ('A computer scientist is someone who fixes things that aren''t broken.');
+INSERT INTO fortune (message) VALUES ('After enough decimal places, nobody gives a damn.');
+INSERT INTO fortune (message) VALUES ('A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1');
+INSERT INTO fortune (message) VALUES ('A computer program does what you tell it to do, not what you want it to do.');
+INSERT INTO fortune (message) VALUES ('Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen');
+INSERT INTO fortune (message) VALUES ('Any program that runs right is obsolete.');
+INSERT INTO fortune (message) VALUES ('A list is only as strong as its weakest link. — Donald Knuth');
+INSERT INTO fortune (message) VALUES ('Feature: A bug with seniority.');
+INSERT INTO fortune (message) VALUES ('Computers make very fast, very accurate mistakes.');
+INSERT INTO fortune (message) VALUES ('<script>alert("This should not be displayed in a browser alert box.");</script>');
+INSERT INTO fortune (message) VALUES ('フレームワークのベンチマーク');

+ 3 - 0
config/database_sftp_batch

@@ -1,3 +1,4 @@
+lcd ..
 put config/my.cnf
 put config/mongodb.conf
 put config/create.sql
@@ -9,3 +10,5 @@ put config/postgresql.conf
 put config/pg_hba.conf
 put config/usr.sbin.mysqld
 put config/60-postgresql-shm.conf
+put config/mysql
+put config/mysql.conf

+ 1 - 8
config/erlang.list

@@ -1,8 +1 @@
-deb http://binaries.erlang-solutions.com/debian quantal contrib
-deb http://binaries.erlang-solutions.com/debian precise contrib
-deb http://binaries.erlang-solutions.com/debian oneiric contrib
-deb http://binaries.erlang-solutions.com/debian natty contrib
-deb http://binaries.erlang-solutions.com/debian maverick contrib
-deb http://binaries.erlang-solutions.com/debian lucid contrib
-
-deb http://binaries.erlang-solutions.com/debian squeeze contrib
+deb http://packages.erlang-solutions.com/debian trusty contrib

+ 188 - 0
config/mysql

@@ -0,0 +1,188 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides:          mysql
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Should-Start:      $network $time
+# Should-Stop:       $network $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start and stop the mysql database server daemon
+# Description:       Controls the main MySQL database server daemon "mysqld"
+#                    and its wrapper script "mysqld_safe".
+### END INIT INFO
+#
+set -e
+set -u
+${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
+
+test -x /usr/bin/mysqld_safe || exit 0
+
+. /lib/lsb/init-functions
+
+SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
+CONF=/etc/mysql/my.cnf
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+
+# priority can be overriden and "-s" adds output to stderr
+ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"
+
+# Safeguard (relative paths, core dumps..)
+cd /
+umask 077
+
+# mysqladmin likes to read /root/.my.cnf. This is usually not what I want
+# as many admins e.g. only store a password without a username there and
+# so break my scripts.
+export HOME=/etc/mysql/
+
+## Fetch a particular option from mysql's invocation.
+#
+# Usage: void mysqld_get_param option
+mysqld_get_param() {
+	/usr/sbin/mysqld --print-defaults \
+		| tr " " "\n" \
+		| grep -- "--$1" \
+		| tail -n 1 \
+		| cut -d= -f2
+}
+
+## Do some sanity checks before even trying to start mysqld.
+sanity_checks() {
+  # check for config file
+  if [ ! -r /etc/mysql/my.cnf ]; then
+    log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz"
+    echo                "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER
+  fi
+
+  # check for diskspace shortage
+#  datadir=`mysqld_get_param datadir`
+#  if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
+#    log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
+#    echo                "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
+#    exit 1
+#  fi
+}
+
+## Checks if there is a server running and if so if it is accessible.
+#
+# check_alive insists on a pingable server
+# check_dead also fails if there is a lost mysqld in the process list
+#
+# Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn]
+mysqld_status () {
+    ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
+
+    ps_alive=0
+    pidfile=`mysqld_get_param pid-file`
+    if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi
+    
+    if [ "$1" = "check_alive"  -a  $ping_alive = 1 ] ||
+       [ "$1" = "check_dead"   -a  $ping_alive = 0  -a  $ps_alive = 0 ]; then
+	return 0 # EXIT_SUCCESS
+    else
+  	if [ "$2" = "warn" ]; then
+  	    echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
+	fi
+  	return 1 # EXIT_FAILURE
+    fi
+}
+
+#
+# main()
+#
+
+case "${1:-''}" in
+  'start')
+	sanity_checks;
+	# Start daemon
+	log_daemon_msg "Starting MySQL database server" "mysqld"
+	if mysqld_status check_alive nowarn; then
+	   log_progress_msg "already running"
+	   log_end_msg 0
+	else
+	    # Could be removed during boot
+	    test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld
+
+	    # Start MySQL! 
+  	    su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe > /dev/null 2>&1 &"
+
+	    # 6s was reported in #352070 to be too few when using ndbcluster
+	    # 14s was reported in #736452 to be too few with large installs
+	    for i in $(seq 1 30); do
+                sleep 1
+	        if mysqld_status check_alive nowarn ; then break; fi
+		log_progress_msg "."
+	    done
+	    if mysqld_status check_alive warn; then
+                log_end_msg 0
+	        # Now start mysqlcheck or whatever the admin wants.
+	        output=$(/etc/mysql/debian-start)
+		[ -n "$output" ] && log_action_msg "$output"
+	    else
+	        log_end_msg 1
+		log_failure_msg "Please take a look at the syslog"
+	    fi
+	fi
+	;;
+
+  'stop')
+	# * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
+	# at least for cron, we can rely on it here, too. (although we have 
+	# to specify it explicit as e.g. sudo environments points to the normal
+	# users home and not /root)
+	log_daemon_msg "Stopping MySQL database server" "mysqld"
+	if ! mysqld_status check_dead nowarn; then
+	  set +e
+	  shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
+	  set -e
+	  if [ "$r" -ne 0 ]; then
+	    log_end_msg 1
+	    [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
+	    log_daemon_msg "Killing MySQL database server by signal" "mysqld"
+	    killall -15 mysqld
+            server_down=
+	    for i in 1 2 3 4 5 6 7 8 9 10; do
+              sleep 1
+              if mysqld_status check_dead nowarn; then server_down=1; break; fi
+            done
+          if test -z "$server_down"; then killall -9 mysqld; fi
+	  fi
+        fi
+
+        if ! mysqld_status check_dead warn; then
+	  log_end_msg 1
+	  log_failure_msg "Please stop MySQL manually and read /usr/share/doc/mysql-server-5.6/README.Debian.gz!"
+	  exit -1
+	else
+	  log_end_msg 0
+        fi
+	;;
+
+  'restart')
+	set +e; $SELF stop; set -e
+	$SELF start 
+	;;
+
+  'reload'|'force-reload')
+  	log_daemon_msg "Reloading MySQL database server" "mysqld"
+	$MYADMIN reload
+	log_end_msg 0
+	;;
+
+  'status')
+	if mysqld_status check_alive nowarn; then
+	  log_action_msg "$($MYADMIN version)"
+	else
+	  log_action_msg "MySQL is stopped."
+	  exit 3
+	fi
+  	;;
+
+  *)
+	echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
+	exit 1
+	;;
+esac
+

+ 63 - 0
config/mysql.conf

@@ -0,0 +1,63 @@
+description     "MySQL 5.6 Server"
+author          "Mario Limonciello <[email protected]>"
+
+start on runlevel [2345]
+stop on starting rc RUNLEVEL=[016]
+
+respawn
+respawn limit 2 5
+
+env HOME=/etc/mysql
+umask 007
+
+# The default of 5 seconds is too low for mysql which needs to flush buffers
+kill timeout 300
+
+pre-start script
+    ## Fetch a particular option from mysql's invocation.
+    # Usage: void mysqld_get_param option
+    mysqld_get_param() {
+      /usr/sbin/mysqld --print-defaults \
+        | tr " " "\n" \
+        | grep -- "--$1" \
+        | tail -n 1 \
+        | cut -d= -f2
+    }
+
+    # priority can be overriden and "-s" adds output to stderr
+    ERR_LOGGER="logger -p daemon.err -t /etc/init/mysql.conf -i"
+
+    #Sanity checks
+    [ -r $HOME/my.cnf ]
+    [ -d /var/run/mysqld ] || install -m 755 -o mysql -g root -d /var/run/mysqld
+    /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+    # check for diskspace shortage
+#    datadir=`mysqld_get_param datadir`
+#    BLOCKSIZE=`LC_ALL=C df --portability $datadir/. | tail -n 1 | awk '{print $4}'`
+#    if [ $BLOCKSIZE -le 4096 ] ; then
+#      echo "$0: ERROR: The partition with $datadir is too full!" >&2
+#      echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
+#      exit 1
+#    fi
+end script
+
+exec /usr/sbin/mysqld
+
+post-start script
+   for i in `seq 1 30` ; do
+        /usr/bin/mysqladmin --defaults-file="${HOME}"/debian.cnf ping && {
+            exec "${HOME}"/debian-start
+            # should not reach this line
+            exit 2
+        }
+        statusnow=`status`
+        if echo $statusnow | grep -q 'stop/' ; then
+            exit 0
+        elif echo $statusnow | grep -q 'respawn/' ; then
+            exit 1
+        fi
+        sleep 1
+    done
+    exit 1
+end script

+ 6 - 6
config/postgresql.conf

@@ -40,13 +40,13 @@
 
 data_directory = '/ssd/postgresql'		# use data in another directory
 					# (change requires restart)
-hba_file = '/etc/postgresql/9.1/main/pg_hba.conf'	# host-based authentication file
+hba_file = '/etc/postgresql/9.3/main/pg_hba.conf'	# host-based authentication file
 					# (change requires restart)
-ident_file = '/etc/postgresql/9.1/main/pg_ident.conf'	# ident configuration file
+ident_file = '/etc/postgresql/9.3/main/pg_ident.conf'	# ident configuration file
 					# (change requires restart)
 
 # If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/9.1-main.pid'		# write an extra PID file
+external_pid_file = '/var/run/postgresql/9.3-main.pid'		# write an extra PID file
 					# (change requires restart)
 
 
@@ -61,11 +61,11 @@ 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)
-unix_socket_directory = '/var/run/postgresql'		# (change requires restart)
+unix_socket_directories = '/var/run/postgresql'		# (change requires restart)
 #unix_socket_group = ''			# (change requires restart)
 #unix_socket_permissions = 0777		# begin with 0 to use octal notation
 					# (change requires restart)
@@ -77,7 +77,7 @@ unix_socket_directory = '/var/run/postgresql'		# (change requires restart)
 # - Security and Authentication -
 
 #authentication_timeout = 1min		# 1s-600s
-ssl = true				# (change requires restart)
+ssl = false                             # (change requires restart)
 #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH'	# allowed SSL ciphers
 					# (change requires restart)
 #ssl_renegotiation_limit = 512MB	# amount of data between renegotiations

+ 37 - 0
config/requirements-py3.txt

@@ -0,0 +1,37 @@
+mysqlclient==1.3.1
+PyMySQL==0.6.2
+psycopg2==2.5.3
+
+simplejson==3.5.2
+ujson==1.33
+# gevent==1.0.1 # gevent doesn't support Python 3 yet.
+# uwsgi is released too often to stick on single version.
+uwsgi
+
+gunicorn==19.0
+meinheld==0.5.6
+
+# Tornado
+tornado==3.2.2
+motor==0.3
+# pymongo is installed via motor dependency
+
+# Django
+Django==1.6.5
+
+# Flask
+Jinja2==2.7.3
+Werkzeug==0.9.6
+flask==0.10.1
+SQLAlchemy==0.9.4
+Flask-SQLAlchemy==1.0
+
+# Bottle
+bottle==0.12.7
+bottle-sqlalchemy==0.4.1
+
+# Falcon
+Cython==0.20.1
+falcon==0.1.8
+
+Momoko==1.1.3

+ 36 - 0
config/requirements-pypy.txt

@@ -0,0 +1,36 @@
+mysqlclient==1.3.1
+PyMySQL==0.6.2
+# TODO: Try psycopg2cffi
+#psycopg2==2.5.2
+
+#simplejson==3.4.1
+#ujson==1.33
+#gevent==1.0.1
+# uwsgi is released too often to stick on single version.
+uwsgi
+
+gunicorn==18.0
+meinheld==0.5.6
+
+# Tornado
+tornado==3.2.2
+motor==0.3
+# pymongo is installed via motor dependency
+
+# Django
+Django==1.6.5
+
+# Flask
+Jinja2==2.7.3
+Werkzeug==0.9.6
+flask==0.10.1
+SQLAlchemy==0.9.4
+Flask-SQLAlchemy==1.0
+
+# Bottle
+bottle==0.12.7
+bottle-sqlalchemy==0.4.1
+
+# Falcon
+# Cython==0.20.1
+falcon==0.1.8

+ 38 - 0
config/requirements.txt

@@ -0,0 +1,38 @@
+circus
+mysqlclient==1.3.1
+PyMySQL==0.6.2
+psycopg2==2.5.3
+
+simplejson==3.5.2
+ujson==1.33
+gevent==1.0.1
+# uwsgi is released too often to stick on single version.
+uwsgi
+
+gunicorn==19.0
+meinheld==0.5.6
+
+# Tornado
+tornado==3.2.2
+motor==0.3
+# pymongo is installed via motor dependency
+
+# Django
+Django==1.6.5
+
+# Flask
+Jinja2==2.7.3
+Werkzeug==0.9.6
+flask==0.10.1
+SQLAlchemy==0.9.4
+Flask-SQLAlchemy==1.0
+
+# Bottle
+bottle==0.12.7
+bottle-sqlalchemy==0.4.1
+
+# Falcon
+Cython==0.20.1
+falcon==0.1.8
+
+Momoko==1.1.3

+ 3 - 0
cowboy/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends erlang

+ 2 - 0
cpoll_cppsp/install.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+

+ 9 - 4
cpoll_cppsp/www/db

@@ -128,13 +128,18 @@ void efdCB(eventfd_t efdVal) {
 void waitCB(eventfd_t efdVal) {
 	this->doInit();
 }
-
-%>[<%
+%><%
+if (queries>1) {
+	%>[<%
+}
 for (int i=0;i<queries;i++){
 	if(i>0) output.write(',');
 	%>{"id":<%=items[i].id%>,"randomNumber":<%=items[i].rnd%>}<%
 }
-
+if (queries>1) {
+	%>]<%
+}
+%><%
 response->headers["Content-Type"]="application/json";
 response->headers["Server"]="cppsp/0.2";
-%>]
+%>

+ 9 - 4
cpoll_cppsp/www/db_pg_async

@@ -107,13 +107,18 @@ void evtIn(int) {
 	PQclear(res);
 	beginGetItems();
 }
-
-%>[<%
+%><%
+if(queries>1) {
+	%>[<%
+}
 for (int i=0;i<queries;i++){
 	if(i>0) output.write(',');
 	%>{"id":<%=items[i].id%>,"randomNumber":<%=items[i].rnd%>}<%
 }
-
+if(queries>1) {
+        %>]<%
+}
+%><%
 response->headers["Content-Type"]="application/json";
 response->headers["Server"]="cppsp/0.2";
-%>]
+%>

+ 9 - 4
cpoll_cppsp/www/db_pg_threadpool

@@ -94,13 +94,18 @@ void efdCB(eventfd_t efdVal) {
 void waitCB(eventfd_t efdVal) {
 	this->doInit();
 }
-
-%>[<%
+%><%
+if(queries>1) {
+	%>[<%
+}
 for (int i=0;i<queries;i++){
 	if(i>0) output.write(',');
 	%>{"id":<%=items[i].id%>,"randomNumber":<%=items[i].rnd%>}<%
 }
-
+if(queries>1) {
+        %>]<%
+}
+%><%
 response->headers["Content-Type"]="application/json";
 response->headers["Server"]="cppsp/0.2";
-%>]
+%>

+ 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 := {}

+ 3 - 0
curacao/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends java

+ 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>

+ 3 - 0
dancer/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends perl

+ 3 - 0
dart-start/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends dart nginx

+ 2 - 2
dart-start/setup.py

@@ -52,7 +52,7 @@ def start(args, logfile, errfile):
     #
     # start nginx
     #
-    subprocess.Popen('sudo /usr/sbin/nginx -c `pwd`/nginx.conf', shell=True, cwd='dart-start', stderr=errfile, stdout=logfile);
+    subprocess.Popen('sudo /usr/local/nginx/sbin/nginx -c `pwd`/nginx.conf', shell=True, cwd='dart-start', stderr=errfile, stdout=logfile);
     return 0
   except subprocess.CalledProcessError:
     return 1
@@ -61,7 +61,7 @@ def stop(logfile, errfile):
   #
   # stop nginx
   #
-  subprocess.check_call('sudo /usr/sbin/nginx -c `pwd`/nginx.conf -s stop', shell=True, cwd='dart-start', stderr=errfile, stdout=logfile)
+  subprocess.check_call('sudo /usr/local/nginx/sbin/nginx -c `pwd`/nginx.conf -s stop', shell=True, cwd='dart-start', stderr=errfile, stdout=logfile)
   os.remove('dart-start/nginx.conf')
   #
   # stop dart servers

+ 3 - 0
dart-stream/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends dart nginx

+ 2 - 2
dart-stream/setup.py

@@ -52,7 +52,7 @@ def start(args, logfile, errfile):
     #
     # start nginx
     #
-    subprocess.Popen('sudo /usr/sbin/nginx -c `pwd`/nginx.conf', shell=True, cwd='dart-stream', stderr=errfile, stdout=logfile);
+    subprocess.Popen('sudo /usr/local/nginx/sbin/nginx -c `pwd`/nginx.conf', shell=True, cwd='dart-stream', stderr=errfile, stdout=logfile);
     return 0
   except subprocess.CalledProcessError:
     return 1
@@ -61,7 +61,7 @@ def stop(logfile, errfile):
   #
   # stop nginx
   #
-  subprocess.check_call('sudo /usr/sbin/nginx -c `pwd`/nginx.conf -s stop', shell=True, cwd='dart-stream', stderr=errfile, stdout=logfile)
+  subprocess.check_call('sudo /usr/local/nginx/sbin/nginx -c `pwd`/nginx.conf -s stop', shell=True, cwd='dart-stream', stderr=errfile, stdout=logfile)
   os.remove('dart-stream/nginx.conf')
   #
   # stop dart servers

+ 3 - 0
dart/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends dart nginx

+ 3 - 0
django/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends python2 python3

+ 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
+

+ 3 - 0
dropwizard-mongodb/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends java

+ 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());
+  }
+
+}

+ 5 - 1
dropwizard/src/main/java/com/example/helloworld/core/World.java → dropwizard-mongodb/src/main/java/com/example/helloworld/core/World.java

@@ -3,12 +3,16 @@ 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
-  @GeneratedValue(strategy = GenerationType.AUTO)
   private long id;
 
   @Column(name = "randomNumber", nullable = false)

+ 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;
+  }
+}

+ 3 - 0
dropwizard/benchmark_config

@@ -6,6 +6,9 @@
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/db?queries=",
+      "fortune_url": "/fortunes",
+      "update_url": "/db/update?queries=",
+      "plaintext_url": "/plaintext",
       "port": 9000,
       "approach": "Realistic",
       "classification": "Fullstack",

+ 10 - 26
dropwizard/hello-world.yml

@@ -1,12 +1,16 @@
-http:
-  port: 9000
+server:
+  type: simple
+  applicationContextPath: /
+  connector:
+    type: http
+    port: 9000
+    useServerHeader: true
 
   requestLog:
+    appenders: []
 
-    # Settings for logging to stdout.
-    console:
-      # If true, log requests to stdout.
-      enabled: false
+logging:
+  appenders: []
 
 database:
   # the name of your JDBC driver
@@ -28,9 +32,6 @@ database:
   # the maximum amount of time to wait on an empty pool before throwing an exception
   maxWaitForConnection: 1s
 
-  # the SQL query to run when validating a connection's liveness
-  validationQuery: "/* MyService Health Check */ SELECT 1"
-
   # the minimum number of connections to keep open
   minSize: 8
 
@@ -39,20 +40,3 @@ database:
 
   # whether or not idle connections should be validated
   checkConnectionWhileIdle: false
-
-  # how long a connection must be held before it can be validated
-  checkConnectionHealthWhenIdleFor: 10s
-
-  # the maximum lifetime of an idle connection
-  closeConnectionIfIdleFor: 1 minute
-
-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
-

+ 3 - 0
dropwizard/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends java

+ 20 - 10
dropwizard/pom.xml

@@ -1,28 +1,38 @@
 <?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">
+<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.xekm</groupId>
     <artifactId>hello-world</artifactId>
     <version>0.0.1-SNAPSHOT</version>
 
+    <properties>
+        <jdk.version>1.7</jdk.version>
+
+        <dropwizard.version>0.7.0</dropwizard.version>
+        <mysql-connector-java.version>5.1.30</mysql-connector-java.version>
+    </properties>
+
     <dependencies>
         <dependency>
-            <groupId>com.yammer.dropwizard</groupId>
+            <groupId>io.dropwizard</groupId>
             <artifactId>dropwizard-core</artifactId>
-            <version>0.6.2</version>
+            <version>${dropwizard.version}</version>
         </dependency>
         <dependency>
-            <groupId>com.yammer.dropwizard</groupId>
+            <groupId>io.dropwizard</groupId>
             <artifactId>dropwizard-hibernate</artifactId>
-            <version>0.6.2</version>
+            <version>${dropwizard.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard</groupId>
+            <artifactId>dropwizard-views-mustache</artifactId>
+            <version>${dropwizard.version}</version>
         </dependency>
         <dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
-            <version>5.1.6</version>
+            <version>${mysql-connector-java.version}</version>
         </dependency>
     </dependencies>
 
@@ -33,8 +43,8 @@
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>2.3.2</version>
                 <configuration>
-                    <source>1.7</source>
-                    <target>1.7</target>
+                    <source>${jdk.version}</source>
+                    <target>${jdk.version}</target>
                 </configuration>
             </plugin>
             <plugin>

+ 14 - 10
dropwizard/setup.py

@@ -1,25 +1,29 @@
 import subprocess
-import sys
 import setup_util
 from os.path import expanduser
 import os
 
 home = expanduser("~")
 
+
 def start(args, logfile, errfile):
-    setup_util.replace_text("dropwizard/hello-world.yml", "url: jdbc:mysql://.*/hello_world", "url: jdbc:mysql://" + args.database_host + ":3306/hello_world")
+    setup_util.replace_text("dropwizard/hello-world.yml", "url: jdbc:mysql://.*/hello_world",
+                            "url: jdbc:mysql://" + args.database_host + ":3306/hello_world")
 
     try:
         subprocess.check_call("mvn clean package;", shell=True, cwd="dropwizard", stderr=errfile, stdout=logfile)
-        subprocess.Popen("java -jar target/hello-world-0.0.1-SNAPSHOT.jar server hello-world.yml", shell=True, cwd="dropwizard", stderr=errfile, stdout=logfile)
+        subprocess.Popen("java -jar target/hello-world-0.0.1-SNAPSHOT.jar server hello-world.yml", shell=True,
+                         cwd="dropwizard", 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
+    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

+ 15 - 5
dropwizard/source_code

@@ -1,10 +1,20 @@
 ./dropwizard/src/main/java/com/example/helloworld/
+./dropwizard/src/main/java/com/example/helloworld/config
+./dropwizard/src/main/java/com/example/helloworld/config/HelloWorldConfiguration
 ./dropwizard/src/main/java/com/example/helloworld/db
+./dropwizard/src/main/java/com/example/helloworld/db/model
+./dropwizard/src/main/java/com/example/helloworld/db/model/Fortune
+./dropwizard/src/main/java/com/example/helloworld/db/model/World
+./dropwizard/src/main/java/com/example/helloworld/db/FortuneDAO.java
 ./dropwizard/src/main/java/com/example/helloworld/db/WorldDAO.java
-./dropwizard/src/main/java/com/example/helloworld/HelloWorldService.java
 ./dropwizard/src/main/java/com/example/helloworld/resources
-./dropwizard/src/main/java/com/example/helloworld/resources/WorldResource.java
+./dropwizard/src/main/java/com/example/helloworld/resources/api
+./dropwizard/src/main/java/com/example/helloworld/resources/api/HelloMessage
+./dropwizard/src/main/java/com/example/helloworld/resources/views
+./dropwizard/src/main/java/com/example/helloworld/resources/views/FortuneView
+./dropwizard/src/main/java/com/example/helloworld/resources/FortuneResource.java
 ./dropwizard/src/main/java/com/example/helloworld/resources/JsonResource.java
-./dropwizard/src/main/java/com/example/helloworld/core
-./dropwizard/src/main/java/com/example/helloworld/core/World.java
-./dropwizard/src/main/java/com/example/helloworld/HelloWorldConfiguration.java
+./dropwizard/src/main/java/com/example/helloworld/resources/TextResource.java
+./dropwizard/src/main/java/com/example/helloworld/resources/WorldResource.java
+./dropwizard/src/main/java/com/example/helloworld/HelloWorldService.java
+./dropwizard/src/main/resources/fortunes.mustache

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

@@ -1,25 +0,0 @@
-
-package com.example.helloworld;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-
-import org.hibernate.validator.constraints.NotEmpty;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.yammer.dropwizard.config.Configuration;
-import com.yammer.dropwizard.db.DatabaseConfiguration;
-
-public class HelloWorldConfiguration
-    extends Configuration
-{
-  @Valid
-  @NotNull
-  @JsonProperty
-  private DatabaseConfiguration database    = new DatabaseConfiguration();
-
-  public DatabaseConfiguration getDatabaseConfiguration()
-  {
-    return database;
-  }
-}

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels