Browse Source

Merge branch 'master' into travis-tfb-command

Nate 8 years ago
parent
commit
60678f857d
75 changed files with 526 additions and 1523 deletions
  1. 1 0
      .travis.yml
  2. 3 3
      benchmark.cfg.example
  3. 0 2
      frameworks/C++/cpoll_cppsp/setup.sh
  4. 1 1
      frameworks/C++/cpoll_cppsp/www/connectioninfo.H
  5. 7 7
      frameworks/C++/cutelyst/benchmark_config.json
  6. 58 0
      frameworks/C++/cutelyst/config.sh
  7. 1 0
      frameworks/C++/cutelyst/config/config.ini
  8. 1 0
      frameworks/C++/cutelyst/config/config_socket.ini
  9. 0 22
      frameworks/C++/cutelyst/setup.sh
  10. 8 0
      frameworks/C++/cutelyst/setup_pf.sh
  11. 8 0
      frameworks/C++/cutelyst/setup_pf_my.sh
  12. 8 0
      frameworks/C++/cutelyst/setup_pf_pg.sh
  13. 5 18
      frameworks/C++/cutelyst/setup_thread.sh
  14. 8 0
      frameworks/C++/cutelyst/setup_thread_my.sh
  15. 8 0
      frameworks/C++/cutelyst/setup_thread_pg.sh
  16. 5 20
      frameworks/C++/cutelyst/setup_uwsgi_nginx.sh
  17. 8 0
      frameworks/C++/cutelyst/setup_uwsgi_nginx_my.sh
  18. 8 0
      frameworks/C++/cutelyst/setup_uwsgi_nginx_pg.sh
  19. 26 21
      frameworks/C++/cutelyst/src/cutelyst-benchmarks.cpp
  20. 8 8
      frameworks/C++/cutelyst/src/databaseupdatestest.cpp
  21. 4 4
      frameworks/C++/cutelyst/src/fortunetest.cpp
  22. 4 4
      frameworks/C++/cutelyst/src/multipledatabasequeriestest.cpp
  23. 4 4
      frameworks/C++/cutelyst/src/singledatabasequerytest.cpp
  24. 1 1
      frameworks/C/h2o/setup.sh
  25. 1 1
      frameworks/Clojure/compojure/hello/src/hello/handler.clj
  26. 0 2
      frameworks/Clojure/compojure/setup.sh
  27. 3 3
      frameworks/JavaScript/hapi/benchmark_config.json
  28. 0 8
      frameworks/JavaScript/hapi/create-server.js
  29. 0 133
      frameworks/JavaScript/hapi/handlers/redis.js
  30. 0 5
      frameworks/JavaScript/hapi/setup-mongodb.sh
  31. 0 5
      frameworks/JavaScript/hapi/setup-mysql.sh
  32. 0 5
      frameworks/JavaScript/hapi/setup-postgresql.sh
  33. 1 2
      frameworks/JavaScript/hapi/setup.sh
  34. 5 5
      frameworks/JavaScript/nodejs/benchmark_config.json
  35. 0 117
      frameworks/JavaScript/nodejs/handlers/redis.js
  36. 0 1
      frameworks/JavaScript/nodejs/package.json
  37. 0 8
      frameworks/JavaScript/nodejs/routing.js
  38. 0 5
      frameworks/JavaScript/nodejs/setup-mongodb.sh
  39. 0 5
      frameworks/JavaScript/nodejs/setup-mysql.sh
  40. 0 5
      frameworks/JavaScript/nodejs/setup-postgresql.sh
  41. 1 2
      frameworks/JavaScript/nodejs/setup.sh
  42. 2 2
      frameworks/JavaScript/ringojs/ringo-main.js
  43. 1 2
      frameworks/JavaScript/ringojs/setup.sh
  44. 31 26
      frameworks/Kotlin/hexagon/benchmark_config.json
  45. 14 9
      frameworks/Kotlin/hexagon/build.gradle
  46. 6 6
      frameworks/Kotlin/hexagon/gradle.properties
  47. 1 1
      frameworks/Kotlin/hexagon/gradle/wrapper.properties
  48. 49 35
      frameworks/Kotlin/hexagon/readme.md
  49. 1 1
      frameworks/Kotlin/hexagon/setup.sh
  50. 2 1
      frameworks/Kotlin/hexagon/setup_resin.sh
  51. 0 1
      frameworks/Kotlin/hexagon/source_code
  52. 20 33
      frameworks/Kotlin/hexagon/src/main/kotlin/co/there4/hexagon/Benchmark.kt
  53. 27 35
      frameworks/Kotlin/hexagon/src/main/kotlin/co/there4/hexagon/BenchmarkStorage.kt
  54. 1 5
      frameworks/Kotlin/hexagon/src/main/resources/logback.xml
  55. 2 0
      frameworks/Kotlin/hexagon/src/main/resources/service.yaml
  56. 42 14
      frameworks/Kotlin/hexagon/src/test/kotlin/co/there4/hexagon/BenchmarkTest.kt
  57. 0 21
      frameworks/Kotlin/hexagon/src/test/resources/logback-test.xml
  58. 2 5
      frameworks/Lua/octopus/setup.sh
  59. 13 0
      frameworks/Rust/tokio-minihttp/Cargo.toml
  60. 22 0
      frameworks/Rust/tokio-minihttp/benchmark_config.json
  61. 7 0
      frameworks/Rust/tokio-minihttp/setup.sh
  62. 53 0
      frameworks/Rust/tokio-minihttp/src/main.rs
  63. 7 7
      frameworks/Scala/fintrospect/build.sbt
  64. 2 3
      frameworks/Scala/fintrospect/src/main/scala/DatabaseRoutes.scala
  65. 1 2
      frameworks/Scala/fintrospect/src/main/scala/JsonRoute.scala
  66. 1 2
      frameworks/Scala/fintrospect/src/main/scala/PlainTextRoute.scala
  67. 7 15
      toolset/benchmark/framework_test.py
  68. 7 5
      toolset/run-tests.py
  69. 0 50
      toolset/setup/linux/config/benchmark_profile
  70. 0 1
      toolset/setup/linux/databases/redis/README.md
  71. 0 27
      toolset/setup/linux/databases/redis/create-redis.sh
  72. 0 709
      toolset/setup/linux/databases/redis/redis.conf
  73. 2 3
      toolset/setup/linux/frameworks/cutelyst.sh
  74. 3 75
      toolset/setup/linux/setup_util.py
  75. 4 0
      toolset/travis/travis_setup.sh

+ 1 - 0
.travis.yml

@@ -173,6 +173,7 @@ env:
     - "TESTDIR=Rust/iron"
     - "TESTDIR=Rust/iron"
     - "TESTDIR=Rust/nickel"
     - "TESTDIR=Rust/nickel"
     - "TESTDIR=Rust/hyper"
     - "TESTDIR=Rust/hyper"
+    - "TESTDIR=Rust/tokio-minihttp"
     - "TESTDIR=Scala/akka-http"
     - "TESTDIR=Scala/akka-http"
     - "TESTDIR=Scala/colossus"
     - "TESTDIR=Scala/colossus"
     - "TESTDIR=Scala/finagle"
     - "TESTDIR=Scala/finagle"

+ 3 - 3
benchmark.cfg.example

@@ -1,9 +1,9 @@
 [Defaults]
 [Defaults]
 # Available Keys: 
 # Available Keys: 
-client_host=127.0.0.1
+client_host=TFB-client
 client_identity_file=None
 client_identity_file=None
 client_user=techempower
 client_user=techempower
-database_host=127.0.0.1
+database_host=TFB-database
 database_identity_file=None
 database_identity_file=None
 database_os=linux
 database_os=linux
 database_user=techempower
 database_user=techempower
@@ -20,7 +20,7 @@ query_levels=[1, 5,10,15,20]
 threads=8
 threads=8
 mode=benchmark
 mode=benchmark
 os=linux
 os=linux
-server_host=127.0.0.1
+server_host=TFB-server
 sleep=60
 sleep=60
 test=None
 test=None
 type=all
 type=all

+ 0 - 2
frameworks/C++/cpoll_cppsp/setup.sh

@@ -1,7 +1,5 @@
 #!/bin/bash
 #!/bin/bash
 
 
-sed -i 's|#define BENCHMARK_DB_HOST ".*"|#define BENCHMARK_DB_HOST "'"$DBHOST"'"|g' www/connectioninfo.H
-
 fw_depends postgresql-server-dev-9.3 cppsp
 fw_depends postgresql-server-dev-9.3 cppsp
 
 
 make clean
 make clean

+ 1 - 1
frameworks/C++/cpoll_cppsp/www/connectioninfo.H

@@ -1,4 +1,4 @@
-#define BENCHMARK_DB_HOST "localhost"
+#define BENCHMARK_DB_HOST "TFB-database"
 #define MYSQL_MAX_CONNECTIONS 3000
 #define MYSQL_MAX_CONNECTIONS 3000
 
 
 #include <stdexcept>
 #include <stdexcept>

+ 7 - 7
frameworks/C++/cutelyst/benchmark_config.json

@@ -2,7 +2,7 @@
     "framework": "cutelyst",
     "framework": "cutelyst",
     "tests": [{
     "tests": [{
             "default": {
             "default": {
-                "setup_file": "setup",
+                "setup_file": "setup_pf",
                 "json_url": "/json",
                 "json_url": "/json",
                 "plaintext_url": "/plaintext",
                 "plaintext_url": "/plaintext",
                 "port": 8080,
                 "port": 8080,
@@ -21,7 +21,7 @@
                 "versus": ""
                 "versus": ""
             },
             },
             "postgres-raw": {
             "postgres-raw": {
-                "setup_file": "setup",
+                "setup_file": "setup_pf_pg",
                 "db_url": "/db_postgres",
                 "db_url": "/db_postgres",
                 "query_url": "/query_postgres?queries=",
                 "query_url": "/query_postgres?queries=",
                 "update_url": "/updates_postgres?queries=",
                 "update_url": "/updates_postgres?queries=",
@@ -42,7 +42,7 @@
                 "versus": ""
                 "versus": ""
             },
             },
             "mysql-raw": {
             "mysql-raw": {
-                "setup_file": "setup",
+                "setup_file": "setup_pf_my",
                 "db_url": "/db_mysql",
                 "db_url": "/db_mysql",
                 "query_url": "/query_mysql?queries=",
                 "query_url": "/query_mysql?queries=",
                 "update_url": "/updates_mysql?queries=",
                 "update_url": "/updates_mysql?queries=",
@@ -82,7 +82,7 @@
                 "versus": ""
                 "versus": ""
             },
             },
             "thread-postgres-raw": {
             "thread-postgres-raw": {
-                "setup_file": "setup_thread",
+                "setup_file": "setup_thread_pg",
                 "db_url": "/db_postgres",
                 "db_url": "/db_postgres",
                 "query_url": "/query_postgres?queries=",
                 "query_url": "/query_postgres?queries=",
                 "update_url": "/updates_postgres?queries=",
                 "update_url": "/updates_postgres?queries=",
@@ -103,7 +103,7 @@
                 "versus": ""
                 "versus": ""
             },
             },
             "thread-mysql-raw": {
             "thread-mysql-raw": {
-                "setup_file": "setup_thread",
+                "setup_file": "setup_thread_my",
                 "db_url": "/db_mysql",
                 "db_url": "/db_mysql",
                 "query_url": "/query_mysql?queries=",
                 "query_url": "/query_mysql?queries=",
                 "update_url": "/updates_mysql?queries=",
                 "update_url": "/updates_mysql?queries=",
@@ -143,7 +143,7 @@
                 "versus": ""
                 "versus": ""
             },
             },
             "nginx-postgres-raw": {
             "nginx-postgres-raw": {
-                "setup_file": "setup_uwsgi_nginx",
+                "setup_file": "setup_uwsgi_nginx_pg",
                 "db_url": "/db_postgres",
                 "db_url": "/db_postgres",
                 "query_url": "/query_postgres?queries=",
                 "query_url": "/query_postgres?queries=",
                 "update_url": "/updates_postgres?queries=",
                 "update_url": "/updates_postgres?queries=",
@@ -164,7 +164,7 @@
                 "versus": ""
                 "versus": ""
             },
             },
             "nginx-mysql-raw": {
             "nginx-mysql-raw": {
-                "setup_file": "setup_uwsgi_nginx",
+                "setup_file": "setup_uwsgi_nginx_my",
                 "db_url": "/db_mysql",
                 "db_url": "/db_mysql",
                 "query_url": "/query_mysql?queries=",
                 "query_url": "/query_mysql?queries=",
                 "update_url": "/updates_mysql?queries=",
                 "update_url": "/updates_mysql?queries=",

+ 58 - 0
frameworks/C++/cutelyst/config.sh

@@ -0,0 +1,58 @@
+#!/bin/bash
+
+fw_depends cutelyst
+
+# configure
+# DRIVER
+# UWSGI
+# NGINX
+# PROCESS_OR_THREAD
+
+echo DRIVER=${DRIVER}
+echo UWSGI=${UWSGI}
+echo NGINX=${NGINX}
+echo QT_VERSION_MM=${QT_VERSION_MM}
+
+if [ "${DRIVER}" == "QMYSQL" ]; then
+  fw_depends mysql
+elif [ "${DRIVER}" == "QPSQL" ]; then
+  fw_depends postgresql
+fi
+
+
+mkdir ${IROOT}/cutelyst-benchmarks || true
+cd ${IROOT}/cutelyst-benchmarks
+
+# build
+export CMAKE_PREFIX_PATH=/opt/qt${QT_VERSION_MM}:${IROOT}
+cmake $TROOT -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$IROOT
+make -j $MAX_THREADS
+
+if [ -n "${UWSGI}" ]; then
+  cp -v ${TROOT}/config/config_socket.ini ${IROOT}/config.ini
+  SEND_DATE=true
+else
+  cp -v ${TROOT}/config/config.ini ${IROOT}/config.ini
+  SEND_DATE=false
+fi
+
+sed -i "s|Driver=.*|Driver=${DRIVER}|g" ${IROOT}/config.ini
+sed -i "s|DatabaseHostName=.*|DatabaseHostName=${DBHOST}|g" ${IROOT}/config.ini
+sed -i "s|SendDate=.*|SendDate=${SEND_DATE}|g" ${IROOT}/config.ini
+
+export LD_LIBRARY_PATH=/opt/qt${QT_VERSION_MM}/lib:${IROOT}/lib/x86_64-linux-gnu/
+
+if [ -n "${UWSGI}" ]; then
+  uwsgi --ini ${IROOT}/config.ini --cutelyst-app ${IROOT}/cutelyst-benchmarks/src/libcutelyst_benchmarks.so ${PROCESS_OR_THREAD} $MAX_THREADS &
+else
+  ${IROOT}/bin/cutelyst-wsgi --ini ${IROOT}/config.ini -a ${IROOT}/cutelyst-benchmarks/src/libcutelyst_benchmarks.so ${PROCESS_OR_THREAD} $MAX_THREADS &
+fi
+
+# configure Nginx
+if [ -n "${NGINX}" ]; then
+  fw_depends nginx
+  cp -v ${TROOT}/nginx.conf ${IROOT}/nginx.conf
+  sed -i "s|include .*/conf/uwsgi_params;|include ${NGINX_HOME}/conf/uwsgi_params;|g" ${IROOT}/nginx.conf
+  nginx -c ${IROOT}/nginx.conf
+fi
+

+ 1 - 0
frameworks/C++/cutelyst/config/config.ini

@@ -17,5 +17,6 @@ pidfile = /tmp/uwsgi.pid
 plugin = cutelyst
 plugin = cutelyst
 
 
 [Cutelyst]
 [Cutelyst]
+Driver=
 DatabaseHostName=
 DatabaseHostName=
 SendDate=
 SendDate=

+ 1 - 0
frameworks/C++/cutelyst/config/config_socket.ini

@@ -20,5 +20,6 @@ pidfile = /tmp/uwsgi.pid
 plugin = cutelyst
 plugin = cutelyst
 
 
 [Cutelyst]
 [Cutelyst]
+Driver=
 DatabaseHostName=
 DatabaseHostName=
 SendDate=
 SendDate=

+ 0 - 22
frameworks/C++/cutelyst/setup.sh

@@ -1,22 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql postgresql cutelyst
-
-sed -i 's|DatabaseHostName=.*|DatabaseHostName='"$DBHOST"'|g' config/config.ini
-sed -i 's|SendDate=.*|SendDate=false|g' config/config.ini
-
-cd $IROOT
-mkdir cutelyst-benchmarks || true
-cd cutelyst-benchmarks
-
-QT_VERSION_MM=56
-export CMAKE_PREFIX_PATH=/opt/qt${QT_VERSION_MM}:${IROOT}
-
-cmake $TROOT -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$IROOT
-
-make -j $MAX_THREADS
-
-export LD_LIBRARY_PATH=/opt/qt${QT_VERSION_MM}/lib:${IROOT}/lib/x86_64-linux-gnu/
-export CUTELYST_CONFIG=${TROOT}/config/config.ini
-
-${IROOT}/bin/cutelyst-wsgi --http-socket :8080 -a ${IROOT}/cutelyst-benchmarks/src/libcutelyst_benchmarks.so -p $MAX_THREADS &

+ 8 - 0
frameworks/C++/cutelyst/setup_pf.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+DRIVER=
+UWSGI=
+NGINX=
+PROCESS_OR_THREAD=-p
+
+source ${TROOT}/config.sh

+ 8 - 0
frameworks/C++/cutelyst/setup_pf_my.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+DRIVER=QMYSQL
+UWSGI=
+NGINX=
+PROCESS_OR_THREAD=-p
+
+source ${TROOT}/config.sh

+ 8 - 0
frameworks/C++/cutelyst/setup_pf_pg.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+DRIVER=QPSQL
+UWSGI=
+NGINX=
+PROCESS_OR_THREAD=-p
+
+source ${TROOT}/config.sh

+ 5 - 18
frameworks/C++/cutelyst/setup_thread.sh

@@ -1,21 +1,8 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql postgresql cutelyst
+DRIVER=
+UWSGI=
+NGINX=
+PROCESS_OR_THREAD=-t
 
 
-sed -i 's|DatabaseHostName=.*|DatabaseHostName='"$DBHOST"'|g' config/config.ini
-sed -i 's|SendDate=.*|SendDate=false|g' config/config.ini
-
-cd $IROOT
-mkdir cutelyst-benchmarks || true
-cd cutelyst-benchmarks
-
-QT_VERSION_MM=56
-export CMAKE_PREFIX_PATH=/opt/qt${QT_VERSION_MM}:${IROOT}
-
-cmake $TROOT -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$IROOT
-
-make -j $MAX_THREADS
-
-export LD_LIBRARY_PATH=/opt/qt${QT_VERSION_MM}/lib:${IROOT}/lib/x86_64-linux-gnu/
-
-${IROOT}/bin/cutelyst-wsgi --ini ${TROOT}/config/config.ini --http-socket :8080 -a ${IROOT}/cutelyst-benchmarks/src/libcutelyst_benchmarks.so -t $MAX_THREADS &
+source ${TROOT}/config.sh

+ 8 - 0
frameworks/C++/cutelyst/setup_thread_my.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+DRIVER=QMYSQL
+UWSGI=
+NGINX=
+PROCESS_OR_THREAD=-t
+
+source ${TROOT}/config.sh

+ 8 - 0
frameworks/C++/cutelyst/setup_thread_pg.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+DRIVER=QPSQL
+UWSGI=
+NGINX=
+PROCESS_OR_THREAD=-t
+
+source ${TROOT}/config.sh

+ 5 - 20
frameworks/C++/cutelyst/setup_uwsgi_nginx.sh

@@ -1,23 +1,8 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql postgresql cutelyst nginx
+DRIVER=
+UWSGI=1
+NGINX=1
+PROCESS_OR_THREAD=-p
 
 
-sed -i 's|DatabaseHostName=.*|DatabaseHostName='"$DBHOST"'|g' config/config_socket.ini
-sed -i 's|SendDate=.*|SendDate=false|g' config/config_socket.ini
-sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
-
-cd $IROOT
-mkdir cutelyst-benchmarks || true
-cd cutelyst-benchmarks
-
-QT_VERSION_MM=56
-export CMAKE_PREFIX_PATH=/opt/qt${QT_VERSION_MM}:${IROOT}
-
-cmake $TROOT -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$IROOT
-
-make -j $MAX_THREADS
-
-nginx -c $TROOT/nginx.conf
-
-export LD_LIBRARY_PATH=/opt/qt${QT_VERSION_MM}/lib:${IROOT}/lib/x86_64-linux-gnu/
-uwsgi --ini ${TROOT}/config/config_socket.ini --cutelyst-app ${IROOT}/cutelyst-benchmarks/src/libcutelyst_benchmarks.so -p $MAX_THREADS &
+source ${TROOT}/config.sh

+ 8 - 0
frameworks/C++/cutelyst/setup_uwsgi_nginx_my.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+DRIVER=QMYSQL
+UWSGI=1
+NGINX=1
+PROCESS_OR_THREAD=-p
+
+source ${TROOT}/config.sh

+ 8 - 0
frameworks/C++/cutelyst/setup_uwsgi_nginx_pg.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+DRIVER=QPSQL
+UWSGI=1
+NGINX=1
+PROCESS_OR_THREAD=-p
+
+source ${TROOT}/config.sh

+ 26 - 21
frameworks/C++/cutelyst/src/cutelyst-benchmarks.cpp

@@ -1,6 +1,6 @@
 #include "cutelyst-benchmarks.h"
 #include "cutelyst-benchmarks.h"
 
 
-#include <Cutelyst/Plugins/StaticSimple/staticsimple.h>
+#include <Cutelyst/Plugins/Utils/Sql>
 
 
 #include <QtSql/QSqlDatabase>
 #include <QtSql/QSqlDatabase>
 #include <QtSql/QSqlError>
 #include <QtSql/QSqlError>
@@ -52,27 +52,32 @@ bool cutelyst_benchmarks::init()
 
 
 bool cutelyst_benchmarks::postFork()
 bool cutelyst_benchmarks::postFork()
 {
 {
-    QMutexLocker locker(&mutex);
-
-    QSqlDatabase db;
-    db = QSqlDatabase::addDatabase(QLatin1String("QPSQL"), QLatin1String("postgres-") + QThread::currentThread()->objectName());
-    db.setDatabaseName(QLatin1String("hello_world"));
-    db.setUserName(QLatin1String("benchmarkdbuser"));
-    db.setPassword(QLatin1String("benchmarkdbpass"));
-    db.setHostName(config(QLatin1String("DatabaseHostName")).toString());
-    if (!db.open()) {
-        qDebug() << "Error opening PostgreSQL db:" << db << db.connectionName() << db.lastError().databaseText();
-        return false;
-    }
 
 
-    db = QSqlDatabase::addDatabase(QLatin1String("QMYSQL"), QLatin1String("mysql-") + QThread::currentThread()->objectName());
-    db.setDatabaseName(QLatin1String("hello_world"));
-    db.setUserName(QLatin1String("benchmarkdbuser"));
-    db.setPassword(QLatin1String("benchmarkdbpass"));
-    db.setHostName(config(QLatin1String("DatabaseHostName")).toString());
-    if (!db.open()) {
-        qDebug() << "Error opening MySQL db:" << db << db.connectionName() << db.lastError().databaseText();
-        return false;
+    const auto driver = config(QLatin1String("Driver")).toString();
+    if (driver == QLatin1String("QPSQL")) {
+        QSqlDatabase db;
+        db = QSqlDatabase::addDatabase(driver, Sql::databaseNameThread(QStringLiteral("postgres")));
+        db.setDatabaseName(QLatin1String("hello_world"));
+        db.setUserName(QLatin1String("benchmarkdbuser"));
+        db.setPassword(QLatin1String("benchmarkdbpass"));
+        db.setHostName(config(QLatin1String("DatabaseHostName")).toString());
+        if (!db.open()) {
+            qDebug() << "Error opening PostgreSQL db:" << db << db.connectionName() << db.lastError().databaseText();
+            return false;
+        }
+    } else if (driver == QLatin1String("QMYSQL")) {
+        QMutexLocker locker(&mutex); // MySQL driver is not thread-safe
+
+        QSqlDatabase db;
+        db = QSqlDatabase::addDatabase(driver, Sql::databaseNameThread(QStringLiteral("mysql")));
+        db.setDatabaseName(QLatin1String("hello_world"));
+        db.setUserName(QLatin1String("benchmarkdbuser"));
+        db.setPassword(QLatin1String("benchmarkdbpass"));
+        db.setHostName(config(QLatin1String("DatabaseHostName")).toString());
+        if (!db.open()) {
+            qDebug() << "Error opening MySQL db:" << db << db.connectionName() << db.lastError().databaseText();
+            return false;
+        }
     }
     }
 
 
     qDebug() << "Connections" << QCoreApplication::applicationPid() << QThread::currentThread() << QSqlDatabase::connectionNames();
     qDebug() << "Connections" << QCoreApplication::applicationPid() << QThread::currentThread() << QSqlDatabase::connectionNames();

+ 8 - 8
frameworks/C++/cutelyst/src/databaseupdatestest.cpp

@@ -16,23 +16,23 @@ DatabaseUpdatesTest::DatabaseUpdatesTest(QObject *parent) : Controller(parent)
 
 
 void DatabaseUpdatesTest::updates_postgres(Context *c)
 void DatabaseUpdatesTest::updates_postgres(Context *c)
 {
 {
-    QSqlQuery query = CPreparedSqlQueryForDatabase(
+    QSqlQuery query = CPreparedSqlQueryThreadForDB(
                 QLatin1String("SELECT randomNumber FROM world WHERE id = :id"),
                 QLatin1String("SELECT randomNumber FROM world WHERE id = :id"),
-                QSqlDatabase::database(QLatin1String("postgres-") + QThread::currentThread()->objectName()));
-    QSqlQuery updateQuery = CPreparedSqlQueryForDatabase(
+                QStringLiteral("postgres"));
+    QSqlQuery updateQuery = CPreparedSqlQueryThreadForDB(
                 QLatin1String("UPDATE world SET randomNumber = :randomNumber WHERE id = :id"),
                 QLatin1String("UPDATE world SET randomNumber = :randomNumber WHERE id = :id"),
-                QSqlDatabase::database(QLatin1String("postgres-") + QThread::currentThread()->objectName()));
+                QStringLiteral("postgres"));
     processQuery(c, query, updateQuery);
     processQuery(c, query, updateQuery);
 }
 }
 
 
 void DatabaseUpdatesTest::updates_mysql(Context *c)
 void DatabaseUpdatesTest::updates_mysql(Context *c)
 {
 {
-    QSqlQuery query = CPreparedSqlQueryForDatabase(
+    QSqlQuery query = CPreparedSqlQueryThreadForDB(
                 QLatin1String("SELECT randomNumber FROM world WHERE id = :id"),
                 QLatin1String("SELECT randomNumber FROM world WHERE id = :id"),
-                QSqlDatabase::database(QLatin1String("mysql-") + QThread::currentThread()->objectName()));
-    QSqlQuery updateQuery = CPreparedSqlQueryForDatabase(
+                QStringLiteral("mysql"));
+    QSqlQuery updateQuery = CPreparedSqlQueryThreadForDB(
                 QLatin1String("UPDATE world SET randomNumber = :randomNumber WHERE id = :id"),
                 QLatin1String("UPDATE world SET randomNumber = :randomNumber WHERE id = :id"),
-                QSqlDatabase::database(QLatin1String("mysql-") + QThread::currentThread()->objectName()));
+                QStringLiteral("mysql"));
     processQuery(c, query, updateQuery);
     processQuery(c, query, updateQuery);
 }
 }
 
 

+ 4 - 4
frameworks/C++/cutelyst/src/fortunetest.cpp

@@ -13,18 +13,18 @@ FortuneTest::FortuneTest(QObject *parent) : Controller(parent)
 
 
 void FortuneTest::fortunes_raw_postgres(Context *c)
 void FortuneTest::fortunes_raw_postgres(Context *c)
 {
 {
-    QSqlQuery query = CPreparedSqlQueryForDatabase(
+    QSqlQuery query = CPreparedSqlQueryThreadForDB(
                 QLatin1String("SELECT id, message FROM fortune"),
                 QLatin1String("SELECT id, message FROM fortune"),
-                QSqlDatabase::database(QLatin1String("postgres-") + QThread::currentThread()->objectName()));
+                QStringLiteral("postgres"));
     auto fortunes = processQuery(c, query);
     auto fortunes = processQuery(c, query);
     renderRaw(c, fortunes);
     renderRaw(c, fortunes);
 }
 }
 
 
 void FortuneTest::fortunes_raw_mysql(Context *c)
 void FortuneTest::fortunes_raw_mysql(Context *c)
 {
 {
-    QSqlQuery query = CPreparedSqlQueryForDatabase(
+    QSqlQuery query = CPreparedSqlQueryThreadForDB(
                 QLatin1String("SELECT id, message FROM fortune"),
                 QLatin1String("SELECT id, message FROM fortune"),
-                QSqlDatabase::database(QLatin1String("mysql-") + QThread::currentThread()->objectName()));
+                QStringLiteral("mysql"));
     auto fortunes = processQuery(c, query);
     auto fortunes = processQuery(c, query);
     renderRaw(c, fortunes);
     renderRaw(c, fortunes);
 }
 }

+ 4 - 4
frameworks/C++/cutelyst/src/multipledatabasequeriestest.cpp

@@ -16,17 +16,17 @@ MultipleDatabaseQueriesTest::MultipleDatabaseQueriesTest(QObject *parent) : Cont
 
 
 void MultipleDatabaseQueriesTest::query_postgres(Context *c)
 void MultipleDatabaseQueriesTest::query_postgres(Context *c)
 {
 {
-    QSqlQuery query = CPreparedSqlQueryForDatabase(
+    QSqlQuery query = CPreparedSqlQueryThreadForDB(
                 QLatin1String("SELECT id, randomNumber FROM world WHERE id = :id"),
                 QLatin1String("SELECT id, randomNumber FROM world WHERE id = :id"),
-                QSqlDatabase::database(QLatin1String("postgres-") + QThread::currentThread()->objectName()));
+                QStringLiteral("postgres"));
     processQuery(c, query);
     processQuery(c, query);
 }
 }
 
 
 void MultipleDatabaseQueriesTest::query_mysql(Context *c)
 void MultipleDatabaseQueriesTest::query_mysql(Context *c)
 {
 {
-    QSqlQuery query = CPreparedSqlQueryForDatabase(
+    QSqlQuery query = CPreparedSqlQueryThreadForDB(
                 QLatin1String("SELECT id, randomNumber FROM world WHERE id = :id"),
                 QLatin1String("SELECT id, randomNumber FROM world WHERE id = :id"),
-                QSqlDatabase::database(QLatin1String("mysql-") + QThread::currentThread()->objectName()));
+                QStringLiteral("mysql"));
     processQuery(c, query);
     processQuery(c, query);
 }
 }
 
 

+ 4 - 4
frameworks/C++/cutelyst/src/singledatabasequerytest.cpp

@@ -15,17 +15,17 @@ SingleDatabaseQueryTest::SingleDatabaseQueryTest(QObject *parent) : Controller(p
 
 
 void SingleDatabaseQueryTest::db_postgres(Context *c)
 void SingleDatabaseQueryTest::db_postgres(Context *c)
 {
 {
-    QSqlQuery query = CPreparedSqlQueryForDatabase(
+    QSqlQuery query = CPreparedSqlQueryThreadForDB(
                 QLatin1String("SELECT id, randomNumber FROM world WHERE id = :id"),
                 QLatin1String("SELECT id, randomNumber FROM world WHERE id = :id"),
-                QSqlDatabase::database(QLatin1String("postgres-") + QThread::currentThread()->objectName()));
+                QStringLiteral("postgres"));
     processQuery(c, query);
     processQuery(c, query);
 }
 }
 
 
 void SingleDatabaseQueryTest::db_mysql(Context *c)
 void SingleDatabaseQueryTest::db_mysql(Context *c)
 {
 {
-    QSqlQuery query = CPreparedSqlQueryForDatabase(
+    QSqlQuery query = CPreparedSqlQueryThreadForDB(
                 QLatin1String("SELECT id, randomNumber FROM world WHERE id = :id"),
                 QLatin1String("SELECT id, randomNumber FROM world WHERE id = :id"),
-                QSqlDatabase::database(QLatin1String("mysql-") + QThread::currentThread()->objectName()));
+                QStringLiteral("mysql"));
     processQuery(c, query);
     processQuery(c, query);
 }
 }
 
 

+ 1 - 1
frameworks/C/h2o/setup.sh

@@ -36,7 +36,7 @@ run_curl()
 run_h2o_app()
 run_h2o_app()
 {
 {
 	"$1/h2o_app" -a1 -f "$2/template/fortunes.mustache" -m "$DB_CONN" "$3" "$4" \
 	"$1/h2o_app" -a1 -f "$2/template/fortunes.mustache" -m "$DB_CONN" "$3" "$4" \
-		-d "host=$DBHOST dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass" &
+		-d "host=TFB-database dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass" &
 }
 }
 
 
 generate_profile_data()
 generate_profile_data()

+ 1 - 1
frameworks/Clojure/compojure/hello/src/hello/handler.clj

@@ -29,7 +29,7 @@
   (mysql {
   (mysql {
           :classname "com.mysql.jdbc.Driver"
           :classname "com.mysql.jdbc.Driver"
           :subprotocol "mysql"
           :subprotocol "mysql"
-          :subname "//127.0.0.1:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
+          :subname "//TFB-database:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
           :user "benchmarkdbuser"
           :user "benchmarkdbuser"
           :password "benchmarkdbpass"
           :password "benchmarkdbpass"
           ;;OPTIONAL KEYS
           ;;OPTIONAL KEYS

+ 0 - 2
frameworks/Clojure/compojure/setup.sh

@@ -2,8 +2,6 @@
 
 
 fw_depends mysql java resin leiningen
 fw_depends mysql java resin leiningen
 
 
-sed -i 's|127.0.0.1|'"${DBHOST}"'|g' hello/src/hello/handler.clj
-
 cd hello
 cd hello
 lein clean
 lein clean
 lein ring uberwar
 lein ring uberwar

+ 3 - 3
frameworks/JavaScript/hapi/benchmark_config.json

@@ -2,7 +2,7 @@
   "framework": "hapi",
   "framework": "hapi",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup-mongodb",
+      "setup_file": "setup",
       "json_url": "/json",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "db_url": "/mongoose/db",
       "db_url": "/mongoose/db",
@@ -26,7 +26,7 @@
       "versus": "nodejs"
       "versus": "nodejs"
     },
     },
     "mysql": {
     "mysql": {
-      "setup_file": "setup-mysql",
+      "setup_file": "setup",
       "db_url": "/sequelize/db",
       "db_url": "/sequelize/db",
       "query_url": "/sequelize/queries?queries=",
       "query_url": "/sequelize/queries?queries=",
       "fortune_url": "/sequelize/fortunes",
       "fortune_url": "/sequelize/fortunes",
@@ -48,7 +48,7 @@
       "versus": "nodejs"
       "versus": "nodejs"
     },
     },
     "postgres": {
     "postgres": {
-      "setup_file": "setup-postgresql",
+      "setup_file": "setup",
       "db_url": "/sequelize-pg/db",
       "db_url": "/sequelize-pg/db",
       "query_url": "/sequelize-pg/queries?queries=",
       "query_url": "/sequelize-pg/queries?queries=",
       "fortune_url": "/sequelize-pg/fortunes",
       "fortune_url": "/sequelize-pg/fortunes",

+ 0 - 8
frameworks/JavaScript/hapi/create-server.js

@@ -22,19 +22,16 @@ var Promise = require('bluebird');
 var MongooseHandler;
 var MongooseHandler;
 var SequelizeHandler;
 var SequelizeHandler;
 var SequelizePgHandler;
 var SequelizePgHandler;
-// var RedisHandler;
 
 
 // Slight start-up improvement loading handlers in parallel
 // Slight start-up improvement loading handlers in parallel
 Promise.join(
 Promise.join(
   require('./handlers/mongoose'),
   require('./handlers/mongoose'),
   require('./handlers/sequelize'),
   require('./handlers/sequelize'),
   require('./handlers/sequelize-postgres'),
   require('./handlers/sequelize-postgres'),
-  // require('./handlers/redis'),
   function (mongo, mysql, pg) {
   function (mongo, mysql, pg) {
     MongooseHandler = mongo;
     MongooseHandler = mongo;
     SequelizeHandler = mysql;
     SequelizeHandler = mysql;
     SequelizePgHandler = pg;
     SequelizePgHandler = pg;
-    // RedisHandler = redis;
   })
   })
   .catch(function (err) {
   .catch(function (err) {
     console.log('There was a problem setting up the handlers');
     console.log('There was a problem setting up the handlers');
@@ -60,11 +57,6 @@ Route('/sequelize-pg/queries', SequelizePgHandler.MultipleQueries);
 Route('/sequelize-pg/fortunes', SequelizePgHandler.Fortunes);
 Route('/sequelize-pg/fortunes', SequelizePgHandler.Fortunes);
 Route('/sequelize-pg/updates', SequelizePgHandler.Updates);
 Route('/sequelize-pg/updates', SequelizePgHandler.Updates);
 
 
-// Route('/hiredis/db', RedisHandler.SingleQuery);
-// Route('/hiredis/queries', RedisHandler.MultipleQueries);
-// Route('/hiredis/fortunes', RedisHandler.Fortunes);
-// Route('/hiredis/updates', RedisHandler.Updates);
-
 
 
 function JsonSerialization(req, reply) {
 function JsonSerialization(req, reply) {
   reply({ message: 'Hello, World!' })
   reply({ message: 'Hello, World!' })

+ 0 - 133
frameworks/JavaScript/hapi/handlers/redis.js

@@ -1,133 +0,0 @@
-// Connects to Redis using the node_redis and hiredis drivers
-// Handles related routes
-
-// "If hiredis [pure C library] is installed, node_redis will use it by default.
-// Otherwise, a pure JavaScript parser will be used."
-// >> hiredis is installed for these tests
-
-var h = require('../helper');
-var Promise = require('bluebird');
-// Can treat redis library as one that supports Promises
-// these methods will then have "-Async" appended to them.
-var redis = Promise.promisifyAll(require('redis'));
-var client = redis.createClient(6379, '127.0.0.1', {});
-
-client.on('error', function (err) {
-  console.log('Redis Error: ' + err);
-  // Do nothing further if Redis errors/is unavailable
-});
-
-function redisWorldId(id) {
-  return 'world:' + id;
-}
-
-function randomWorldPromise() {
-  var id = h.randomTfbNumber();
-  var redisId = redisWorldId(id);
-
-  var promise = client.getAsync(redisId)
-    .then(function (worldValue) {
-      return {
-        id: id,
-        randomNumber: worldValue
-      }
-    })
-    .catch(function (err) {
-      process.exit(1);
-    });
-  return promise;
-}
-
-function redisSetWorld(world) {
-  var redisId = redisWorldId(world.id);
-  var promise = client
-    .setAsync(redisId, world.randomNumber)
-    .then(function (result) {
-      return world;
-    })
-    .catch(function (err) {
-      process.exit(1);
-    });
-  return promise;
-}
-
-function redisGetAllFortunes() {
-  var promise = client
-    .lrangeAsync('fortunes', 0, -1)
-    .then(function (fortuneMessages) {
-      var fortunes = fortuneMessages.map(function (e, i) {
-        return { id: i + 1, message: e }
-      });
-      return fortunes;
-    })
-    .catch(function (err) {
-      if (err) { return process.exit(1); }
-    });
-  return promise;
-}
-
-
-module.exports = {
-  
-  SingleQuery: function(req, reply) {
-    randomWorldPromise()
-      .then(function (world) {
-        reply(world)
-          .header('Server', 'hapi');
-      })
-      .catch(function (err) {
-        if (err) { return process.exit(1); }
-      })
-  },
-
-  MultipleQueries: function(req, reply) {
-    var queries = h.getQueries(req);
-    var worldPromises = h.fillArray(randomWorldPromise(), queries);
-
-    Promise
-      .all(worldPromises)
-      .then(function (worlds) {
-         reply(worlds)
-          .header('Server', 'hapi');
-      });
-  },
-
-  Fortunes: function(req, reply) {
-    redisGetAllFortunes()
-      .then(function (fortunes) {
-        fortunes.push(h.ADDITIONAL_FORTUNE);
-        fortunes.sort(function (a, b) {
-          return a.message.localeCompare(b.message);
-        });
-
-        reply.view('fortunes', {
-          fortunes: fortunes
-        })
-          .header('Content-Type', 'text/html')
-          .header('Server', 'hapi');
-      })
-      .catch(function (err) {
-        process.exit(1);
-      })
-  },
-
-  Updates: function(req, reply) {
-    var queries = h.getQueries(req)
-    var worldPromises = h.fillArray(randomWorldPromise(), queries);
-
-    Promise
-      .all(worldPromises)
-      .map(function (world) {
-        world.randomNumber = h.randomTfbNumber();
-        return redisSetWorld(world);
-      })
-      .then(function (updated) {
-        reply(updated)
-          .header('Server', 'hapi');
-      })
-      .catch(function (err) {
-        process.exit(1);
-      });
-  }
-
-};

+ 0 - 5
frameworks/JavaScript/hapi/setup-mongodb.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends mongodb
-
-source ./setup.sh

+ 0 - 5
frameworks/JavaScript/hapi/setup-mysql.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql
-
-source ./setup.sh

+ 0 - 5
frameworks/JavaScript/hapi/setup-postgresql.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql
-
-source ./setup.sh

+ 1 - 2
frameworks/JavaScript/hapi/setup.sh

@@ -1,11 +1,10 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends nodejs
+fw_depends mongodb postgresql mysql nodejs
 
 
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/mongoose.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/mongoose.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/sequelize-postgres.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/sequelize-postgres.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/sequelize.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/sequelize.js
-sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/redis.js
 
 
 npm install
 npm install
 node app &
 node app &

+ 5 - 5
frameworks/JavaScript/nodejs/benchmark_config.json

@@ -2,7 +2,7 @@
   "framework": "nodejs",
   "framework": "nodejs",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup-mysql",
+      "setup_file": "setup",
       "json_url": "/json",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "db_url": "/mysql/db",
       "db_url": "/mysql/db",
@@ -26,7 +26,7 @@
       "versus": "nodejs"
       "versus": "nodejs"
     },
     },
     "mongodb": {
     "mongodb": {
-      "setup_file": "setup-mongodb",
+      "setup_file": "setup",
       "db_url": "/mongoose/db",
       "db_url": "/mongoose/db",
       "query_url": "/mongoose/queries?queries=",
       "query_url": "/mongoose/queries?queries=",
       "update_url": "/mongoose/updates?queries=",
       "update_url": "/mongoose/updates?queries=",
@@ -47,7 +47,7 @@
       "versus": "nodejs"
       "versus": "nodejs"
     },
     },
     "mongodb-raw": {
     "mongodb-raw": {
-      "setup_file": "setup-mongodb",
+      "setup_file": "setup",
       "db_url": "/mongodb/db",
       "db_url": "/mongodb/db",
       "query_url": "/mongodb/queries?queries=",
       "query_url": "/mongodb/queries?queries=",
       "update_url": "/mongodb/updates?queries=",
       "update_url": "/mongodb/updates?queries=",
@@ -69,7 +69,7 @@
       "versus": "nodejs"
       "versus": "nodejs"
     },
     },
     "mysql": {
     "mysql": {
-      "setup_file": "setup-mysql",
+      "setup_file": "setup",
       "db_url": "/sequelize/db",
       "db_url": "/sequelize/db",
       "query_url": "/sequelize/queries?queries=",
       "query_url": "/sequelize/queries?queries=",
       "update_url": "/sequelize/updates?queries=",
       "update_url": "/sequelize/updates?queries=",
@@ -91,7 +91,7 @@
       "versus": "nodejs"
       "versus": "nodejs"
     },
     },
     "postgres": {
     "postgres": {
-      "setup_file": "setup-postgresql",
+      "setup_file": "setup",
       "db_url": "/sequelize-pg/db",
       "db_url": "/sequelize-pg/db",
       "query_url": "/sequelize-pg/queries?queries=",
       "query_url": "/sequelize-pg/queries?queries=",
       "update_url": "/sequelize-pg/updates?queries=",
       "update_url": "/sequelize-pg/updates?queries=",

+ 0 - 117
frameworks/JavaScript/nodejs/handlers/redis.js

@@ -1,117 +0,0 @@
-var h = require('../helper');
-var async = require('async');
-// "If hiredis [pure C library] is installed, node_redis will use it by default.
-// Otherwise, a pure JavaScript parser will be used."
-// >> Previous versions of this project installed hiredis; however, hiredis now has
-// >> installation issues and redis is no longer tested, so the hiredis dependency was taken out.
-// >> If redis tests are re-instated, try to re-add hiredis dependency; however, if it does
-// >> not install correctly, the tests will still work with the redis default JS parser
-var redis = require('redis');
-var client = redis.createClient(6379, '127.0.0.1', {});
-
-client.on('error', function (err) {
-  console.log('Redis Error: ' + err);
-  // Do nothing further if Redis errors/is unavailable
-});
-
-function redisWorldId(id) {
-  return 'world:' + id;
-}
-
-function redisRandomWorld(callback) {
-  var id = h.randomTfbNumber();
-  var redisId = redisWorldId(id);
-  client.get(redisId, function (err, worldValue) {
-    var world = {
-      id: id,
-      randomNumber: worldValue
-    }
-    callback(err, world);
-  });
-}
-
-function redisSetWorld(world, callback) {
-  var redisId = redisWorldId(world.id);
-  client.set(redisId, world.randomNumber, function (err, result) {
-    callback(err, world);
-  });
-}
-
-function redisGetAllFortunes(callback) {
-  client.lrange('fortunes', 0, -1, function (err, fortuneMessages) {
-    if (err) { return process.exit(1); }
-
-    var fortunes = fortuneMessages.map(function (e, i) {
-      return { id: i + 1, message: e }
-    });
-
-    callback(err, fortunes)
-  });
-}
-
-
-module.exports = {
-  
-  SingleQuery: function(req, res) {
-    redisRandomWorld(function (err, world) {
-      if (err) { return process.exit(1); }
-
-      h.addTfbHeaders(res, 'json');
-      res.end(JSON.stringify(world));
-    })
-  },
-
-  MultipleQueries: function(queries, req, res) {
-    var queryFunctions = h.fillArray(redisRandomWorld, queries);
-
-    async.parallel(queryFunctions, function (err, worlds) {
-      if (err) { return process.exit(1); }
-
-      h.addTfbHeaders(res, 'json');
-      res.end(JSON.stringify(worlds));
-    })
-  },
-
-  Fortunes: function(req, res) {
-    redisGetAllFortunes(function (err, fortunes) {
-      if (err) { return process.exit(1); }
-
-      h.addTfbHeaders(res, 'html');
-      fortunes.push(h.ADDITIONAL_FORTUNE);
-      fortunes.sort(function (a, b) {
-        return a.message.localeCompare(b.message);
-      });
-      res.end(h.fortunesTemplate({
-        fortunes: fortunes
-      }));
-    });
-  },
-
-  Updates: function(queries, req, res) {
-    var getFunctions = h.fillArray(redisRandomWorld, queries);
-
-    async.parallel(getFunctions, function (err, worlds) {
-      if (err) { return process.exit(1); }
-
-      var updateFunctions = [];
-
-      worlds.forEach(function (w) {
-        w.id = h.randomTfbNumber();
-        updateFunctions.push(function (callback) {
-          if (err) { return process.exit(1); }
-
-          return redisSetWorld(w, callback);
-        });
-      });
-
-      async.parallel(updateFunctions, function (err, updated) {
-        if (err) { return process.exit(1); }
-
-        h.addTfbHeaders(res, 'json');
-        res.end(JSON.stringify(updated));
-      });
-    });
-
-  }
-
-};

+ 0 - 1
frameworks/JavaScript/nodejs/package.json

@@ -12,7 +12,6 @@
     "parseurl": "1.3.1",
     "parseurl": "1.3.1",
     "pg": "6.0.2",
     "pg": "6.0.2",
     "pg-hstore": "2.3.2",
     "pg-hstore": "2.3.2",
-    "redis": "2.6.2",
     "sequelize": "3.6.0"
     "sequelize": "3.6.0"
   },
   },
   "main": "app.js"
   "main": "app.js"

+ 0 - 8
frameworks/JavaScript/nodejs/routing.js

@@ -1,12 +1,10 @@
 // Intialized database connections, one for each db config
 // Intialized database connections, one for each db config
 // * Mongoose is a popular Node/MongoDB driver
 // * Mongoose is a popular Node/MongoDB driver
 // * Sequelize is a popular Node/SQL driver
 // * Sequelize is a popular Node/SQL driver
-// * Node's redis package uses the C bindings of the hiredis library
 var MongodbRawHandler = require('./handlers/mongodb-raw');
 var MongodbRawHandler = require('./handlers/mongodb-raw');
 var MySQLRawHandler = require('./handlers/mysql-raw');
 var MySQLRawHandler = require('./handlers/mysql-raw');
 var MongooseHandler = require('./handlers/mongoose');
 var MongooseHandler = require('./handlers/mongoose');
 var SequelizeHandler = require('./handlers/sequelize');
 var SequelizeHandler = require('./handlers/sequelize');
-var HiredisHandler = require('./handlers/redis');
 var SequelizePgHandler = require('./handlers/sequelize-postgres');
 var SequelizePgHandler = require('./handlers/sequelize-postgres');
 
 
 var h = require('./helper');
 var h = require('./helper');
@@ -30,9 +28,6 @@ module.exports.BasicHandler = (function() {
     '/mysql/db':           MySQLRawHandler.SingleQuery,
     '/mysql/db':           MySQLRawHandler.SingleQuery,
     '/mysql/fortunes':     MySQLRawHandler.Fortunes,
     '/mysql/fortunes':     MySQLRawHandler.Fortunes,
 
 
-    '/hiredis/db':         HiredisHandler.SingleQuery,
-    '/hiredis/fortunes':   HiredisHandler.Fortunes,
-
     '/sequelize-pg/db':       SequelizePgHandler.SingleQuery,
     '/sequelize-pg/db':       SequelizePgHandler.SingleQuery,
     '/sequelize-pg/fortunes': SequelizePgHandler.Fortunes
     '/sequelize-pg/fortunes': SequelizePgHandler.Fortunes
   }
   }
@@ -64,9 +59,6 @@ module.exports.QueryHandler = (function () {
     '/mysql/queries':     MySQLRawHandler.MultipleQueries,
     '/mysql/queries':     MySQLRawHandler.MultipleQueries,
     '/mysql/updates':     MySQLRawHandler.Updates,
     '/mysql/updates':     MySQLRawHandler.Updates,
 
 
-    '/hiredis/queries':   HiredisHandler.MultipleQueries,
-    '/hiredis/updates':   HiredisHandler.Updates,
-
     '/sequelize-pg/queries': SequelizePgHandler.MultipleQueries,
     '/sequelize-pg/queries': SequelizePgHandler.MultipleQueries,
     '/sequelize-pg/updates': SequelizePgHandler.Updates
     '/sequelize-pg/updates': SequelizePgHandler.Updates
   }
   }

+ 0 - 5
frameworks/JavaScript/nodejs/setup-mongodb.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends mongodb
-
-source ./setup.sh

+ 0 - 5
frameworks/JavaScript/nodejs/setup-mysql.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql
-
-source ./setup.sh

+ 0 - 5
frameworks/JavaScript/nodejs/setup-postgresql.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql
-
-source ./setup.sh

+ 1 - 2
frameworks/JavaScript/nodejs/setup.sh

@@ -1,11 +1,10 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mongodb nodejs
+fw_depends mongodb mysql postgresql nodejs
 
 
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/mongodb-raw.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/mongodb-raw.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/mongoose.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/mongoose.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/mysql-raw.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/mysql-raw.js
-sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/redis.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/sequelize.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/sequelize.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/sequelize-postgres.js
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' handlers/sequelize-postgres.js
 
 

+ 2 - 2
frameworks/JavaScript/ringojs/ringo-main.js

@@ -3,8 +3,8 @@ var mustache = require('ringo/mustache');
 
 
 // DO NOT TOUCH THE FOLLOWING LINE.
 // DO NOT TOUCH THE FOLLOWING LINE.
 // THIS VARIABLE IS REGEX REPLACED BY setup.py
 // THIS VARIABLE IS REGEX REPLACED BY setup.py
-var dbHost = 'localhost';
-var mongodbUri = 'mongodb://localhost/hello_world';
+var dbHost = 'TFB-database';
+var mongodbUri = 'mongodb://TFB-database/hello_world';
 
 
 var sortFortunes = function(a, b) {
 var sortFortunes = function(a, b) {
  return (a.message < b.message) ? -1 : (a.message > b.message) ? 1 : 0;
  return (a.message < b.message) ? -1 : (a.message > b.message) ? 1 : 0;

+ 1 - 2
frameworks/JavaScript/ringojs/setup.sh

@@ -1,7 +1,5 @@
 #!/bin/bash
 #!/bin/bash
 
 
-sed -i 's|dbHost = \x27.*\x27;|dbHost = \x27'"${DBHOST}"'\x27|g' ringo-main.js
-
 fw_depends mysql java ringojs
 fw_depends mysql java ringojs
 
 
 rm -rf $RINGOJS_HOME/packages/*
 rm -rf $RINGOJS_HOME/packages/*
@@ -9,3 +7,4 @@ ringo-admin install oberhamsi/sql-ringojs-client
 (cd $RINGOJS_HOME/packages/sql-ringojs-client/jars && curl -s -o mysql.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.39/mysql-connector-java-5.1.39.jar)
 (cd $RINGOJS_HOME/packages/sql-ringojs-client/jars && curl -s -o mysql.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.39/mysql-connector-java-5.1.39.jar)
 
 
 ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js &
 ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js &
+

+ 31 - 26
frameworks/Kotlin/hexagon/benchmark_config.json

@@ -1,28 +1,33 @@
 {
 {
-  "framework": "hexagon",
-  "tests": [{
-    "default": {
-      "json_url" : "/json",
-      "db_url" : "/db",
-      "query_url" : "/query?queries=",
-      "fortune_url" : "/fortunes",
-      "update_url" : "/update?queries=",
-      "plaintext_url" : "/plaintext",
-      "port" : 9090,
-      "approach" : "Realistic",
-      "classification" : "Micro",
-      "database" : "MongoDB",
-      "framework" : "Hexagon",
-      "language" : "Kotlin",
-      "orm" : "Raw",
-      "platform" : "Servlet",
-      "webserver" : "None",
-      "os" : "Linux",
-      "database_os" : "Linux",
-      "display_name" : "Hexagon MongoDB",
-      "notes" : "http://there4.co/hexagon",
-      "setup_file" : "setup",
-      "versus" : "servlet"
-    }
-  }]
+    "framework" : "hexagon",
+    "tests" : [
+        {
+            "default" : {
+                "json_url" : "/json",
+                "db_url" : "/db",
+                "query_url" : "/query?queries=",
+                "fortune_url" : "/fortunes",
+                "update_url" : "/update?queries=",
+                "plaintext_url" : "/plaintext",
+
+                "port" : 9090,
+
+                "approach" : "Realistic",
+                "classification" : "Micro",
+                "database" : "MongoDB",
+                "framework" : "Hexagon",
+                "language" : "Kotlin",
+                "orm" : "Raw",
+                "platform" : "Servlet",
+                "webserver" : "None",
+                "os" : "Linux",
+                "database_os" : "Linux",
+                "display_name" : "Hexagon Jetty MongoDB",
+                "notes" : "http://there4.co/hexagon",
+
+                "setup_file" : "setup",
+                "versus" : "servlet"
+            }
+        }
+    ]
 }
 }

+ 14 - 9
frameworks/Kotlin/hexagon/build.gradle

@@ -10,26 +10,31 @@ buildscript {
     }
     }
 }
 }
 
 
-apply from: "$gradleScripts/hexagon.gradle"
+apply from: "$gradleScripts/kotlin.gradle"
 apply from: "$gradleScripts/service.gradle"
 apply from: "$gradleScripts/service.gradle"
 apply plugin: 'war'
 apply plugin: 'war'
 
 
 mainClassName = "co.there4.hexagon.BenchmarkKt"
 mainClassName = "co.there4.hexagon.BenchmarkKt"
 applicationDefaultJvmArgs = [
 applicationDefaultJvmArgs = [
-    '-Xms512M',
-    '-Xmx1024M',
-    '-server',
+    '-Xms64M',
+    '-Xmx2G',
     '-XX:+UseNUMA',
     '-XX:+UseNUMA',
     '-XX:+UseParallelGC',
     '-XX:+UseParallelGC',
     '-XX:+AggressiveOpts'
     '-XX:+AggressiveOpts'
 ]
 ]
 
 
-clean {
-    delete "systems/load_test.jtl", "systems/jmeter.log"
-}
-
 war {
 war {
     archiveName = "ROOT.war"
     archiveName = "ROOT.war"
 }
 }
 
 
-installDist.dependsOn 'war'
+install.dependsOn 'war'
+
+dependencies {
+    compile ("co.there4:hexagon:$hexagonVersion")
+    compile ("com.mitchellbosecke:pebble:$pebbleVersion")
+
+    // providedCompile excludes the dependency only in the WAR, not in the distribution
+    providedCompile ("org.eclipse.jetty:jetty-webapp:$jettyVersion") { exclude module: "slf4j-api" }
+
+    testCompile ("co.there4:hexagon:$hexagonVersion:test")
+}

+ 6 - 6
frameworks/Kotlin/hexagon/gradle.properties

@@ -1,11 +1,11 @@
 
 
-version=1.0.0
-group=co.there4.hexagon
 description=Hexagon web framework's benchmark
 description=Hexagon web framework's benchmark
 
 
-wrapperGradleVersion=3.2.1
-gradleScripts=https://raw.githubusercontent.com/jaguililla/hexagon/a1a489ba2e0a512c7012028a5e7b079f1aea345f/gradle
+gradleScripts=https://raw.githubusercontent.com/jaguililla/hexagon/0.10.3/gradle
 
 
 dokkaVersion=0.9.11
 dokkaVersion=0.9.11
-kotlinVersion=1.0.5-2
-hexagonVersion=0.9.11
+kotlinVersion=1.0.6
+
+hexagonVersion=0.10.3
+pebbleVersion=2.3.0
+jettyVersion=9.3.14.v20161028

+ 1 - 1
frameworks/Kotlin/hexagon/gradle/wrapper.properties

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

+ 49 - 35
frameworks/Kotlin/hexagon/readme.md

@@ -4,52 +4,66 @@
 This is the Hexagon portion of a [benchmarking test suite](../) comparing a variety of web
 This is the Hexagon portion of a [benchmarking test suite](../) comparing a variety of web
 development platforms. The test utilizes Hexagon routes, serialization and database access.
 development platforms. The test utilizes Hexagon routes, serialization and database access.
 
 
-
-## Local setup
-
-    tar -Jxvf db.txz && \
-    mongorestore dump/ && \
-    rm -rf dump
-
-
 ## Tests
 ## Tests
 
 
-* [Hexagon application](/src/main/java/co/there4/hexagon/Benchmark.kt)
-
+* [Hexagon Web](/src/main/java/co/there4/hexagon/Benchmark.kt)
+* [Hexagon Storage](/src/main/java/co/there4/hexagon/BenchmarkStorage.kt)
 
 
 ## Infrastructure Software Versions
 ## Infrastructure Software Versions
 
 
-* [Hexagon 0.3.2](http://there4.co/hexagon)
-
+* [Hexagon 0.10.x](http://there4.co/hexagon)
 
 
 ## Test URLs
 ## Test URLs
 
 
-* JSON Encoding Test: http://localhost:5050/json
-* Data-Store/Database Mapping Test: http://localhost:5050/db?queries=5 
-* Plain Text Test: http://localhost:5050/plaintext 
-* Fortunes: http://localhost:5050/fortune 
-* Database updates: http://localhost:5050/update
-
-## Run on OpenShift
-
-https://blog.openshift.com/run-gradle-builds-on-openshift/
+### Jetty
 
 
+* JSON Encoding Test: http://localhost:9090/json
+* Data-Store/Database Mapping Test: http://localhost:9090/db?queries=5 
+* Plain Text Test: http://localhost:9090/plaintext 
+* Fortunes: http://localhost:9090/fortunes
+* Database updates: http://localhost:9090/update
+* Database queries: http://localhost:9090/query
 
 
-## Copy to TFB
+### Resin
 
 
-    rm -f db.txz
-    
-## Run inside vagrant
-
-    toolset/run-tests.py --install server --mode verify --test hexagon
-    
-## Clear
+* JSON Encoding Test: http://localhost:8080/json
+* Data-Store/Database Mapping Test: http://localhost:8080/db?queries=5 
+* Plain Text Test: http://localhost:8080/plaintext 
+* Fortunes: http://localhost:8080/fortunes
+* Database updates: http://localhost:8080/update
+* Database queries: http://localhost:8080/query
     
     
+#### Resin configuration
+
+    "resin" : { 
+      "json_url" : "/json",
+      "db_url" : "/db",
+      "query_url" : "/query?queries=",
+      "fortune_url" : "/fortunes",
+      "update_url" : "/update?queries=",
+      "plaintext_url" : "/plaintext",
+ 
+      "port" : 8080,
+ 
+      "approach" : "Realistic",
+      "classification" : "Micro",
+      "database" : "MongoDB",
+      "framework" : "Hexagon",
+      "language" : "Kotlin",
+      "orm" : "Raw",
+      "platform" : "Servlet",
+      "webserver" : "Resin",
+      "os" : "Linux",
+      "database_os" : "Linux",
+      "display_name" : "Hexagon Resin MongoDB",
+      "notes" : "http://there4.co/hexagon",
+ 
+      "setup_file" : "setup_resin",
+      "versus" : "servlet"
+    }                                   
 
 
-## TODO
-
-* Remove `benchmark_config` optional parameters. Check:
-  //frameworkbenchmarks.readthedocs.io/en/latest/Codebase/Framework-Files/#benchmark-config-file
-
-* Document common commands to test the framework inside Vagrant's development machine
+## Run inside vagrant
 
 
+    rm -rf ~/FrameworkBenchmarks/results
+    ~/FrameworkBenchmarks/toolset/run-tests.py --mode verify --test hexagon
+    ~/FrameworkBenchmarks/toolset/run-tests.py --mode verify --test hexagon-resin

+ 1 - 1
frameworks/Kotlin/hexagon/setup.sh

@@ -4,4 +4,4 @@ fw_depends mongodb java
 
 
 gradle/wrapper
 gradle/wrapper
 
 
-nohup build/hexagon/bin/hexagon &
+nohup build/install/hexagon/bin/hexagon &

+ 2 - 1
frameworks/Kotlin/hexagon/setup_resin.sh

@@ -4,5 +4,6 @@ fw_depends mongodb java resin
 
 
 gradle/wrapper
 gradle/wrapper
 
 
-cp -f build/libs/ROOT.war $RESIN_HOME/webapps
+rm -rf $RESIN_HOME/webapps/*
+cp build/libs/ROOT.war $RESIN_HOME/webapps
 resinctl start
 resinctl start

+ 0 - 1
frameworks/Kotlin/hexagon/source_code

@@ -4,7 +4,6 @@
 ./hexagon/src/main/resources/service.properties
 ./hexagon/src/main/resources/service.properties
 ./hexagon/src/main/resources/logback.xml
 ./hexagon/src/main/resources/logback.xml
 ./hexagon/src/test/kotlin/co/there4/hexagon/BenchmarkTest.kt
 ./hexagon/src/test/kotlin/co/there4/hexagon/BenchmarkTest.kt
-./hexagon/src/test/resources/logback-test.xml
 ./hexagon/src/test/resources/service.yaml
 ./hexagon/src/test/resources/service.yaml
 ./hexagon/build.gradle
 ./hexagon/build.gradle
 ./hexagon/gradle.properties
 ./hexagon/gradle.properties

+ 20 - 33
frameworks/Kotlin/hexagon/src/main/kotlin/co/there4/hexagon/Benchmark.kt

@@ -1,11 +1,9 @@
 package co.there4.hexagon
 package co.there4.hexagon
 
 
-import co.there4.hexagon.rest.crud
 import co.there4.hexagon.serialization.convertToMap
 import co.there4.hexagon.serialization.convertToMap
 import co.there4.hexagon.serialization.serialize
 import co.there4.hexagon.serialization.serialize
 import co.there4.hexagon.web.*
 import co.there4.hexagon.web.*
 import co.there4.hexagon.web.servlet.ServletServer
 import co.there4.hexagon.web.servlet.ServletServer
-import kotlinx.html.*
 
 
 import java.net.InetAddress.getByName as address
 import java.net.InetAddress.getByName as address
 import java.time.LocalDateTime.now
 import java.time.LocalDateTime.now
@@ -24,32 +22,14 @@ private val QUERIES_PARAM = "queries"
 // UTILITIES
 // UTILITIES
 internal fun rnd() = ThreadLocalRandom.current().nextInt(DB_ROWS) + 1
 internal fun rnd() = ThreadLocalRandom.current().nextInt(DB_ROWS) + 1
 
 
-private fun World.strip(): Map<*, *> = this.convertToMap().filterKeys { it != "_id" }
-private fun World.toJson(): String = this.strip().serialize()
-private fun List<World>.toJson(): String = this.map(World::strip).serialize()
+private fun Exchange.returnWorlds(worlds: List<World>) {
+    fun World.strip(): Map<*, *> = this.convertToMap().filterKeys { it != "_id" }
 
 
-private fun Exchange.hasQueryCount() = request[QUERIES_PARAM] == null
+    val result =
+        if (request[QUERIES_PARAM] == null) worlds[0].strip().serialize()
+        else worlds.map(World::strip).serialize()
 
 
-private fun Exchange.getDb() {
-    val worlds = (1..getQueries()).map { findWorld() }.filterNotNull()
-
-    ok(if (hasQueryCount()) worlds[0].toJson() else worlds.toJson(), CONTENT_TYPE_JSON)
-}
-
-private fun listFortunes() =
-    (findFortunes() + Fortune(0, "Additional fortune added at request time."))
-        .sortedBy { it.message }
-
-// HANDLERS
-private fun Exchange.getUpdates() {
-    val worlds = (1..getQueries()).map {
-        val id = rnd()
-        val newWorld = World(id, id)
-        replaceWorld(newWorld)
-        newWorld
-    }
-
-    ok(if (hasQueryCount()) worlds[0].toJson() else worlds.toJson(), CONTENT_TYPE_JSON)
+    ok(result, CONTENT_TYPE_JSON)
 }
 }
 
 
 private fun Exchange.getQueries() =
 private fun Exchange.getQueries() =
@@ -65,7 +45,13 @@ private fun Exchange.getQueries() =
         1
         1
     }
     }
 
 
-fun benchmarkRoutes(srv: Router = server) {
+// HANDLERS
+private fun Exchange.listFortunes(store: Repository) {
+    val fortunes = store.findFortunes() + Fortune(0, "Additional fortune added at request time.")
+    template("fortunes.html", "fortunes" to fortunes.sortedBy { it.message })
+}
+
+private fun benchmarkRoutes(store: Repository, srv: Router = server) {
     srv.before {
     srv.before {
         response.addHeader("Server", "Servlet/3.1")
         response.addHeader("Server", "Servlet/3.1")
         response.addHeader("Transfer-Encoding", "chunked")
         response.addHeader("Transfer-Encoding", "chunked")
@@ -74,19 +60,20 @@ fun benchmarkRoutes(srv: Router = server) {
 
 
     srv.get("/plaintext") { ok("Hello, World!", "text/plain") }
     srv.get("/plaintext") { ok("Hello, World!", "text/plain") }
     srv.get("/json") { ok(Message().serialize(), CONTENT_TYPE_JSON) }
     srv.get("/json") { ok(Message().serialize(), CONTENT_TYPE_JSON) }
-    srv.get("/fortunes") { template("fortunes.html", "fortunes" to listFortunes()) }
-    srv.get("/db") { getDb() }
-    srv.get("/query") { getDb() }
-    srv.get("/update") { getUpdates() }
+    srv.get("/fortunes") { listFortunes(store) }
+    srv.get("/db") { returnWorlds(store.findWorlds(getQueries())) }
+    srv.get("/query") { returnWorlds(store.findWorlds(getQueries())) }
+    srv.get("/update") { returnWorlds(store.replaceWorlds(getQueries())) }
 }
 }
 
 
 @WebListener class Web : ServletServer () {
 @WebListener class Web : ServletServer () {
     override fun init() {
     override fun init() {
-        benchmarkRoutes(this)
+        benchmarkRoutes(createStore("mongodb"), this)
     }
     }
 }
 }
 
 
 fun main(args: Array<String>) {
 fun main(args: Array<String>) {
-    benchmarkRoutes()
+    val store = createStore(if (args.isEmpty()) "mongodb" else args[0])
+    benchmarkRoutes(store)
     run()
     run()
 }
 }

+ 27 - 35
frameworks/Kotlin/hexagon/src/main/kotlin/co/there4/hexagon/BenchmarkStorage.kt

@@ -6,23 +6,10 @@ import java.lang.System.getenv
 
 
 import co.there4.hexagon.settings.SettingsManager.setting
 import co.there4.hexagon.settings.SettingsManager.setting
 import co.there4.hexagon.repository.mongoDatabase
 import co.there4.hexagon.repository.mongoDatabase
+import co.there4.hexagon.util.err
+import java.io.Closeable
 import kotlin.reflect.KProperty1
 import kotlin.reflect.KProperty1
 
 
-internal val FORTUNE_MESSAGES = setOf(
-    "fortune: No such file or directory",
-    "A computer scientist is someone who fixes things that aren't broken.",
-    "After enough decimal places, nobody gives a damn.",
-    "A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1",
-    "A computer program does what you tell it to do, not what you want it to do.",
-    "Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen",
-    "Any program that runs right is obsolete.",
-    "A list is only as strong as its weakest link. — Donald Knuth",
-    "Feature: A bug with seniority.",
-    "Computers make very fast, very accurate mistakes.",
-    "<script>alert(\"This should not be displayed in a browser alert box.\");</script>",
-    "フレームワークのベンチマーク"
-)
-
 internal val DB_ROWS = 10000
 internal val DB_ROWS = 10000
 
 
 private val DB_HOST = getenv("DBHOST") ?: "localhost"
 private val DB_HOST = getenv("DBHOST") ?: "localhost"
@@ -30,31 +17,36 @@ private val DB = setting<String>("database") ?: "hello_world"
 private val WORLD: String = setting<String>("worldCollection") ?: "world"
 private val WORLD: String = setting<String>("worldCollection") ?: "world"
 private val FORTUNE: String = setting<String>("fortuneCollection") ?: "fortune"
 private val FORTUNE: String = setting<String>("fortuneCollection") ?: "fortune"
 
 
-private val database = mongoDatabase("mongodb://$DB_HOST/$DB")
+internal fun createStore(engine: String): Repository = when (engine) {
+    "mongodb" -> MongoDbRepository()
+    else -> error("Unsupported database")
+}
 
 
-internal val worldRepository = repository(WORLD, World::_id)
-internal val fortuneRepository = repository(FORTUNE, Fortune::_id)
+internal interface Repository {
+    fun findFortunes(): List<Fortune>
+    fun findWorlds(queries: Int): List<World>
+    fun replaceWorlds(queries: Int): List<World>
+}
 
 
-// TODO Find out why it fails when creating index '_id' with background: true
-private inline fun <reified T : Any> repository(name: String, key: KProperty1<T, Int>) =
-    MongoIdRepository(T::class, mongoCollection(name, database), key, indexOrder = null)
+internal class MongoDbRepository : Repository {
+    private val database = mongoDatabase("mongodb://$DB_HOST/$DB")
 
 
-internal fun initialize() {
-    if (fortuneRepository.isEmpty()) {
-        val fortunes = FORTUNE_MESSAGES.mapIndexed { ii, fortune -> Fortune(ii + 1, fortune) }
-        fortuneRepository.insertManyObjects(fortunes)
-    }
+    internal val worldRepository = repository(WORLD, World::_id)
+    internal val fortuneRepository = repository(FORTUNE, Fortune::_id)
 
 
-    if (worldRepository.isEmpty()) {
-        val world = (1..DB_ROWS).map { World(it, it) }
-        worldRepository.insertManyObjects(world)
-    }
-}
+    // TODO Find out why it fails when creating index '_id' with background: true
+    private inline fun <reified T : Any> repository(name: String, key: KProperty1<T, Int>) =
+        MongoIdRepository(T::class, mongoCollection(name, database), key, indexOrder = null)
 
 
-internal fun findFortunes() = fortuneRepository.findObjects().toList()
+    override fun findFortunes() = fortuneRepository.findObjects().toList()
 
 
-internal fun findWorld() = worldRepository.find(rnd())
+    override fun findWorlds(queries: Int) =
+        (1..queries).map { worldRepository.find(rnd()) }.filterNotNull()
 
 
-internal fun replaceWorld(newWorld: World) {
-    worldRepository.replaceObject(newWorld)
+    override fun replaceWorlds(queries: Int) = (1..queries).map {
+        val id = rnd()
+        val newWorld = World(id, id)
+        worldRepository.replaceObject(newWorld)
+        newWorld
+    }
 }
 }

+ 1 - 5
frameworks/Kotlin/hexagon/src/main/resources/logback.xml

@@ -1,5 +1,5 @@
 <!--
 <!--
- | Logback configuration for tests
+ | Logback configuration
  !-->
  !-->
 <configuration>
 <configuration>
   <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
   <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
@@ -14,8 +14,4 @@
     <level value="off" />
     <level value="off" />
     <appender-ref ref="console" />
     <appender-ref ref="console" />
   </root>
   </root>
-
-  <logger name="co.there4.hexagon">
-    <level value="off" />
-  </logger>
 </configuration>
 </configuration>

+ 2 - 0
frameworks/Kotlin/hexagon/src/main/resources/service.yaml

@@ -2,6 +2,8 @@
 bindPort : 9090
 bindPort : 9090
 bindAddress : 0.0.0.0
 bindAddress : 0.0.0.0
 
 
+ignoreResources : true
+
 database : hello_world
 database : hello_world
 worldCollection : world
 worldCollection : world
 fortuneCollection : fortune
 fortuneCollection : fortune

+ 42 - 14
frameworks/Kotlin/hexagon/src/test/kotlin/co/there4/hexagon/BenchmarkTest.kt

@@ -2,22 +2,28 @@ package co.there4.hexagon
 
 
 import co.there4.hexagon.serialization.parse
 import co.there4.hexagon.serialization.parse
 import co.there4.hexagon.web.Client
 import co.there4.hexagon.web.Client
+import co.there4.hexagon.web.HttpMethod.GET
+import co.there4.hexagon.web.reset
 import co.there4.hexagon.web.server
 import co.there4.hexagon.web.server
+import co.there4.hexagon.web.stop
 import org.asynchttpclient.Response
 import org.asynchttpclient.Response
 import org.testng.annotations.BeforeClass
 import org.testng.annotations.BeforeClass
 import org.testng.annotations.Test
 import org.testng.annotations.Test
+import kotlin.test.assertFailsWith
 
 
 internal const val THREADS = 4
 internal const val THREADS = 4
 internal const val TIMES = 4
 internal const val TIMES = 4
 
 
+//class BenchmarkMongoDbTest : BenchmarkTest("mongodb")
+
 @Test(threadPoolSize = THREADS, invocationCount = TIMES)
 @Test(threadPoolSize = THREADS, invocationCount = TIMES)
-class BenchmarkTest {
+abstract class BenchmarkTest(val databaseEngine: String) {
     private val client by lazy { Client("http://localhost:${server.runtimePort}") }
     private val client by lazy { Client("http://localhost:${server.runtimePort}") }
 
 
     @BeforeClass fun warmup() {
     @BeforeClass fun warmup() {
-        initialize()
-
-        main(arrayOf())
+        stop()
+        reset()
+        main(arrayOf(databaseEngine))
 
 
         val warmupRounds = if (THREADS > 1) 2 else 0
         val warmupRounds = if (THREADS > 1) 2 else 0
         (1..warmupRounds).forEach {
         (1..warmupRounds).forEach {
@@ -45,6 +51,29 @@ class BenchmarkTest {
         }
         }
     }
     }
 
 
+    fun store() {
+        assertFailsWith<IllegalStateException> {
+            createStore("invalid")
+        }
+    }
+
+    fun web() {
+        val web = Web()
+        web.init()
+
+        val webRoutes = web.routes.map { it.key.method to it.key.path.path }
+        val benchmarkRoutes = listOf(
+            GET to "/plaintext",
+            GET to "/json",
+            GET to "/fortunes",
+            GET to "/db",
+            GET to "/query",
+            GET to "/update"
+        )
+
+        assert(webRoutes.containsAll(benchmarkRoutes))
+    }
+
     fun json() {
     fun json() {
         val response = client.get("/json")
         val response = client.get("/json")
         val content = response.responseBody
         val content = response.responseBody
@@ -61,7 +90,15 @@ class BenchmarkTest {
         assert("Hello, World!" == content)
         assert("Hello, World!" == content)
     }
     }
 
 
-    fun fortunes() = fortunesCheck("/fortunes")
+    fun fortunes() {
+        val response = client.get("/fortunes")
+        val content = response.responseBody
+
+        checkResponse(response, "text/html;charset=utf-8")
+        assert(content.contains("<td>&lt;script&gt;alert(&quot;This should not be "))
+        assert(content.contains(" displayed in a browser alert box.&quot;);&lt;/script&gt;</td>"))
+        assert(content.contains("<td>フレームワークのベンチマーク</td>"))
+    }
 
 
     fun no_query_parameter() {
     fun no_query_parameter() {
         val response = client.get("/db")
         val response = client.get("/db")
@@ -118,15 +155,6 @@ class BenchmarkTest {
         }
         }
     }
     }
 
 
-    private fun fortunesCheck(url: String) {
-        val response = client.get(url)
-        val content = response.responseBody
-
-        checkResponse(response, "text/html;charset=utf-8")
-        assert(content.contains("<td>&lt;script&gt;alert(&quot;This should not be displayed in a browser alert box.&quot;);&lt;/script&gt;</td>"))
-        assert(content.contains("<td>フレームワークのベンチマーク</td>"))
-    }
-
     private fun checkResponse(res: Response, contentType: String) {
     private fun checkResponse(res: Response, contentType: String) {
         assert(res.headers ["Date"] != null)
         assert(res.headers ["Date"] != null)
         assert(res.headers ["Server"] != null)
         assert(res.headers ["Server"] != null)

+ 0 - 21
frameworks/Kotlin/hexagon/src/test/resources/logback-test.xml

@@ -1,21 +0,0 @@
-<!--
- | Logback configuration for tests
- !-->
-<configuration>
-  <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-      <Pattern>
-%d{HH:mm:ss.SSS} %highlight(%-5p) %magenta([%-15.15thread]) %-30logger{30} %cyan(%X{jvmId}) | %m%n
-      </Pattern>
-    </encoder>
-  </appender>
-
-  <root>
-    <level value="off" />
-    <appender-ref ref="console" />
-  </root>
-
-  <logger name="co.there4.hexagon">
-    <level value="off" />
-  </logger>
-</configuration>

+ 2 - 5
frameworks/Lua/octopus/setup.sh

@@ -5,13 +5,10 @@ fw_depends mysql
 rm -rf octopus
 rm -rf octopus
 git clone https://github.com/cyberz-eu/octopus.git
 git clone https://github.com/cyberz-eu/octopus.git
 cd octopus
 cd octopus
-# November 1st, 2016
-git checkout d123ba46d352fafebd74cb8ebeddc4810ba2c68b
+# January 4th, 2017
+git checkout 0c4fc42198fed3a299c78d4b910188113d478bc5
 cd ..
 cd ..
 
 
-# Patch for fixing zlib version
-sed -i 's|zlib_version=1\.2\.8|zlib_version=1.2.10|g' octopus/bin/unix/server.sh
-
 cp -avr app octopus/extensions
 cp -avr app octopus/extensions
 cp -vf config.lua octopus/extensions
 cp -vf config.lua octopus/extensions
 sed -i 's|DBHOSTNAME|'"${DBHOST}"'|g' octopus/extensions/config.lua
 sed -i 's|DBHOSTNAME|'"${DBHOST}"'|g' octopus/extensions/config.lua

+ 13 - 0
frameworks/Rust/tokio-minihttp/Cargo.toml

@@ -0,0 +1,13 @@
+[package]
+name = "tokio-minihttp"
+version = "0.1.0"
+authors = ["Gökberk Yaltıraklı <[email protected]>"]
+
+[dependencies]
+futures = "0.1"
+httparse = "1.1"
+serde_json = "0.8"
+num_cpus = "1.0"
+tokio-proto = { git = "https://github.com/tokio-rs/tokio-proto", revision = "e42b3bfb" }
+tokio-service = { git = "https://github.com/tokio-rs/tokio-service", revision = "0c904c40" }
+tokio-minihttp = { git = "https://github.com/tokio-rs/tokio-minihttp", revision = "6ac81b31" }

+ 22 - 0
frameworks/Rust/tokio-minihttp/benchmark_config.json

@@ -0,0 +1,22 @@
+{
+  "framework": "tokio-minihttp",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Micro",
+      "database": "None",
+      "framework": "tokio-minihttp",
+      "language": "rust",
+      "orm": "raw",
+      "platform": "Rust",
+      "webserver": "tokio-minihttp",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "tokio-minihttp"
+    }
+  }]
+}

+ 7 - 0
frameworks/Rust/tokio-minihttp/setup.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+fw_depends rust
+
+cargo clean
+cargo build --release
+./target/release/tokio-minihttp &

+ 53 - 0
frameworks/Rust/tokio-minihttp/src/main.rs

@@ -0,0 +1,53 @@
+extern crate tokio_service;
+extern crate tokio_proto;
+extern crate tokio_minihttp;
+extern crate futures;
+extern crate num_cpus;
+extern crate serde_json;
+
+use futures::future;
+use tokio_service::Service;
+use tokio_proto::TcpServer;
+use tokio_minihttp::{Request, Response, Http};
+use serde_json::builder::ObjectBuilder;
+
+struct Techempower;
+
+impl Service for Techempower {
+    type Request = Request;
+    type Response = Response;
+    type Error = std::io::Error;
+    type Future = future::Ok<Response, std::io::Error>;
+
+    fn call(&mut self, req: Request) -> Self::Future {
+        let mut resp = Response::new();
+
+        // Bare-bones router
+        match req.path() {
+            "/json" => {
+                let json = serde_json::to_string(
+                    &ObjectBuilder::new().insert("message", "Hello, World!")
+                .build()).unwrap();
+
+                resp.header("Content-Type", "application/json")
+                    .body(&json);
+            },
+            "/plaintext" => {
+                resp.header("Content-Type", "text/plain")
+                    .body("Hello, World!");
+            },
+            _ => {
+                resp.status_code(404, "Not Found");
+            }
+        }
+
+        future::ok(resp)
+    }
+}
+
+fn main() {
+    let addr = "0.0.0.0:8080".parse().unwrap();
+    let mut srv = TcpServer::new(Http, addr);
+    srv.threads(num_cpus::get());
+    srv.serve(|| Ok(Techempower))
+}

+ 7 - 7
frameworks/Scala/fintrospect/build.sbt

@@ -1,6 +1,6 @@
 name := """techempower-benchmarks-fintrospect"""
 name := """techempower-benchmarks-fintrospect"""
 
 
-version := "0.0.8"
+version := "0.1.0"
 
 
 scalaVersion := "2.11.8"
 scalaVersion := "2.11.8"
 
 
@@ -10,15 +10,15 @@ scalacOptions += "-feature"
 
 
 resolvers += "JCenter" at "https://jcenter.bintray.com"
 resolvers += "JCenter" at "https://jcenter.bintray.com"
 
 
+resolvers += Resolver.sonatypeRepo("snapshots")
+
 com.github.retronym.SbtOneJar.oneJarSettings
 com.github.retronym.SbtOneJar.oneJarSettings
 
 
 mainClass in(Compile, run) := Some("FintrospectBenchmarkServer")
 mainClass in(Compile, run) := Some("FintrospectBenchmarkServer")
 
 
 libraryDependencies ++= Seq(
 libraryDependencies ++= Seq(
-  "io.fintrospect" %% "fintrospect-core" % "13.17.0",
-  "io.fintrospect" %% "fintrospect-jackson" % "13.17.0",
-  "io.fintrospect" %% "fintrospect-mustache" % "13.17.0",
-  "com.twitter" %% "finagle-mysql" % "6.40.0"
+  "io.fintrospect" %% "fintrospect-core" % "14.0.0",
+  "io.fintrospect" %% "fintrospect-jackson" % "14.0.0",
+  "io.fintrospect" %% "fintrospect-mustache" % "14.0.0",
+  "com.twitter" %% "finagle-mysql" % "6.41.0"
 )
 )
-
-resolvers += Resolver.sonatypeRepo("snapshots")

+ 2 - 3
frameworks/Scala/fintrospect/src/main/scala/DatabaseRoutes.scala

@@ -1,13 +1,12 @@
 import com.fasterxml.jackson.databind.JsonNode
 import com.fasterxml.jackson.databind.JsonNode
 import com.twitter.finagle.Service
 import com.twitter.finagle.Service
 import com.twitter.finagle.http.Method.Get
 import com.twitter.finagle.http.Method.Get
-import com.twitter.finagle.http.Status.{NotFound, Ok}
 import com.twitter.finagle.http.{Request, Response}
 import com.twitter.finagle.http.{Request, Response}
 import com.twitter.finagle.mysql.Parameter.wrap
 import com.twitter.finagle.mysql.Parameter.wrap
 import com.twitter.finagle.mysql.{Client, IntValue, Result, ResultSet}
 import com.twitter.finagle.mysql.{Client, IntValue, Result, ResultSet}
 import com.twitter.util.Future.collect
 import com.twitter.util.Future.collect
 import io.fintrospect.formats.Jackson.JsonFormat.{array, number, obj}
 import io.fintrospect.formats.Jackson.JsonFormat.{array, number, obj}
-import io.fintrospect.formats.Jackson.ResponseBuilder.implicits._
+import io.fintrospect.formats.Jackson.ResponseBuilder._
 import io.fintrospect.parameters.{ParameterSpec, Query}
 import io.fintrospect.parameters.{ParameterSpec, Query}
 import io.fintrospect.{RouteSpec, ServerRoutes}
 import io.fintrospect.{RouteSpec, ServerRoutes}
 
 
@@ -35,7 +34,7 @@ object DatabaseRoutes {
     val queryRoute = RouteSpec().at(Get) / "db" bindTo Service.mk {
     val queryRoute = RouteSpec().at(Get) / "db" bindTo Service.mk {
       _: Request => getStatement(generateRandomNumber)
       _: Request => getStatement(generateRandomNumber)
         .map(toJson)
         .map(toJson)
-        .map(_.map(Ok(_)).getOrElse(NotFound()).build())
+        .map(_.map(Ok(_)).getOrElse(NotFound("")).build())
     }
     }
 
 
     val numberOfQueries = Query.optional(ParameterSpec.string("queries").map {
     val numberOfQueries = Query.optional(ParameterSpec.string("queries").map {

+ 1 - 2
frameworks/Scala/fintrospect/src/main/scala/JsonRoute.scala

@@ -1,10 +1,9 @@
 import com.twitter.finagle.Service
 import com.twitter.finagle.Service
 import com.twitter.finagle.http.Method.Get
 import com.twitter.finagle.http.Method.Get
 import com.twitter.finagle.http.Request
 import com.twitter.finagle.http.Request
-import com.twitter.finagle.http.Status.Ok
 import io.fintrospect.RouteSpec
 import io.fintrospect.RouteSpec
 import io.fintrospect.formats.Jackson.JsonFormat.{encodeToBuf, obj, string}
 import io.fintrospect.formats.Jackson.JsonFormat.{encodeToBuf, obj, string}
-import io.fintrospect.formats.Jackson.ResponseBuilder.implicits._
+import io.fintrospect.formats.Jackson.ResponseBuilder._
 
 
 object JsonRoute {
 object JsonRoute {
 
 

+ 1 - 2
frameworks/Scala/fintrospect/src/main/scala/PlainTextRoute.scala

@@ -1,10 +1,9 @@
 import com.twitter.finagle.Service
 import com.twitter.finagle.Service
 import com.twitter.finagle.http.Method.Get
 import com.twitter.finagle.http.Method.Get
 import com.twitter.finagle.http.Request
 import com.twitter.finagle.http.Request
-import com.twitter.finagle.http.Status.Ok
 import com.twitter.io.Buf
 import com.twitter.io.Buf
 import io.fintrospect.RouteSpec
 import io.fintrospect.RouteSpec
-import io.fintrospect.formats.PlainText.ResponseBuilder.implicits._
+import io.fintrospect.formats.PlainText.ResponseBuilder._
 
 
 object PlainTextRoute {
 object PlainTextRoute {
 
 

+ 7 - 15
toolset/benchmark/framework_test.py

@@ -171,21 +171,13 @@ class FrameworkTest:
     # Setup environment variables
     # Setup environment variables
     logDir = os.path.join(self.fwroot, self.benchmarker.full_results_directory(), 'logs', self.name.lower())
     logDir = os.path.join(self.fwroot, self.benchmarker.full_results_directory(), 'logs', self.name.lower())
     bash_functions_path= os.path.join(self.fwroot, 'toolset/setup/linux/bash_functions.sh')
     bash_functions_path= os.path.join(self.fwroot, 'toolset/setup/linux/bash_functions.sh')
-    setup_util.replace_environ(config='$FWROOT/toolset/setup/linux/config/benchmark_profile',
-              command='''\
-              export TROOT=%s       &&  \
-              export IROOT=%s       &&  \
-              export DBHOST=%s      &&  \
-              export LOGDIR=%s      &&  \
-              export MAX_THREADS=%s &&  \
-              export MAX_CONCURRENCY=%s \
-              ''' % (
-                self.directory,
-                self.install_root,
-                self.database_host,
-                logDir,
-                self.benchmarker.threads,
-                max(self.benchmarker.concurrency_levels)))
+
+    os.environ['TROOT'] = self.directory
+    os.environ['IROOT'] = self.install_root
+    os.environ['DBHOST'] = self.database_host
+    os.environ['LOGDIR'] = logDir
+    os.environ['MAX_THREADS'] = str(self.benchmarker.threads)
+    os.environ['MAX_CONCURRENCY'] = str(max(self.benchmarker.concurrency_levels))
 
 
     # Always ensure that IROOT exists
     # Always ensure that IROOT exists
     if not os.path.exists(self.install_root):
     if not os.path.exists(self.install_root):

+ 7 - 5
toolset/run-tests.py

@@ -3,6 +3,7 @@ import argparse
 import ConfigParser
 import ConfigParser
 import sys
 import sys
 import os
 import os
+import platform
 import multiprocessing
 import multiprocessing
 import itertools
 import itertools
 import copy
 import copy
@@ -63,11 +64,12 @@ def main(argv=None):
     sys.path.append('toolset/setup/linux')
     sys.path.append('toolset/setup/linux')
 
 
     # Update environment for shell scripts
     # Update environment for shell scripts
-    fwroot = setup_util.get_fwroot()
-    if not fwroot: 
-        fwroot = os.getcwd()
-    setup_util.replace_environ(config='toolset/setup/linux/config/benchmark_profile', root=fwroot)
-    print "FWROOT is %s"%setup_util.get_fwroot()
+    os.environ['FWROOT'] = setup_util.get_fwroot()
+    os.environ['IROOT'] = os.environ['FWROOT'] + '/installs'
+    # 'Ubuntu', '14.04', 'trusty' respectively
+    os.environ['TFB_DISTRIB_ID'], os.environ['TFB_DISTRIB_RELEASE'], os.environ['TFB_DISTRIB_CODENAME'] = platform.linux_distribution()
+
+    print "FWROOT is %s"%os.environ['FWROOT']
 
 
     conf_parser = argparse.ArgumentParser(
     conf_parser = argparse.ArgumentParser(
         description=__doc__,
         description=__doc__,

+ 0 - 50
toolset/setup/linux/config/benchmark_profile

@@ -1,50 +0,0 @@
-# This is auto-loaded from toolset/run-tests.py
-
-# Always reference ROOT for other vars
-if [ -z "${FWROOT}" ]; then
-  # Default value
-  FWROOT=~/FrameworkBenchmarks
-else
-  # Re-declare so it can be used in this script
-  FWROOT=$(echo $FWROOT)
-fi
-IROOT=${FWROOT}/installs
-
-# Determine which OS we are using and set the appropriate variables
-source /etc/lsb-release
-export TFB_DISTRIB_ID=$DISTRIB_ID
-export TFB_DISTRIB_RELEASE=$DISTRIB_RELEASE
-export TFB_DISTRIB_CODENAME=$DISTRIB_CODENAME
-export TFB_DISTRIB_DESCRIPTION=$DISTRIB_DESCRIPTION
-
-#
-#export RESIN_HOME=${IROOT}/resin-4.0.41
-#export GRAILS_HOME=${IROOT}/grails-2.4.4
-#export VERTX_HOME=${IROOT}/vert.x-2.1.1
-#export TOMCAT_HOME=${IROOT}/apache-tomcat-7.0.35
-#export NODE_HOME=${IROOT}/node-v0.10.8-linux-x64
-#export PLAY_HOME=${IROOT}/play-2.2.0
-#export PLAY1_HOME=${IROOT}/play-1.2.5
-#export MAVEN_HOME=${IROOT}/apache-maven-3.0.5
-#export SBT_HOME=${IROOT}/sbt
-#export PERL_HOME=${IROOT}/perl-5.18
-#export DART_HOME=${IROOT}/dart-sdk
-#export RACKET_HOME=${IROOT}/racket-5.3.6
-#export NIMROD_HOME=${IROOT}/nimrod
-#export NGINX_HOME=/usr/local/nginx
-#export ELIXIR_HOME=${IROOT}/elixir-0.13.3
-#
-#export 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:$SBT_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='127.0.0.1'
-#export TFB_CLIENT_HOST='127.0.0.1'
-#export TFB_CLIENT_USER='tfb'
-#export TFB_CLIENT_IDENTITY_FILE='/home/tfb/.ssh/id_rsa'
-#export TFB_DATABASE_HOST='127.0.0.1'
-#
-#[ -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"

+ 0 - 1
toolset/setup/linux/databases/redis/README.md

@@ -1 +0,0 @@
-# redis is not currently implemented

+ 0 - 27
toolset/setup/linux/databases/redis/create-redis.sh

@@ -1,27 +0,0 @@
-#!/bin/bash
-
-RANGE=10000
-for i in {1..10000}
-do
-    value=$RANDOM
-    let "value = (value % $RANGE) + 1"
-    echo "SET world:$i $value" | redis-cli > /dev/null
-done
-
-echo "DEL fortunes" | redis-cli
-
-# Please don't compress these into one statement, TFB is not always
-# run using Redis 2.4+ and we don't need optimization when 
-# adding ~10 entries
-echo "RPUSH fortunes \"fortune: No such file or directory\"" | redis-cli
-echo "RPUSH fortunes \"A computer scientist is someone who fixes things that aren't broken.\"" | redis-cli
-echo "RPUSH fortunes \"After enough decimal places, nobody gives a damn.\"" | redis-cli
-echo "RPUSH fortunes \"A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1\"" | redis-cli
-echo "RPUSH fortunes \"A computer program does what you tell it to do, not what you want it to do.\"" | redis-cli
-echo "RPUSH fortunes \"Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen\"" | redis-cli
-echo "RPUSH fortunes \"Any program that runs right is obsolete.\"" | redis-cli
-echo "RPUSH fortunes \"A list is only as strong as its weakest link. — Donald Knuth\"" | redis-cli
-echo "RPUSH fortunes \"Feature: A bug with seniority.\"" | redis-cli
-echo "RPUSH fortunes \"Computers make very fast, very accurate mistakes.\"" | redis-cli
-echo "RPUSH fortunes \"<script>alert(\\\"This should not be displayed in a browser alert box.\\\");</script>\"" | redis-cli
-echo "RPUSH fortunes \"フレームワークのベンチマーク\"" | redis-cli

+ 0 - 709
toolset/setup/linux/databases/redis/redis.conf

@@ -1,709 +0,0 @@
-# Redis configuration file example
-
-# Note on units: when memory size is needed, it is possible to specify
-# it in the usual form of 1k 5GB 4M and so forth:
-#
-# 1k => 1000 bytes
-# 1kb => 1024 bytes
-# 1m => 1000000 bytes
-# 1mb => 1024*1024 bytes
-# 1g => 1000000000 bytes
-# 1gb => 1024*1024*1024 bytes
-#
-# units are case insensitive so 1GB 1Gb 1gB are all the same.
-
-################################## INCLUDES ###################################
-
-# Include one or more other config files here.  This is useful if you
-# have a standard template that goes to all Redis server but also need
-# to customize a few per-server settings.  Include files can include
-# other files, so use this wisely.
-#
-# Notice option "include" won't be rewritten by command "CONFIG REWRITE"
-# from admin or Redis Sentinel. Since Redis always uses the last processed
-# line as value of a configuration directive, you'd better put includes
-# at the beginning of this file to avoid overwriting config change at runtime.
-#
-# If instead you are interested in using includes to override configuration
-# options, it is better to use include as the last line.
-#
-# include /path/to/local.conf
-# include /path/to/other.conf
-
-################################ GENERAL  #####################################
-
-# By default Redis does not run as a daemon. Use 'yes' if you need it.
-# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
-daemonize yes
-
-# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
-# default. You can specify a custom pid file location here.
-pidfile /var/run/redis/redis-server.pid
-
-# Accept connections on the specified port, default is 6379.
-# If port 0 is specified Redis will not listen on a TCP socket.
-port 6379
-
-# By default Redis listens for connections from all the network interfaces
-# available on the server. It is possible to listen to just one or multiple
-# interfaces using the "bind" configuration directive, followed by one or
-# more IP addresses.
-#
-# Examples:
-#
-# bind 192.168.1.100 10.0.0.1
-#bind 127.0.0.1
-bind 0.0.0.0
-
-# Specify the path for the unix socket that will be used to listen for
-# incoming connections. There is no default, so Redis will not listen
-# on a unix socket when not specified.
-#
-# unixsocket /var/run/redis/redis.sock
-# unixsocketperm 755
-
-# Close the connection after a client is idle for N seconds (0 to disable)
-timeout 0
-
-# TCP keepalive.
-#
-# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
-# of communication. This is useful for two reasons:
-#
-# 1) Detect dead peers.
-# 2) Take the connection alive from the point of view of network
-#    equipment in the middle.
-#
-# On Linux, the specified value (in seconds) is the period used to send ACKs.
-# Note that to close the connection the double of the time is needed.
-# On other kernels the period depends on the kernel configuration.
-#
-# A reasonable value for this option is 60 seconds.
-tcp-keepalive 0
-
-# Specify the server verbosity level.
-# This can be one of:
-# debug (a lot of information, useful for development/testing)
-# verbose (many rarely useful info, but not a mess like the debug level)
-# notice (moderately verbose, what you want in production probably)
-# warning (only very important / critical messages are logged)
-loglevel notice
-
-# Specify the log file name. Also the empty string can be used to force
-# Redis to log on the standard output. Note that if you use standard
-# output for logging but daemonize, logs will be sent to /dev/null
-logfile /var/log/redis/redis-server.log
-
-# To enable logging to the system logger, just set 'syslog-enabled' to yes,
-# and optionally update the other syslog parameters to suit your needs.
-# syslog-enabled no
-
-# Specify the syslog identity.
-# syslog-ident redis
-
-# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
-# syslog-facility local0
-
-# Set the number of databases. The default database is DB 0, you can select
-# a different one on a per-connection basis using SELECT <dbid> where
-# dbid is a number between 0 and 'databases'-1
-databases 16
-
-################################ SNAPSHOTTING  ################################
-#
-# Save the DB on disk:
-#
-#   save <seconds> <changes>
-#
-#   Will save the DB if both the given number of seconds and the given
-#   number of write operations against the DB occurred.
-#
-#   In the example below the behaviour will be to save:
-#   after 900 sec (15 min) if at least 1 key changed
-#   after 300 sec (5 min) if at least 10 keys changed
-#   after 60 sec if at least 10000 keys changed
-#
-#   Note: you can disable saving at all commenting all the "save" lines.
-#
-#   It is also possible to remove all the previously configured save
-#   points by adding a save directive with a single empty string argument
-#   like in the following example:
-#
-#   save ""
-
-save 900 1
-save 300 10
-save 60 10000
-
-# By default Redis will stop accepting writes if RDB snapshots are enabled
-# (at least one save point) and the latest background save failed.
-# This will make the user aware (in a hard way) that data is not persisting
-# on disk properly, otherwise chances are that no one will notice and some
-# disaster will happen.
-#
-# If the background saving process will start working again Redis will
-# automatically allow writes again.
-#
-# However if you have setup your proper monitoring of the Redis server
-# and persistence, you may want to disable this feature so that Redis will
-# continue to work as usual even if there are problems with disk,
-# permissions, and so forth.
-stop-writes-on-bgsave-error yes
-
-# Compress string objects using LZF when dump .rdb databases?
-# For default that's set to 'yes' as it's almost always a win.
-# If you want to save some CPU in the saving child set it to 'no' but
-# the dataset will likely be bigger if you have compressible values or keys.
-rdbcompression yes
-
-# Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
-# This makes the format more resistant to corruption but there is a performance
-# hit to pay (around 10%) when saving and loading RDB files, so you can disable it
-# for maximum performances.
-#
-# RDB files created with checksum disabled have a checksum of zero that will
-# tell the loading code to skip the check.
-rdbchecksum yes
-
-# The filename where to dump the DB
-dbfilename dump.rdb
-
-# The working directory.
-#
-# The DB will be written inside this directory, with the filename specified
-# above using the 'dbfilename' configuration directive.
-# 
-# The Append Only File will also be created inside this directory.
-# 
-# Note that you must specify a directory here, not a file name.
-dir /var/lib/redis
-
-################################# REPLICATION #################################
-
-# Master-Slave replication. Use slaveof to make a Redis instance a copy of
-# another Redis server. Note that the configuration is local to the slave
-# so for example it is possible to configure the slave to save the DB with a
-# different interval, or to listen to another port, and so on.
-#
-# slaveof <masterip> <masterport>
-
-# If the master is password protected (using the "requirepass" configuration
-# directive below) it is possible to tell the slave to authenticate before
-# starting the replication synchronization process, otherwise the master will
-# refuse the slave request.
-#
-# masterauth <master-password>
-
-# When a slave loses its connection with the master, or when the replication
-# is still in progress, the slave can act in two different ways:
-#
-# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
-#    still reply to client requests, possibly with out of date data, or the
-#    data set may just be empty if this is the first synchronization.
-#
-# 2) if slave-serve-stale-data is set to 'no' the slave will reply with
-#    an error "SYNC with master in progress" to all the kind of commands
-#    but to INFO and SLAVEOF.
-#
-slave-serve-stale-data yes
-
-# You can configure a slave instance to accept writes or not. Writing against
-# a slave instance may be useful to store some ephemeral data (because data
-# written on a slave will be easily deleted after resync with the master) but
-# may also cause problems if clients are writing to it because of a
-# misconfiguration.
-#
-# Since Redis 2.6 by default slaves are read-only.
-#
-# Note: read only slaves are not designed to be exposed to untrusted clients
-# on the internet. It's just a protection layer against misuse of the instance.
-# Still a read only slave exports by default all the administrative commands
-# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
-# security of read only slaves using 'rename-command' to shadow all the
-# administrative / dangerous commands.
-slave-read-only yes
-
-# Slaves send PINGs to server in a predefined interval. It's possible to change
-# this interval with the repl_ping_slave_period option. The default value is 10
-# seconds.
-#
-# repl-ping-slave-period 10
-
-# The following option sets the replication timeout for:
-#
-# 1) Bulk transfer I/O during SYNC, from the point of view of slave.
-# 2) Master timeout from the point of view of slaves (data, pings).
-# 3) Slave timeout from the point of view of masters (REPLCONF ACK pings).
-#
-# It is important to make sure that this value is greater than the value
-# specified for repl-ping-slave-period otherwise a timeout will be detected
-# every time there is low traffic between the master and the slave.
-#
-# repl-timeout 60
-
-# Disable TCP_NODELAY on the slave socket after SYNC?
-#
-# If you select "yes" Redis will use a smaller number of TCP packets and
-# less bandwidth to send data to slaves. But this can add a delay for
-# the data to appear on the slave side, up to 40 milliseconds with
-# Linux kernels using a default configuration.
-#
-# If you select "no" the delay for data to appear on the slave side will
-# be reduced but more bandwidth will be used for replication.
-#
-# By default we optimize for low latency, but in very high traffic conditions
-# or when the master and slaves are many hops away, turning this to "yes" may
-# be a good idea.
-repl-disable-tcp-nodelay no
-
-# Set the replication backlog size. The backlog is a buffer that accumulates
-# slave data when slaves are disconnected for some time, so that when a slave
-# wants to reconnect again, often a full resync is not needed, but a partial
-# resync is enough, just passing the portion of data the slave missed while
-# disconnected.
-#
-# The biggest the replication backlog, the longer the time the slave can be
-# disconnected and later be able to perform a partial resynchronization.
-#
-# The backlog is only allocated once there is at least a slave connected.
-#
-# repl-backlog-size 1mb
-
-# After a master has no longer connected slaves for some time, the backlog
-# will be freed. The following option configures the amount of seconds that
-# need to elapse, starting from the time the last slave disconnected, for
-# the backlog buffer to be freed.
-#
-# A value of 0 means to never release the backlog.
-#
-# repl-backlog-ttl 3600
-
-# The slave priority is an integer number published by Redis in the INFO output.
-# It is used by Redis Sentinel in order to select a slave to promote into a
-# master if the master is no longer working correctly.
-#
-# A slave with a low priority number is considered better for promotion, so
-# for instance if there are three slaves with priority 10, 100, 25 Sentinel will
-# pick the one with priority 10, that is the lowest.
-#
-# However a special priority of 0 marks the slave as not able to perform the
-# role of master, so a slave with priority of 0 will never be selected by
-# Redis Sentinel for promotion.
-#
-# By default the priority is 100.
-slave-priority 100
-
-# It is possible for a master to stop accepting writes if there are less than
-# N slaves connected, having a lag less or equal than M seconds.
-#
-# The N slaves need to be in "online" state.
-#
-# The lag in seconds, that must be <= the specified value, is calculated from
-# the last ping received from the slave, that is usually sent every second.
-#
-# This option does not GUARANTEES that N replicas will accept the write, but
-# will limit the window of exposure for lost writes in case not enough slaves
-# are available, to the specified number of seconds.
-#
-# For example to require at least 3 slaves with a lag <= 10 seconds use:
-#
-# min-slaves-to-write 3
-# min-slaves-max-lag 10
-#
-# Setting one or the other to 0 disables the feature.
-#
-# By default min-slaves-to-write is set to 0 (feature disabled) and
-# min-slaves-max-lag is set to 10.
-
-################################## SECURITY ###################################
-
-# Require clients to issue AUTH <PASSWORD> before processing any other
-# commands.  This might be useful in environments in which you do not trust
-# others with access to the host running redis-server.
-#
-# This should stay commented out for backward compatibility and because most
-# people do not need auth (e.g. they run their own servers).
-# 
-# Warning: since Redis is pretty fast an outside user can try up to
-# 150k passwords per second against a good box. This means that you should
-# use a very strong password otherwise it will be very easy to break.
-#
-# requirepass foobared
-
-# Command renaming.
-#
-# It is possible to change the name of dangerous commands in a shared
-# environment. For instance the CONFIG command may be renamed into something
-# hard to guess so that it will still be available for internal-use tools
-# but not available for general clients.
-#
-# Example:
-#
-# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
-#
-# It is also possible to completely kill a command by renaming it into
-# an empty string:
-#
-# rename-command CONFIG ""
-#
-# Please note that changing the name of commands that are logged into the
-# AOF file or transmitted to slaves may cause problems.
-
-################################### LIMITS ####################################
-
-# Set the max number of connected clients at the same time. By default
-# this limit is set to 10000 clients, however if the Redis server is not
-# able to configure the process file limit to allow for the specified limit
-# the max number of allowed clients is set to the current file limit
-# minus 32 (as Redis reserves a few file descriptors for internal uses).
-#
-# Once the limit is reached Redis will close all the new connections sending
-# an error 'max number of clients reached'.
-#
-# maxclients 10000
-
-# Don't use more memory than the specified amount of bytes.
-# When the memory limit is reached Redis will try to remove keys
-# according to the eviction policy selected (see maxmemory-policy).
-#
-# If Redis can't remove keys according to the policy, or if the policy is
-# set to 'noeviction', Redis will start to reply with errors to commands
-# that would use more memory, like SET, LPUSH, and so on, and will continue
-# to reply to read-only commands like GET.
-#
-# This option is usually useful when using Redis as an LRU cache, or to set
-# a hard memory limit for an instance (using the 'noeviction' policy).
-#
-# WARNING: If you have slaves attached to an instance with maxmemory on,
-# the size of the output buffers needed to feed the slaves are subtracted
-# from the used memory count, so that network problems / resyncs will
-# not trigger a loop where keys are evicted, and in turn the output
-# buffer of slaves is full with DELs of keys evicted triggering the deletion
-# of more keys, and so forth until the database is completely emptied.
-#
-# In short... if you have slaves attached it is suggested that you set a lower
-# limit for maxmemory so that there is some free RAM on the system for slave
-# output buffers (but this is not needed if the policy is 'noeviction').
-#
-# maxmemory <bytes>
-
-# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
-# is reached. You can select among five behaviors:
-# 
-# volatile-lru -> remove the key with an expire set using an LRU algorithm
-# allkeys-lru -> remove any key accordingly to the LRU algorithm
-# volatile-random -> remove a random key with an expire set
-# allkeys-random -> remove a random key, any key
-# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
-# noeviction -> don't expire at all, just return an error on write operations
-# 
-# Note: with any of the above policies, Redis will return an error on write
-#       operations, when there are not suitable keys for eviction.
-#
-#       At the date of writing this commands are: set setnx setex append
-#       incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
-#       sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
-#       zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
-#       getset mset msetnx exec sort
-#
-# The default is:
-#
-# maxmemory-policy volatile-lru
-
-# LRU and minimal TTL algorithms are not precise algorithms but approximated
-# algorithms (in order to save memory), so you can select as well the sample
-# size to check. For instance for default Redis will check three keys and
-# pick the one that was used less recently, you can change the sample size
-# using the following configuration directive.
-#
-# maxmemory-samples 3
-
-############################## APPEND ONLY MODE ###############################
-
-# By default Redis asynchronously dumps the dataset on disk. This mode is
-# good enough in many applications, but an issue with the Redis process or
-# a power outage may result into a few minutes of writes lost (depending on
-# the configured save points).
-#
-# The Append Only File is an alternative persistence mode that provides
-# much better durability. For instance using the default data fsync policy
-# (see later in the config file) Redis can lose just one second of writes in a
-# dramatic event like a server power outage, or a single write if something
-# wrong with the Redis process itself happens, but the operating system is
-# still running correctly.
-#
-# AOF and RDB persistence can be enabled at the same time without problems.
-# If the AOF is enabled on startup Redis will load the AOF, that is the file
-# with the better durability guarantees.
-#
-# Please check http://redis.io/topics/persistence for more information.
-
-appendonly no
-
-# The name of the append only file (default: "appendonly.aof")
-
-appendfilename "appendonly.aof"
-
-# The fsync() call tells the Operating System to actually write data on disk
-# instead to wait for more data in the output buffer. Some OS will really flush 
-# data on disk, some other OS will just try to do it ASAP.
-#
-# Redis supports three different modes:
-#
-# no: don't fsync, just let the OS flush the data when it wants. Faster.
-# always: fsync after every write to the append only log . Slow, Safest.
-# everysec: fsync only one time every second. Compromise.
-#
-# The default is "everysec", as that's usually the right compromise between
-# speed and data safety. It's up to you to understand if you can relax this to
-# "no" that will let the operating system flush the output buffer when
-# it wants, for better performances (but if you can live with the idea of
-# some data loss consider the default persistence mode that's snapshotting),
-# or on the contrary, use "always" that's very slow but a bit safer than
-# everysec.
-#
-# More details please check the following article:
-# http://antirez.com/post/redis-persistence-demystified.html
-#
-# If unsure, use "everysec".
-
-# appendfsync always
-appendfsync everysec
-# appendfsync no
-
-# When the AOF fsync policy is set to always or everysec, and a background
-# saving process (a background save or AOF log background rewriting) is
-# performing a lot of I/O against the disk, in some Linux configurations
-# Redis may block too long on the fsync() call. Note that there is no fix for
-# this currently, as even performing fsync in a different thread will block
-# our synchronous write(2) call.
-#
-# In order to mitigate this problem it's possible to use the following option
-# that will prevent fsync() from being called in the main process while a
-# BGSAVE or BGREWRITEAOF is in progress.
-#
-# This means that while another child is saving, the durability of Redis is
-# the same as "appendfsync none". In practical terms, this means that it is
-# possible to lose up to 30 seconds of log in the worst scenario (with the
-# default Linux settings).
-# 
-# If you have latency problems turn this to "yes". Otherwise leave it as
-# "no" that is the safest pick from the point of view of durability.
-
-no-appendfsync-on-rewrite no
-
-# Automatic rewrite of the append only file.
-# Redis is able to automatically rewrite the log file implicitly calling
-# BGREWRITEAOF when the AOF log size grows by the specified percentage.
-# 
-# This is how it works: Redis remembers the size of the AOF file after the
-# latest rewrite (if no rewrite has happened since the restart, the size of
-# the AOF at startup is used).
-#
-# This base size is compared to the current size. If the current size is
-# bigger than the specified percentage, the rewrite is triggered. Also
-# you need to specify a minimal size for the AOF file to be rewritten, this
-# is useful to avoid rewriting the AOF file even if the percentage increase
-# is reached but it is still pretty small.
-#
-# Specify a percentage of zero in order to disable the automatic AOF
-# rewrite feature.
-
-auto-aof-rewrite-percentage 100
-auto-aof-rewrite-min-size 64mb
-
-################################ LUA SCRIPTING  ###############################
-
-# Max execution time of a Lua script in milliseconds.
-#
-# If the maximum execution time is reached Redis will log that a script is
-# still in execution after the maximum allowed time and will start to
-# reply to queries with an error.
-#
-# When a long running script exceed the maximum execution time only the
-# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
-# used to stop a script that did not yet called write commands. The second
-# is the only way to shut down the server in the case a write commands was
-# already issue by the script but the user don't want to wait for the natural
-# termination of the script.
-#
-# Set it to 0 or a negative value for unlimited execution without warnings.
-lua-time-limit 5000
-
-################################## SLOW LOG ###################################
-
-# The Redis Slow Log is a system to log queries that exceeded a specified
-# execution time. The execution time does not include the I/O operations
-# like talking with the client, sending the reply and so forth,
-# but just the time needed to actually execute the command (this is the only
-# stage of command execution where the thread is blocked and can not serve
-# other requests in the meantime).
-# 
-# You can configure the slow log with two parameters: one tells Redis
-# what is the execution time, in microseconds, to exceed in order for the
-# command to get logged, and the other parameter is the length of the
-# slow log. When a new command is logged the oldest one is removed from the
-# queue of logged commands.
-
-# The following time is expressed in microseconds, so 1000000 is equivalent
-# to one second. Note that a negative number disables the slow log, while
-# a value of zero forces the logging of every command.
-slowlog-log-slower-than 10000
-
-# There is no limit to this length. Just be aware that it will consume memory.
-# You can reclaim memory used by the slow log with SLOWLOG RESET.
-slowlog-max-len 128
-
-############################# Event notification ##############################
-
-# Redis can notify Pub/Sub clients about events happening in the key space.
-# This feature is documented at http://redis.io/topics/keyspace-events
-# 
-# For instance if keyspace events notification is enabled, and a client
-# performs a DEL operation on key "foo" stored in the Database 0, two
-# messages will be published via Pub/Sub:
-#
-# PUBLISH __keyspace@0__:foo del
-# PUBLISH __keyevent@0__:del foo
-#
-# It is possible to select the events that Redis will notify among a set
-# of classes. Every class is identified by a single character:
-#
-#  K     Keyspace events, published with __keyspace@<db>__ prefix.
-#  E     Keyevent events, published with __keyevent@<db>__ prefix.
-#  g     Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
-#  $     String commands
-#  l     List commands
-#  s     Set commands
-#  h     Hash commands
-#  z     Sorted set commands
-#  x     Expired events (events generated every time a key expires)
-#  e     Evicted events (events generated when a key is evicted for maxmemory)
-#  A     Alias for g$lshzxe, so that the "AKE" string means all the events.
-#
-#  The "notify-keyspace-events" takes as argument a string that is composed
-#  by zero or multiple characters. The empty string means that notifications
-#  are disabled at all.
-#
-#  Example: to enable list and generic events, from the point of view of the
-#           event name, use:
-#
-#  notify-keyspace-events Elg
-#
-#  Example 2: to get the stream of the expired keys subscribing to channel
-#             name __keyevent@0__:expired use:
-#
-#  notify-keyspace-events Ex
-#
-#  By default all notifications are disabled because most users don't need
-#  this feature and the feature has some overhead. Note that if you don't
-#  specify at least one of K or E, no events will be delivered.
-notify-keyspace-events ""
-
-############################### ADVANCED CONFIG ###############################
-
-# Hashes are encoded using a memory efficient data structure when they have a
-# small number of entries, and the biggest entry does not exceed a given
-# threshold. These thresholds can be configured using the following directives.
-hash-max-ziplist-entries 512
-hash-max-ziplist-value 64
-
-# Similarly to hashes, small lists are also encoded in a special way in order
-# to save a lot of space. The special representation is only used when
-# you are under the following limits:
-list-max-ziplist-entries 512
-list-max-ziplist-value 64
-
-# Sets have a special encoding in just one case: when a set is composed
-# of just strings that happens to be integers in radix 10 in the range
-# of 64 bit signed integers.
-# The following configuration setting sets the limit in the size of the
-# set in order to use this special memory saving encoding.
-set-max-intset-entries 512
-
-# Similarly to hashes and lists, sorted sets are also specially encoded in
-# order to save a lot of space. This encoding is only used when the length and
-# elements of a sorted set are below the following limits:
-zset-max-ziplist-entries 128
-zset-max-ziplist-value 64
-
-# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
-# order to help rehashing the main Redis hash table (the one mapping top-level
-# keys to values). The hash table implementation Redis uses (see dict.c)
-# performs a lazy rehashing: the more operation you run into a hash table
-# that is rehashing, the more rehashing "steps" are performed, so if the
-# server is idle the rehashing is never complete and some more memory is used
-# by the hash table.
-# 
-# The default is to use this millisecond 10 times every second in order to
-# active rehashing the main dictionaries, freeing memory when possible.
-#
-# If unsure:
-# use "activerehashing no" if you have hard latency requirements and it is
-# not a good thing in your environment that Redis can reply form time to time
-# to queries with 2 milliseconds delay.
-#
-# use "activerehashing yes" if you don't have such hard requirements but
-# want to free memory asap when possible.
-activerehashing yes
-
-# The client output buffer limits can be used to force disconnection of clients
-# that are not reading data from the server fast enough for some reason (a
-# common reason is that a Pub/Sub client can't consume messages as fast as the
-# publisher can produce them).
-#
-# The limit can be set differently for the three different classes of clients:
-#
-# normal -> normal clients
-# slave  -> slave clients and MONITOR clients
-# pubsub -> clients subscribed to at least one pubsub channel or pattern
-#
-# The syntax of every client-output-buffer-limit directive is the following:
-#
-# client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
-#
-# A client is immediately disconnected once the hard limit is reached, or if
-# the soft limit is reached and remains reached for the specified number of
-# seconds (continuously).
-# So for instance if the hard limit is 32 megabytes and the soft limit is
-# 16 megabytes / 10 seconds, the client will get disconnected immediately
-# if the size of the output buffers reach 32 megabytes, but will also get
-# disconnected if the client reaches 16 megabytes and continuously overcomes
-# the limit for 10 seconds.
-#
-# By default normal clients are not limited because they don't receive data
-# without asking (in a push way), but just after a request, so only
-# asynchronous clients may create a scenario where data is requested faster
-# than it can read.
-#
-# Instead there is a default limit for pubsub and slave clients, since
-# subscribers and slaves receive data in a push fashion.
-#
-# Both the hard or the soft limit can be disabled by setting them to zero.
-client-output-buffer-limit normal 0 0 0
-client-output-buffer-limit slave 256mb 64mb 60
-client-output-buffer-limit pubsub 32mb 8mb 60
-
-# Redis calls an internal function to perform many background tasks, like
-# closing connections of clients in timeout, purging expired keys that are
-# never requested, and so forth.
-#
-# Not all tasks are performed with the same frequency, but Redis checks for
-# tasks to perform accordingly to the specified "hz" value.
-#
-# By default "hz" is set to 10. Raising the value will use more CPU when
-# Redis is idle, but at the same time will make Redis more responsive when
-# there are many keys expiring at the same time, and timeouts may be
-# handled with more precision.
-#
-# The range is between 1 and 500, however a value over 100 is usually not
-# a good idea. Most users should use the default of 10 and raise this up to
-# 100 only in environments where very low latency is required.
-hz 10
-
-# When a child rewrites the AOF file, if the following option is enabled
-# the file will be fsync-ed every 32 MB of data generated. This is useful
-# in order to commit the file to the disk more incrementally and avoid
-# big latency spikes.
-aof-rewrite-incremental-fsync yes
-

+ 2 - 3
toolset/setup/linux/frameworks/cutelyst.sh

@@ -2,7 +2,7 @@
 
 
 fw_installed cutelyst && return 0
 fw_installed cutelyst && return 0
 
 
-CUTELYST_VER=r1.0.0
+CUTELYST_VER=r1.2.0
 QT_VERSION_MM=56
 QT_VERSION_MM=56
 QT_VERSION_FULL=562-trusty
 QT_VERSION_FULL=562-trusty
 
 
@@ -25,6 +25,5 @@ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$IROOT
 
 
 make -j $MAX_THREADS && sudo make install
 make -j $MAX_THREADS && sudo make install
 
 
-echo "" > $IROOT/cutelyst.installed
+echo "QT_VERSION_MM=${QT_VERSION_MM}" > $IROOT/cutelyst.installed
 
 
-source $IROOT/cutelyst.installed

+ 3 - 75
toolset/setup/linux/setup_util.py

@@ -65,85 +65,13 @@ def replace_text(file, to_replace, replacement):
     with open(file, "w") as f:
     with open(file, "w") as f:
         f.write(replaced_text)
         f.write(replaced_text)
 
 
-# Replaces the current process environment with the one found in 
-# config file. Retains a few original vars (HOME,PATH, etc) by default. 
-# Optionally allows specification of a command to be run before loading
-# the environment, to allow the framework to set environment variables
-# Note: This command *cannot* print to stdout!
-#
-# Note: This will not replace the sudo environment (e.g. subprocess.check_call("sudo <command>")). 
-# If you must use sudo, consider sudo sh -c ". <config> && your_command"
-def replace_environ(config=None, root=None, print_result=False, command='true'):
-
-    if platform.system().lower() == 'windows':
-
-        pass
-
-    else:
-    
-        # Clean up our current environment, preserving some important items
-        mini_environ = {}
-        for envname in ['HOME', 'PATH', 'LANG', 'USER', 'LD_LIBRARY_PATH', 'PYTHONPATH', 'FWROOT', 'TRAVIS']:
-          if envname in os.environ:
-            mini_environ[envname] = os.environ[envname]
-        for key in os.environ:
-          if key.startswith(('TFB_', 'TRAVIS_')):    # Any TFB_* and TRAVIS_* variables are preserved
-            mini_environ[key] = os.environ[key]
-        os.environ.clear()
-
-        # Use FWROOT if explicitely provided
-        if root is not None: 
-          mini_environ['FWROOT']=root
-        
-
-        # Run command, source config file, and store resulting environment
-        setup_env = "%s && . %s && env" % (command, config)
-        env = ""
-        try:
-            env = subprocess.check_output(setup_env, shell=True, env=mini_environ,
-           executable='/bin/bash')
-        except subprocess.CalledProcessError:
-            # Ensure that an error here does not crash the toolset
-            print "CRITICAL: Loading %s returned non-zero exit" % config
-            for key,value in mini_environ.iteritems():
-                os.environ[key]=value
-            return
-        for line in env.split('\n'):
-            try:
-                key, value = line.split('=', 1)
-                # If we already have this TFB_ variable, do not overwrite
-                if key.startswith('TFB_') and key in mini_environ:
-                    os.environ[key]=mini_environ[key]
-                else:
-                    os.environ[key]=value    
-            except Exception:
-                if not line: # Don't warn for empty line
-                    continue 
-                print "WARN: Line '%s' from '%s' is not an environment variable" % (line, config)
-                continue
-        if print_result:
-            out = subprocess.check_output('env', shell=True, executable='/bin/bash')
-            print "Environment after loading %s" %config
-            print out
-
 # Queries the shell for the value of FWROOT
 # Queries the shell for the value of FWROOT
 def get_fwroot():
 def get_fwroot():
 
 
-    if platform.system().lower() == 'windows':
-
-        fwroot = "C:\FrameworkBenchmarks"
-        return fwroot
-
+    if os.getenv('FWROOT'):
+        return os.environ['FWROOT']
     else:
     else:
-    
-        try:
-            # Use printf to avoid getting a newline
-            # Redirect to avoid stderr printing
-            fwroot = subprocess.check_output('printf $FWROOT 2> /dev/null', shell=True, executable='/bin/bash')
-            return fwroot
-        except subprocess.CalledProcessError:
-            # Make a last-guess effort ;-)
-            return os.getcwd();
+        return os.getcwd()
 
 
 # Turns absolute path into path relative to FWROOT
 # Turns absolute path into path relative to FWROOT
 # Assumes path is underneath FWROOT, not above
 # Assumes path is underneath FWROOT, not above

+ 4 - 0
toolset/travis/travis_setup.sh

@@ -25,4 +25,8 @@ echo "runner_user=travis"                              >> benchmark.cfg
 
 
 echo "travis ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers
 echo "travis ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers
 
 
+echo 127.0.0.1 TFB-database | sudo tee --append /etc/hosts
+echo 127.0.0.1 TFB-client   | sudo tee --append /etc/hosts
+echo 127.0.0.1 TFB-server   | sudo tee --append /etc/hosts
+
 source ./toolset/setup/linux/prerequisites.sh
 source ./toolset/setup/linux/prerequisites.sh