Jelajahi Sumber

Merge branch 'master' of https://github.com/TechEmpower/FrameworkBenchmarks

jamming 10 tahun lalu
induk
melakukan
69771d2651
90 mengubah file dengan 641 tambahan dan 358 penghapusan
  1. 0 1
      .travis.yml
  2. 3 13
      frameworks/C++/ULib/benchmark_config
  3. 4 4
      frameworks/C++/ULib/install.sh
  4. 9 0
      frameworks/C++/ULib/setup.sh
  5. 2 1
      frameworks/C++/ULib/setup_mysql.sh
  6. 2 1
      frameworks/C++/ULib/setup_postgres.sh
  7. 2 1
      frameworks/C++/ULib/setup_sqlite.sh
  8. 32 22
      frameworks/C++/ULib/src/db.usp
  9. 25 15
      frameworks/C++/ULib/src/fortune.usp
  10. 6 0
      frameworks/C++/ULib/src/json.usp
  11. 32 21
      frameworks/C++/ULib/src/query.usp
  12. 43 33
      frameworks/C++/ULib/src/update.usp
  13. 35 67
      frameworks/C++/wt/benchmark.cpp
  14. 8 1
      frameworks/Java/play2-java/setup_java.sh
  15. 8 1
      frameworks/Java/play2-java/setup_java_ebean_bonecp.sh
  16. 8 1
      frameworks/Java/play2-java/setup_java_ebean_hikaricp.sh
  17. 8 1
      frameworks/Java/play2-java/setup_java_jpa_bonecp.sh
  18. 8 1
      frameworks/Java/play2-java/setup_java_jpa_hikaricp.sh
  19. 2 2
      frameworks/Java/spring/README.md
  20. 1 1
      frameworks/Java/spring/pom.xml
  21. 26 0
      frameworks/Java/spring/src/main/java/com/techempower/spring/SampleApplication.java
  22. 1 1
      frameworks/Python/bottle/setup_nginxuwsgi.sh
  23. 1 1
      frameworks/Python/flask/setup_nginxuwsgi.sh
  24. 1 1
      frameworks/Python/uwsgi/setup_nginx.sh
  25. 1 1
      frameworks/Python/wsgi/setup_nginxuwsgi.sh
  26. 11 4
      frameworks/Ruby/grape/install.sh
  27. 6 1
      frameworks/Ruby/grape/run_jruby_puma.sh
  28. 6 1
      frameworks/Ruby/grape/run_mri_puma.sh
  29. 6 1
      frameworks/Ruby/grape/run_rbx_puma.sh
  30. 6 1
      frameworks/Ruby/grape/run_thin.sh
  31. 6 1
      frameworks/Ruby/grape/run_torqbox.sh
  32. 7 2
      frameworks/Ruby/grape/run_trinidad.sh
  33. 7 1
      frameworks/Ruby/grape/run_unicorn.sh
  34. 11 4
      frameworks/Ruby/padrino/install.sh
  35. 6 1
      frameworks/Ruby/padrino/run_jruby_puma.sh
  36. 6 1
      frameworks/Ruby/padrino/run_mri_puma.sh
  37. 6 1
      frameworks/Ruby/padrino/run_rbx_puma.sh
  38. 6 1
      frameworks/Ruby/padrino/run_thin.sh
  39. 6 1
      frameworks/Ruby/padrino/run_torqbox.sh
  40. 6 1
      frameworks/Ruby/padrino/run_trinidad.sh
  41. 8 1
      frameworks/Ruby/padrino/run_unicorn.sh
  42. 11 4
      frameworks/Ruby/rack/install.sh
  43. 6 1
      frameworks/Ruby/rack/run_jruby_puma.sh
  44. 6 1
      frameworks/Ruby/rack/run_mri_puma.sh
  45. 6 1
      frameworks/Ruby/rack/run_rbx_puma.sh
  46. 6 1
      frameworks/Ruby/rack/run_thin.sh
  47. 6 1
      frameworks/Ruby/rack/run_torqbox.sh
  48. 6 1
      frameworks/Ruby/rack/run_trinidad.sh
  49. 7 1
      frameworks/Ruby/rack/run_unicorn.sh
  50. 9 3
      frameworks/Ruby/rails-stripped/install.sh
  51. 6 1
      frameworks/Ruby/rails-stripped/setup_jruby.sh
  52. 7 1
      frameworks/Ruby/rails-stripped/setup_ruby.sh
  53. 11 4
      frameworks/Ruby/rails/install.sh
  54. 6 1
      frameworks/Ruby/rails/run_jruby_puma.sh
  55. 6 1
      frameworks/Ruby/rails/run_mri_puma.sh
  56. 6 1
      frameworks/Ruby/rails/run_rbx_puma.sh
  57. 6 1
      frameworks/Ruby/rails/run_thin.sh
  58. 6 1
      frameworks/Ruby/rails/run_torqbox.sh
  59. 6 1
      frameworks/Ruby/rails/run_trinidad.sh
  60. 8 1
      frameworks/Ruby/rails/run_unicorn.sh
  61. 11 4
      frameworks/Ruby/sinatra/install.sh
  62. 6 1
      frameworks/Ruby/sinatra/run_jruby_puma.sh
  63. 6 1
      frameworks/Ruby/sinatra/run_mri_puma.sh
  64. 6 1
      frameworks/Ruby/sinatra/run_rbx_puma.sh
  65. 6 1
      frameworks/Ruby/sinatra/run_thin.sh
  66. 6 1
      frameworks/Ruby/sinatra/run_torqbox.sh
  67. 6 1
      frameworks/Ruby/sinatra/run_trinidad.sh
  68. 8 1
      frameworks/Ruby/sinatra/run_unicorn.sh
  69. 0 3
      frameworks/Scala/play-scala-mongodb/bash_profile.sh
  70. 0 24
      frameworks/Scala/play-scala-mongodb/benchmark_config
  71. 0 3
      frameworks/Scala/play-scala-mongodb/install.sh
  72. 0 48
      frameworks/Scala/play-scala-mongodb/setup.py
  73. 0 12
      frameworks/Scala/play-scala-mongodb/setup.sh
  74. 19 0
      frameworks/Scala/play2-scala/benchmark_config
  75. 0 0
      frameworks/Scala/play2-scala/play2-scala-mongodb/.gitignore
  76. 0 0
      frameworks/Scala/play2-scala/play2-scala-mongodb/README.md
  77. 0 0
      frameworks/Scala/play2-scala/play2-scala-mongodb/app/controllers/Application.scala
  78. 0 0
      frameworks/Scala/play2-scala/play2-scala-mongodb/conf/application.conf
  79. 0 0
      frameworks/Scala/play2-scala/play2-scala-mongodb/conf/play.plugins
  80. 0 0
      frameworks/Scala/play2-scala/play2-scala-mongodb/conf/routes
  81. 1 1
      frameworks/Scala/play2-scala/play2-scala-mongodb/project/Build.scala
  82. 0 0
      frameworks/Scala/play2-scala/play2-scala-mongodb/project/build.properties
  83. 0 0
      frameworks/Scala/play2-scala/play2-scala-mongodb/project/plugins.sbt
  84. 0 0
      frameworks/Scala/play2-scala/play2-scala-mongodb/source_code
  85. 16 0
      frameworks/Scala/play2-scala/setup_scala_mongodb.sh
  86. 1 1
      toolset/benchmark/benchmarker.py
  87. 26 8
      toolset/setup/linux/database.sh
  88. 9 1
      toolset/setup/linux/installer.py
  89. 4 4
      toolset/setup/linux/languages/go.sh
  90. 1 1
      toolset/setup/linux/languages/rvm.sh

+ 0 - 1
.travis.yml

@@ -136,7 +136,6 @@ env:
     - "TESTDIR=Scala/lift-stateless"
     - "TESTDIR=Scala/plain"
     - "TESTDIR=Scala/play-activate-mysql"
-    - "TESTDIR=Scala/play-scala-mongodb"
     - "TESTDIR=Scala/play2-scala"
     - "TESTDIR=Scala/scalatra"
     - "TESTDIR=Scala/scruffy"

+ 3 - 13
frameworks/C++/ULib/benchmark_config

@@ -2,17 +2,13 @@
   "framework": "ULib",
   "tests": [{
     "default": {
-      "setup_file": "setup_mysql",
+      "setup_file": "setup",
       "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/query?queries=",
-      "fortune_url": "/fortune",
-      "update_url": "/update?queries=",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Platform",
-      "database": "MySQL",
+      "database": "None",
       "framework": "ULib",
       "language": "C++",
       "orm": "Micro",
@@ -20,18 +16,16 @@
       "webserver": "userver_tcp",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "ULib-mysql",
+      "display_name": "ULib",
       "notes": "",
       "versus": ""
     },
     "mysql": {
       "setup_file": "setup_mysql",
-      "json_url": "/json",
       "db_url": "/db",
       "query_url": "/query?queries=",
       "fortune_url": "/fortune",
       "update_url": "/update?queries=",
-      "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Platform",
@@ -49,11 +43,9 @@
     },
     "sqlite": {
       "setup_file": "setup_sqlite",
-      "json_url": "/json",
       "db_url": "/db",
       "query_url": "/query?queries=",
       "fortune_url": "/fortune",
-      "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Platform",
@@ -71,12 +63,10 @@
     },
     "postgres": {
       "setup_file": "setup_postgres",
-      "json_url": "/json",
       "db_url": "/db",
       "query_url": "/query?queries=",
       "fortune_url": "/fortune",
       "update_url": "/update?queries=",
-      "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Platform",

+ 4 - 4
frameworks/C++/ULib/install.sh

@@ -41,12 +41,12 @@ if [ ! -f "benchmark.cfg" ]; then
   cat <<EOF >benchmark.cfg
 userver {
  PORT 8080
- PREFORK_CHILD 8
- LISTEN_BACKLOG 8192
- MAX_KEEP_ALIVE 8192
+ PREFORK_CHILD 4
+ MAX_KEEP_ALIVE 1023
+ LISTEN_BACKLOG 16384
+ CLIENT_FOR_PARALLELIZATION 256
  ORM_DRIVER "mysql pgsql sqlite"
  DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT
-#PID_FILE ${ULIB_ROOT}/userver_tcp.pid
 }
 EOF
 fi

+ 9 - 0
frameworks/C++/ULib/setup.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+export UMEMPOOL="176,100,0,37,1160,155,-17,-22,40"
+
+# 1. Change ULib Server configuration
+sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD ${MAX_THREADS}|g" ${IROOT}/ULib/benchmark.cfg
+
+# 2. Start ULib Server (userver_tcp)
+${IROOT}/ULib/bin/userver_tcp -c ${IROOT}/ULib/benchmark.cfg &

+ 2 - 1
frameworks/C++/ULib/setup_mysql.sh

@@ -1,9 +1,10 @@
 #!/bin/bash
 
-export UMEMPOOL="545,0,0,37,8465,0,-17,-22,34"
 export ORM_DRIVER="mysql"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=hello_world"
 
+export UMEMPOOL="176,100,0,37,1160,155,-17,-22,40"
+
 # 1. Change ULib Server configuration
 sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD ${MAX_THREADS}|g" $IROOT/ULib/benchmark.cfg
 

+ 2 - 1
frameworks/C++/ULib/setup_postgres.sh

@@ -1,9 +1,10 @@
 #!/bin/bash
 
-export UMEMPOOL="545,0,0,37,8465,0,-17,-22,34"
 export ORM_DRIVER="pgsql"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
 
+export UMEMPOOL="176,100,0,37,1160,155,-17,-22,40"
+
 # 1. Change ULib Server configuration
 sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD ${MAX_THREADS}|g" $IROOT/ULib/benchmark.cfg
 

+ 2 - 1
frameworks/C++/ULib/setup_sqlite.sh

@@ -1,9 +1,10 @@
 #!/bin/bash
 
-export UMEMPOOL="545,0,0,37,8465,0,-17,-22,34"
 export ORM_DRIVER="sqlite"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=${ULIB_ROOT}/db/%.*s"
 
+export UMEMPOOL="176,100,0,37,1160,155,-17,-22,40"
+
 # 1. Change ULib Server configuration
 sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD ${MAX_THREADS}|g" ${IROOT}/ULib/benchmark.cfg
 

+ 32 - 22
frameworks/C++/ULib/src/db.usp

@@ -1,48 +1,58 @@
+<!--#
+Test type 2: Single database query
+TechEmpower Web Framework Benchmarks
+-->
 <!--#declaration
 #include "world.h"
 
-#ifndef AS_cpoll_cppsp_DO
-static UValue* pvalue;
-#endif
 static World*         pworld_db;
 static UOrmSession*   psql_db;
 static UOrmStatement* pstmt_db;
 
-static void usp_init_db()
-{
-   U_TRACE(5, "::usp_init_db()")
-
-   pworld_db = U_NEW(World);
-
 #ifndef AS_cpoll_cppsp_DO
-   pvalue = U_NEW(UValue(OBJECT_VALUE));
+static UValue* pvalue;
 #endif
-}
 
 static void usp_fork_db()
 {
    U_TRACE(5, "::usp_fork_db()")
 
-   psql_db  = U_NEW(UOrmSession(U_CONSTANT_TO_PARAM("hello_world")));
-   pstmt_db = U_NEW(UOrmStatement(*psql_db, U_CONSTANT_TO_PARAM("SELECT randomNumber FROM World WHERE id = ?")));
+   psql_db = U_NEW(UOrmSession(U_CONSTANT_TO_PARAM("hello_world")));
+
+   if (psql_db->isReady())
+      {
+      pstmt_db = U_NEW(UOrmStatement(*psql_db, U_CONSTANT_TO_PARAM("SELECT randomNumber FROM World WHERE id = ?")));
+
+      if (pstmt_db == 0) U_ERROR("usp_fork_db(): we cound't connect to db");
+
+      pworld_db = U_NEW(World);
 
-   if (pstmt_db == 0) U_ERROR("usp_fork_db(): we cound't connect to db");
+      pstmt_db->use( pworld_db->id);
+      pstmt_db->into(pworld_db->randomNumber);
 
-   pstmt_db->use( pworld_db->id);
-   pstmt_db->into(pworld_db->randomNumber);
+#  ifndef AS_cpoll_cppsp_DO
+      pvalue = U_NEW(UValue(OBJECT_VALUE));
+#  endif
+      }
 }
 
+#ifdef DEBUG
 static void usp_end_db()
 {
    U_TRACE(5, "::usp_end_db()")
 
-   delete pstmt_db;
-   delete psql_db;
-   delete pworld_db;
-#ifndef AS_cpoll_cppsp_DO
-   delete pvalue;
-#endif
+   if (pstmt_db)
+      {
+      delete  pstmt_db;
+      delete   psql_db;
+      delete pworld_db;
+
+#  ifndef AS_cpoll_cppsp_DO
+      delete pvalue;
+#  endif
+      }
 }
+#endif
 -->
 <!--#header
 Content-Type: application/json; charset=UTF-8

+ 25 - 15
frameworks/C++/ULib/src/fortune.usp

@@ -1,43 +1,53 @@
+<!--#
+Test type 4: Fortunes
+TechEmpower Web Framework Benchmarks
+-->
 <!--#declaration
 #include "fortune.h"
 
-static UOrmSession*       psql_fortune;
-static UOrmStatement*     pstmt_fortune;
 static Fortune*           pfortune;
 static UString*           pmessage;
+static UOrmSession*       psql_fortune;
+static UOrmStatement*     pstmt_fortune;
 static UVector<Fortune*>* pvfortune;
 
-static void usp_init_fortune()
-{
-   U_TRACE(5, "::usp_init_fortune()")
-
-   pfortune  = U_NEW(Fortune);
-   pvfortune = U_NEW(UVector<Fortune*>);
-   pmessage  = U_NEW(U_STRING_FROM_CONSTANT("Additional fortune added at request time."));
-}
-
 static void usp_fork_fortune()
 {
    U_TRACE(5, "::usp_fork_fortune()")
 
-   psql_fortune  = U_NEW(UOrmSession(U_CONSTANT_TO_PARAM("fortune")));
-   pstmt_fortune = U_NEW(UOrmStatement(*psql_fortune, U_CONSTANT_TO_PARAM("SELECT id, message FROM Fortune")));
+   psql_fortune = U_NEW(UOrmSession(U_CONSTANT_TO_PARAM("fortune")));
+
+   if (psql_fortune->isReady())
+      {
+      pstmt_fortune = U_NEW(UOrmStatement(*psql_fortune, U_CONSTANT_TO_PARAM("SELECT id, message FROM Fortune")));
+
+      if (pstmt_fortune == 0) U_ERROR("usp_fork_fortune(): we cound't connect to db");
+
+      pfortune = U_NEW(Fortune);
 
-   if (pstmt_fortune == 0) U_ERROR("usp_fork_fortune(): we cound't connect to db");
+      pstmt_fortune->into(*pfortune);
 
-   pstmt_fortune->into(*pfortune);
+      pmessage  = U_NEW(U_STRING_FROM_CONSTANT("Additional fortune added at request time."));
+      pvfortune = U_NEW(UVector<Fortune*>);
+      }
 }
 
+#ifdef DEBUG
 static void usp_end_fortune()
 {
    U_TRACE(5, "::usp_end_fortune()")
 
+   if (pstmt_fortune)
+   {
    delete pstmt_fortune;
+
    delete psql_fortune;
    delete pvfortune;
    delete pfortune;
    delete pmessage;
+   }
 }
+#endif
 -->
 <!doctype html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr><!--#code
 Fortune* elem;

+ 6 - 0
frameworks/C++/ULib/src/json.usp

@@ -1,3 +1,7 @@
+<!--#
+Test type 1: JSON serialization
+TechEmpower Web Framework Benchmarks
+-->
 <!--#declaration
 #ifdef AS_cpoll_cppsp_DO
 #undef AS_cpoll_cppsp_DO
@@ -19,6 +23,7 @@ static void usp_init_json()
 #endif
 }
 
+#ifdef DEBUG
 static void usp_end_json()
 {
    U_TRACE(5, "::usp_end_json()")
@@ -28,6 +33,7 @@ static void usp_end_json()
    delete pvalue;
 #endif
 }
+#endif
 -->
 <!--#header
 Content-Type: application/json; charset=UTF-8

+ 32 - 21
frameworks/C++/ULib/src/query.usp

@@ -1,51 +1,62 @@
+<!--#
+Test type 3: Multiple database queries
+TechEmpower Web Framework Benchmarks
+-->
 <!--#declaration
 #include "world.h"
 
-#ifndef AS_cpoll_cppsp_DO
-static UValue* pvalue;
-#endif
+static World*           pworld_query;
 static UOrmSession*     psql_query;
 static UOrmStatement*   pstmt_query;
-static World*           pworld_query;
 static UVector<World*>* pvworld_query;
 
-static void usp_init_query()
-{
-   U_TRACE(5, "::usp_init_query()")
-
-   pworld_query  = U_NEW(World);
-   pvworld_query = U_NEW(UVector<World*>(500));
-
 #ifndef AS_cpoll_cppsp_DO
-   pvalue = U_NEW(UValue(ARRAY_VALUE));
+static UValue* pvalue;
 #endif
-}
 
 static void usp_fork_query()
 {
    U_TRACE(5, "::usp_fork_query()")
 
-   psql_query  = U_NEW(UOrmSession(U_CONSTANT_TO_PARAM("hello_world")));
-   pstmt_query = U_NEW(UOrmStatement(*psql_query, U_CONSTANT_TO_PARAM("SELECT randomNumber FROM World WHERE id = ?")));
+   psql_query = U_NEW(UOrmSession(U_CONSTANT_TO_PARAM("hello_world")));
+
+   if (psql_query->isReady())
+      {
+      pstmt_query = U_NEW(UOrmStatement(*psql_query, U_CONSTANT_TO_PARAM("SELECT randomNumber FROM World WHERE id = ?")));
+
+      if (pstmt_query == 0) U_ERROR("usp_fork_query(): we cound't connect to db");
+
+      pworld_query = U_NEW(World);
+
+      pstmt_query->use( pworld_query->id);
+      pstmt_query->into(pworld_query->randomNumber);
 
-   if (pstmt_query == 0) U_ERROR("usp_fork_query(): we cound't connect to db");
+      pvworld_query = U_NEW(UVector<World*>(500));
 
-   pstmt_query->use( pworld_query->id);
-   pstmt_query->into(pworld_query->randomNumber);
+#  ifndef AS_cpoll_cppsp_DO
+      pvalue = U_NEW(UValue(ARRAY_VALUE));
+#  endif
+      }
 }
 
+#ifdef DEBUG
 static void usp_end_query()
 {
    U_TRACE(5, "::usp_end_query()")
 
-   delete pstmt_query;
-   delete psql_query;
+   if (pstmt_query)
+   {
+   delete   pstmt_query;
+   delete    psql_query;
    delete pvworld_query;
-   delete pworld_query;
+   delete  pworld_query;
+
 #ifndef AS_cpoll_cppsp_DO
    delete pvalue;
 #endif
+   }
 }
+#endif
 -->
 <!--#args
 queries;

+ 43 - 33
frameworks/C++/ULib/src/update.usp

@@ -1,26 +1,19 @@
+<!--#
+Test type 5: Database updates
+TechEmpower Web Framework Benchmarks
+-->
 <!--#declaration
 #include "world.h"
 
-#ifndef AS_cpoll_cppsp_DO
-static UValue* pvalue;
-#endif
+static World*           pworld_update;
 static UOrmSession*     psql_update;
 static UOrmStatement*   pstmt1;
 static UOrmStatement*   pstmt2;
-static World*           pworld_update;
 static UVector<World*>* pvworld_update;
 
-static void usp_init_update()
-{
-   U_TRACE(5, "::usp_init_update()")
-
-   pworld_update  = U_NEW(World);
-   pvworld_update = U_NEW(UVector<World*>(500));
-
 #ifndef AS_cpoll_cppsp_DO
-   pvalue = U_NEW(UValue(ARRAY_VALUE));
+static UValue* pvalue;
 #endif
-}
 
 static void usp_fork_update()
 {
@@ -28,33 +21,52 @@ static void usp_fork_update()
 
    psql_update = U_NEW(UOrmSession(U_CONSTANT_TO_PARAM("hello_world")));
 
-   pstmt1 = U_NEW(UOrmStatement(*psql_update, U_CONSTANT_TO_PARAM("SELECT randomNumber FROM World WHERE id = ?")));
-   pstmt2 = U_NEW(UOrmStatement(*psql_update, U_CONSTANT_TO_PARAM("UPDATE World SET randomNumber = ? WHERE id = ?")));
-
-   if (pstmt1 == 0 ||
-       pstmt2 == 0)
+   if (psql_update->isReady())
       {
-      U_ERROR("usp_fork_update(): we cound't connect to db");
-      }
+      pstmt1 = U_NEW(UOrmStatement(*psql_update, U_CONSTANT_TO_PARAM("SELECT randomNumber FROM World WHERE id = ?")));
+      pstmt2 = U_NEW(UOrmStatement(*psql_update, U_CONSTANT_TO_PARAM("UPDATE World SET randomNumber = ? WHERE id = ?")));
 
-   pstmt1->use( pworld_update->id);
-   pstmt1->into(pworld_update->randomNumber);
-   pstmt2->use( pworld_update->randomNumber, pworld_update->id);
+      if (pstmt1 == 0 ||
+          pstmt2 == 0)
+         {
+         U_ERROR("usp_fork_update(): we cound't connect to db");
+         }
+
+      pworld_update = U_NEW(World);
+
+      pstmt1->use( pworld_update->id);
+      pstmt1->into(pworld_update->randomNumber);
+      pstmt2->use( pworld_update->randomNumber, pworld_update->id);
+
+      pvworld_update = U_NEW(UVector<World*>(500));
+
+#  ifndef AS_cpoll_cppsp_DO
+      pvalue = U_NEW(UValue(ARRAY_VALUE));
+#  endif
+      }
 }
 
+#ifdef DEBUG
 static void usp_end_update()
 {
    U_TRACE(5, "::usp_end_update()")
 
-   delete pstmt1;
-   delete pstmt2;
-   delete psql_update;
-   delete pvworld_update;
-   delete pworld_update;
-#ifndef AS_cpoll_cppsp_DO
-   delete pvalue;
-#endif
+   if (pstmt1 &&
+       pstmt2)
+      {
+      delete pstmt1;
+      delete pstmt2;
+
+      delete    psql_update;
+      delete pvworld_update;
+      delete  pworld_update;
+
+#  ifndef AS_cpoll_cppsp_DO
+      delete pvalue;
+#  endif
+      }
 }
+#endif
 -->
 <!--#args
 queries;
@@ -78,8 +90,6 @@ while (true)
 
    pstmt1->execute();
 
-   U_INTERNAL_DUMP("pworld_update->randomNumber = %u", pworld_update->randomNumber)
-
    pworld_update->randomNumber = u_get_num_random(10000);
 
    pstmt2->execute();

+ 35 - 67
frameworks/C++/wt/benchmark.cpp

@@ -91,57 +91,38 @@ public:
     }
 };
 
-std::mutex mtx;
-
-struct DbStruct {
-#ifndef BENCHMARK_USE_POSTGRES
-  Wt::Dbo::backend::MySQL connection;
+class MyConnection : public
+#ifdef BENCHMARK_USE_POSTGRES
+  Wt::Dbo::backend::Postgres
 #else
-  Wt::Dbo::backend::Postgres connection;
+  Wt::Dbo::backend::MySQL
 #endif
-  Wt::Dbo::Session session;
-  Wt::Dbo::Transaction *transaction;
-
-  boost::taus88 rng;
-  boost::random::uniform_int_distribution<int> distribution;
-
-#ifndef BENCHMARK_USE_POSTGRES
-  DbStruct() : connection("hello_world", "benchmarkdbuser", "benchmarkdbpass", "INSERT_DB_HOST_HERE", 3306),
+{
+public:
+#ifdef BENCHMARK_USE_POSTGRES
+  MyConnection(const std::string &db) :
+  Wt::Dbo::backend::Postgres(db) {}
 #else
-  DbStruct() : connection("host=INSERT_DB_HOST_HERE port=5432 user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world"),
+  MyConnection(const std::string &db, const std::string &dbuser, const std::string &dbpasswd, const std::string &dbhost, unsigned int dbport) :
+  Wt::Dbo::backend::MySQL(db, dbuser, dbpasswd, dbhost, dbport) {}
 #endif
-      rng(clock()),
-      distribution(1, 10000) {
-    session.setConnection(connection);
-    session.mapClass<World>("world");
-    session.mapClass<Fortune>("fortune");
-    transaction = new Wt::Dbo::Transaction(session);
-  }
-
-  ~DbStruct() {
-    delete transaction;
-  }
 
-  int rand() {
-    return distribution(rng);
-  }
+  virtual void startTransaction() { }
+  virtual void commitTransaction() { }
+  virtual void rollbackTransaction() { }
 };
 
-struct DbStructNoTransaction {
-#ifndef BENCHMARK_USE_POSTGRES
-  Wt::Dbo::backend::MySQL connection;
-#else
-  Wt::Dbo::backend::Postgres connection;
-#endif
+struct DbStruct {
+  MyConnection connection;
   Wt::Dbo::Session session;
 
   boost::taus88 rng;
   boost::random::uniform_int_distribution<int> distribution;
 
 #ifndef BENCHMARK_USE_POSTGRES
-  DbStructNoTransaction() : connection("hello_world", "benchmarkdbuser", "benchmarkdbpass", "INSERT_DB_HOST_HERE", 3306),
+  DbStruct() : connection("hello_world", "benchmarkdbuser", "benchmarkdbpass", "INSERT_DB_HOST_HERE", 3306),
 #else
-  DbStructNoTransaction() : connection("host=INSERT_DB_HOST_HERE port=5432 user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world"),
+  DbStruct() : connection("host=INSERT_DB_HOST_HERE port=5432 user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world"),
 #endif
       rng(clock()),
       distribution(1, 10000) {
@@ -155,9 +136,11 @@ struct DbStructNoTransaction {
   }
 };
 
-class DbResource : public Wt::WResource {
-private:
+namespace {
   boost::thread_specific_ptr<DbStruct> dbStruct_;
+}
+
+class DbResource : public Wt::WResource {
 public:
   virtual void handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) {
     response.setMimeType("application/json");
@@ -165,13 +148,11 @@ public:
 
     DbStruct* db = dbStruct_.get();
     if (!db) {
-      std::lock_guard<std::mutex> lock(mtx);
-      if (!db) {
-        db = new DbStruct();
-        dbStruct_.reset(db);
-      }
+      db = new DbStruct();
+      dbStruct_.reset(db);
     }
 
+    Wt::Dbo::Transaction transaction(db->session);
     Wt::Dbo::ptr<World> entry = db->session.load<World>(db->rand());
     
     Wt::Dbo::JsonSerializer writer(response.out());
@@ -180,8 +161,6 @@ public:
 };
 
 class QueriesResource : public Wt::WResource {
-private:
-  boost::thread_specific_ptr<DbStruct> dbStruct_;
 public:
   virtual void handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) {
     int n;
@@ -200,13 +179,11 @@ public:
 
     DbStruct* db = dbStruct_.get();
     if (!db) {
-      std::lock_guard<std::mutex> lock(mtx);
-      if (!db) {
-        db = new DbStruct();
-        dbStruct_.reset(db);
-      }
+      db = new DbStruct();
+      dbStruct_.reset(db);
     }
 
+    Wt::Dbo::Transaction transaction(db->session);
     std::vector<Wt::Dbo::ptr<World> > results;
     results.reserve(n);
     for (int i = 0; i < n; ++i) {
@@ -250,7 +227,7 @@ public:
 
   virtual void resolveString(const std::string& varName, const std::vector<Wt::WString>& vars, std::ostream& result) {
     if (varName == "id")
-      format(result, Wt::WString::fromUTF8(boost::lexical_cast<std::string>(it_->id())), Wt::XHTMLUnsafeText);
+      result << it_->id();
     else if (varName == "message")
       format(result, Wt::WString::fromUTF8((*it_)->message));
     else
@@ -259,8 +236,6 @@ public:
 };
 
 class FortuneResource : public Wt::WResource {
-private:
-  boost::thread_specific_ptr<DbStruct> dbStruct_;
 public:
   virtual void handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) {
     response.setMimeType("text/html; charset=utf-8");
@@ -268,13 +243,11 @@ public:
 
     DbStruct* db = dbStruct_.get();
     if (!db) {
-      std::lock_guard<std::mutex> lock(mtx);
-      if (!db) {
-        db = new DbStruct();
-        dbStruct_.reset(db);
-      }
+      db = new DbStruct();
+      dbStruct_.reset(db);
     }
 
+    Wt::Dbo::Transaction transaction(db->session);
     Fortunes fortunes = db->session.find<Fortune>();
     VFortunes vFortunes;
     for (Fortunes::const_iterator i = fortunes.begin(); i != fortunes.end(); ++i)
@@ -293,8 +266,6 @@ public:
 };
 
 class UpdateResource : public Wt::WResource {
-private:
-  boost::thread_specific_ptr<DbStructNoTransaction> dbStruct_;
 public:
   virtual void handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) {
     int n;
@@ -311,13 +282,10 @@ public:
     response.setMimeType("application/json");
     response.addHeader("Server", "Wt");
 
-    DbStructNoTransaction* db = dbStruct_.get();
+    DbStruct* db = dbStruct_.get();
     if (!db) {
-      std::lock_guard<std::mutex> lock(mtx);
-      if (!db) {
-        db = new DbStructNoTransaction();
-        dbStruct_.reset(db);
-      }
+      db = new DbStruct();
+      dbStruct_.reset(db);
     }
 
     std::vector<Wt::Dbo::ptr<World> > results;

+ 8 - 1
frameworks/Java/play2-java/setup_java.sh

@@ -1,5 +1,12 @@
 #!/bin/bash
 
 cd play2-java
+
+# If application is running, clear old running app.
+if [ -f ${TROOT}/play2-java/target/universal/stage/RUNNING_PID ]
+then
+  rm -f -r ${TROOT}/play2-java/target/universal/stage/RUNNING_PID
+fi
+
 ${IROOT}/sbt/bin/sbt stage
-target/universal/stage/bin/play2-java &
+target/universal/stage/bin/play2-java &

+ 8 - 1
frameworks/Java/play2-java/setup_java_ebean_bonecp.sh

@@ -1,5 +1,12 @@
 #!/bin/bash
 
 cd play2-java-ebean-bonecp
+
+# If application is running, clear old running app.
+if [ -f ${TROOT}/play2-java-ebean-bonecp/target/universal/stage/RUNNING_PID ]
+then
+  rm -f -r ${TROOT}/play2-java-ebean-bonecp/target/universal/stage/RUNNING_PID
+fi
+
 ${IROOT}/sbt/bin/sbt stage
-target/universal/stage/bin/play2-java-ebean-bonecp &
+target/universal/stage/bin/play2-java-ebean-bonecp &

+ 8 - 1
frameworks/Java/play2-java/setup_java_ebean_hikaricp.sh

@@ -1,5 +1,12 @@
 #!/bin/bash
 
 cd play2-java-ebean-hikaricp
+
+# If application is running, clear old running app.
+if [ -f ${TROOT}/play2-java-ebean-hikaricp/target/universal/stage/RUNNING_PID ]
+then
+  rm -f -r ${TROOT}/play2-java-ebean-hikaricp/target/universal/stage/RUNNING_PID
+fi
+
 ${IROOT}/sbt/bin/sbt stage
-target/universal/stage/bin/play2-java-ebean-hikaricp &
+target/universal/stage/bin/play2-java-ebean-hikaricp &

+ 8 - 1
frameworks/Java/play2-java/setup_java_jpa_bonecp.sh

@@ -1,5 +1,12 @@
 #!/bin/bash
 
 cd play2-java-jpa-bonecp
+
+# If application is running, clear old running app.
+if [ -f ${TROOT}/play2-java-jpa-bonecp/target/universal/stage/RUNNING_PID ]
+then
+  rm -f -r ${TROOT}/play2-java-jpa-bonecp/target/universal/stage/RUNNING_PID
+fi
+
 ${IROOT}/sbt/bin/sbt stage
-target/universal/stage/bin/play2-java-jpa-bonecp &
+target/universal/stage/bin/play2-java-jpa-bonecp &

+ 8 - 1
frameworks/Java/play2-java/setup_java_jpa_hikaricp.sh

@@ -1,5 +1,12 @@
 #!/bin/bash
 
 cd play2-java-jpa-hikaricp
+
+# If application is running, clear old running app.
+if [ -f ${TROOT}/play2-java-jpa-hikaricp/target/universal/stage/RUNNING_PID ]
+then
+  rm -f -r ${TROOT}/play2-java-jpa-hikaricp/target/universal/stage/RUNNING_PID
+fi
+
 ${IROOT}/sbt/bin/sbt stage
-target/universal/stage/bin/play2-java-jpa-hikaricp &
+target/universal/stage/bin/play2-java-jpa-hikaricp &

+ 2 - 2
frameworks/Java/spring/README.md

@@ -61,8 +61,8 @@ Check out [SampleApplication, the main Application file](src/main/java/com/teche
 ## Infrastructure Software Versions
 The tests were run with:
 
-* [Spring 4.1.3.RELEASE](http://projects.spring.io/spring-framework/)
-* [Spring Boot 1.2.0.RELEASE](http://projects.spring.io/spring-boot/)
+* [Spring 4.1.4.RELEASE](http://projects.spring.io/spring-framework/)
+* [Spring Boot 1.2.1.RELEASE](http://projects.spring.io/spring-boot/)
 * [Spring Data JPA 1.7.1.RELEASE](http://projects.spring.io/spring-data-jpa/)
 * [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
 * [Undertow 1.1.1.Final](http://undertow.io/)

+ 1 - 1
frameworks/Java/spring/pom.xml

@@ -8,7 +8,7 @@
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>1.2.0.RELEASE</version>
+        <version>1.2.1.RELEASE</version>
     </parent>
 
     <groupId>com.techempower</groupId>

+ 26 - 0
frameworks/Java/spring/src/main/java/com/techempower/spring/SampleApplication.java

@@ -1,9 +1,16 @@
 package com.techempower.spring;
 
+import io.undertow.Undertow;
+import io.undertow.UndertowOptions;
+import org.xnio.Options;
+
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
 import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.context.embedded.undertow.UndertowBuilderCustomizer;
+import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory;
 import org.springframework.boot.context.web.SpringBootServletInitializer;
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.web.servlet.config.annotation.EnableWebMvc;
 
@@ -21,4 +28,23 @@ public class SampleApplication extends SpringBootServletInitializer {
 		new SpringApplicationBuilder(SampleApplication.class).run(args);
 	}
 
+	@Bean
+	public UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory() {
+		UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
+		factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {
+
+			@Override
+			public void customize(Undertow.Builder builder) {
+				builder.setBufferSize(1024 * 16)
+						.setIoThreads(Runtime.getRuntime().availableProcessors() * 2)
+						.setSocketOption(Options.BACKLOG, 10000)
+						.setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false)
+						.setServerOption(UndertowOptions.ALWAYS_SET_DATE, true)
+						.setWorkerThreads(200);
+			}
+
+		});
+		return factory;
+	}
+
 }

+ 1 - 1
frameworks/Python/bottle/setup_nginxuwsgi.sh

@@ -3,4 +3,4 @@
 sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
 
 ${NGINX_HOME}/sbin/nginx -c ${TROOT}/nginx.conf
-${PY2_ROOT}/bin/uwsgi -d ${ERR} --ini ${TROOT}/uwsgi.ini --processes ${MAX_THREADS} --wsgi app:app
+${PY2_ROOT}/bin/uwsgi --ini ${TROOT}/uwsgi.ini --processes ${MAX_THREADS} --wsgi app:app &

+ 1 - 1
frameworks/Python/flask/setup_nginxuwsgi.sh

@@ -3,4 +3,4 @@
 sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
 
 $NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf
-${PY2_ROOT}/bin/uwsgi -d ${ERR} --ini ${TROOT}/uwsgi.ini --processes ${MAX_THREADS} --wsgi app:app
+${PY2_ROOT}/bin/uwsgi --ini ${TROOT}/uwsgi.ini --processes ${MAX_THREADS} --wsgi app:app &

+ 1 - 1
frameworks/Python/uwsgi/setup_nginx.sh

@@ -3,4 +3,4 @@
 sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
 
 $NGINX_HOME/sbin/nginx -c ${TROOT}/nginx.conf
-$PY2_ROOT/bin/uwsgi -d ${ERR} --ini uwsgi.ini --processes ${MAX_THREADS} --gevent 1000 --wsgi hello
+$PY2_ROOT/bin/uwsgi --ini uwsgi.ini --processes ${MAX_THREADS} --gevent 1000 --wsgi hello &

+ 1 - 1
frameworks/Python/wsgi/setup_nginxuwsgi.sh

@@ -3,4 +3,4 @@
 sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
 
 $NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf
-$PY2_ROOT/bin/uwsgi -d ${ERR} --ini uwsgi.ini --processes ${MAX_THREADS} --wsgi hello:app
+$PY2_ROOT/bin/uwsgi --ini uwsgi.ini --processes ${MAX_THREADS} --wsgi hello:app &

+ 11 - 4
frameworks/Ruby/grape/install.sh

@@ -2,13 +2,20 @@
 
 fw_depends rvm nginx java
 
-rvm install ruby-2.0.0-p0
-rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile
+if [ "$TRAVIS" = "true" ]
+then
+	rvmsudo rvm install ruby-2.0.0-p0
+	rvmsudo rvm install jruby-1.7.8
+	rvmsudo rvm install rbx-2.2.10
+else
+	rvm install ruby-2.0.0-p0
+	rvm install jruby-1.7.8
+	rvm install rbx-2.2.10
+fi
 
-rvm install jruby-1.7.8
+rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile --path vendor/bundle
 rvm jruby-1.7.8 do bundle install --gemfile=$TROOT/Gemfile
 
 export LC_ALL=en_US.UTF-8 
 export LANG=en_US.UTF-8
-rvm install rbx-2.2.10
 rvm rbx-2.2.10 do bundle install --gemfile=$TROOT/Gemfile

+ 6 - 1
frameworks/Ruby/grape/run_jruby_puma.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 

+ 6 - 1
frameworks/Ruby/grape/run_mri_puma.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 

+ 6 - 1
frameworks/Ruby/grape/run_rbx_puma.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 

+ 6 - 1
frameworks/Ruby/grape/run_thin.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 

+ 6 - 1
frameworks/Ruby/grape/run_torqbox.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 

+ 7 - 2
frameworks/Ruby/grape/run_trinidad.sh

@@ -3,8 +3,13 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 
-rvm jruby-1.7.8 do bundle exec trinidad --config config/trinidad.yml
+rvm jruby-1.7.8 do bundle exec trinidad --config config/trinidad.yml &

+ 7 - 1
frameworks/Ruby/grape/run_unicorn.sh

@@ -3,9 +3,15 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
+sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
 
 $NGINX_HOME/sbin/nginx -c $TROOT/config/nginx.conf
 

+ 11 - 4
frameworks/Ruby/padrino/install.sh

@@ -2,13 +2,20 @@
 
 fw_depends rvm nginx java
 
-rvm install ruby-2.0.0-p0
-rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile
+if [ "$TRAVIS" = "true" ]
+then
+	rvmsudo rvm install ruby-2.0.0-p0
+	rvmsudo rvm install jruby-1.7.8
+	rvmsudo rvm install rbx-2.2.10
+else
+	rvm install ruby-2.0.0-p0
+	rvm install jruby-1.7.8
+	rvm install rbx-2.2.10
+fi
 
-rvm install jruby-1.7.8
+rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile --path vendor/bundle
 rvm jruby-1.7.8 do bundle install --gemfile=$TROOT/Gemfile
 
 export LC_ALL=en_US.UTF-8 
 export LANG=en_US.UTF-8
-rvm install rbx-2.2.10
 rvm rbx-2.2.10 do bundle install --gemfile=$TROOT/Gemfile

+ 6 - 1
frameworks/Ruby/padrino/run_jruby_puma.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm jruby-1.7.8 do bundle exec puma -C config/puma.rb &

+ 6 - 1
frameworks/Ruby/padrino/run_mri_puma.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm ruby-2.0.0-p0 do bundle exec puma -C config/puma.rb -w 8 --preload &

+ 6 - 1
frameworks/Ruby/padrino/run_rbx_puma.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm rbx-2.2.10 do bundle exec puma &

+ 6 - 1
frameworks/Ruby/padrino/run_thin.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm ruby-2.0.0-p0 do bundle exec thin start -C config/thin.yml &

+ 6 - 1
frameworks/Ruby/padrino/run_torqbox.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm jruby-1.7.8 do bundle exec torqbox -b 0.0.0.0 -E production &

+ 6 - 1
frameworks/Ruby/padrino/run_trinidad.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm jruby-1.7.8 do bundle exec trinidad --config config/trinidad.yml &

+ 8 - 1
frameworks/Ruby/padrino/run_unicorn.sh

@@ -3,7 +3,14 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
+
+sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
 
 $NGINX_HOME/sbin/nginx -c $TROOT/config/nginx.conf
 

+ 11 - 4
frameworks/Ruby/rack/install.sh

@@ -2,13 +2,20 @@
 
 fw_depends rvm nginx java
 
-rvm install ruby-2.0.0-p0
-rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile
+if [ "$TRAVIS" = "true" ]
+then
+	rvmsudo rvm install ruby-2.0.0-p0
+	rvmsudo rvm install jruby-1.7.8
+	rvmsudo rvm install rbx-2.2.10
+else
+	rvm install ruby-2.0.0-p0
+	rvm install jruby-1.7.8
+	rvm install rbx-2.2.10
+fi
 
-rvm install jruby-1.7.8
+rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile --path vendor/bundle
 rvm jruby-1.7.8 do bundle install --gemfile=$TROOT/Gemfile
 
 export LC_ALL=en_US.UTF-8 
 export LANG=en_US.UTF-8
-rvm install rbx-2.2.10
 rvm rbx-2.2.10 do bundle install --gemfile=$TROOT/Gemfile

+ 6 - 1
frameworks/Ruby/rack/run_jruby_puma.sh

@@ -5,6 +5,11 @@ sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm jruby-1.7.8 do bundle exec puma -b tcp://0.0.0.0:8080 -e production &

+ 6 - 1
frameworks/Ruby/rack/run_mri_puma.sh

@@ -5,6 +5,11 @@ sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm ruby-2.0.0-p0 do bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production &

+ 6 - 1
frameworks/Ruby/rack/run_rbx_puma.sh

@@ -5,6 +5,11 @@ sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm rbx-2.2.10 do bundle exec puma -b tcp://0.0.0.0:8080 -e production &

+ 6 - 1
frameworks/Ruby/rack/run_thin.sh

@@ -5,6 +5,11 @@ sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm ruby-2.0.0-p0 do bundle exec thin start -C config/thin.yml &

+ 6 - 1
frameworks/Ruby/rack/run_torqbox.sh

@@ -5,6 +5,11 @@ sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm jruby-1.7.8 do bundle exec torqbox -b 0.0.0.0 -E production &

+ 6 - 1
frameworks/Ruby/rack/run_trinidad.sh

@@ -5,6 +5,11 @@ sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm jruby-1.7.8 do bundle exec trinidad --config config/trinidad.yml &

+ 7 - 1
frameworks/Ruby/rack/run_unicorn.sh

@@ -1,11 +1,17 @@
 #!/bin/bash
 
 sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
+sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
 
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 $NGINX_HOME/sbin/nginx -c $TROOT/config/nginx.conf
 

+ 9 - 3
frameworks/Ruby/rails-stripped/install.sh

@@ -2,8 +2,14 @@
 
 fw_depends rvm nginx java
 
-rvm install ruby-2.0.0-p0
-rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile-ruby
+if [ "$TRAVIS" = "true" ]
+then
+	rvmsudo rvm install ruby-2.0.0-p0
+	rvmsudo rvm install jruby-1.7.8
+else
+	rvm install ruby-2.0.0-p0
+	rvm install jruby-1.7.8
+fi
 
-rvm install jruby-1.7.8
+rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile-ruby --path vendor/bundle
 rvm jruby-1.7.8 do bundle install --gemfile=$TROOT/Gemfile-jruby

+ 6 - 1
frameworks/Ruby/rails-stripped/setup_jruby.sh

@@ -5,7 +5,12 @@ sed -i 's|host: .*|host: '"${DBHOST}"'|g' config/database.yml
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rm -f Gemfile
 cp Gemfile-jruby Gemfile

+ 7 - 1
frameworks/Ruby/rails-stripped/setup_ruby.sh

@@ -1,11 +1,17 @@
 #!/bin/bash
 
 sed -i 's|host: .*|host: '"${DBHOST}"'|g' config/database.yml
+sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
 
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rm -f Gemfile
 cp Gemfile-ruby Gemfile

+ 11 - 4
frameworks/Ruby/rails/install.sh

@@ -2,13 +2,20 @@
 
 fw_depends rvm nginx java
 
-rvm install 2.1.2
-rvm 2.1.2 do bundle install --gemfile=$TROOT/Gemfile
+if [ "$TRAVIS" = "true" ]
+then
+	rvmsudo rvm install 2.1.2
+	rvmsudo rvm install jruby-1.7.13
+	rvmsudo rvm install rbx-2.2.10
+else
+	rvm install 2.1.2
+	rvm install jruby-1.7.13
+	rvm install rbx-2.2.10
+fi
 
-rvm install jruby-1.7.13
+rvm 2.1.2 do bundle install --gemfile=$TROOT/Gemfile
 rvm jruby-1.7.13 do bundle install --gemfile=$TROOT/Gemfile
 
 export LC_ALL=en_US.UTF-8 
 export LANG=en_US.UTF-8
-rvm install rbx-2.2.10
 rvm rbx-2.2.10 do bundle install --gemfile=$TROOT/Gemfile

+ 6 - 1
frameworks/Ruby/rails/run_jruby_puma.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm jruby-1.7.13 do bundle exec puma -b tcp://0.0.0.0:8080 -e production &

+ 6 - 1
frameworks/Ruby/rails/run_mri_puma.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm ruby-2.1.2 do bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production &

+ 6 - 1
frameworks/Ruby/rails/run_rbx_puma.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm rbx-2.2.10 do bundle exec puma -b tcp://0.0.0.0:8080 -e production &

+ 6 - 1
frameworks/Ruby/rails/run_thin.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm ruby-2.1.2 do bundle exec thin start -C config/thin.yml &

+ 6 - 1
frameworks/Ruby/rails/run_torqbox.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm jruby-1.7.13 do bundle exec torqbox -b 0.0.0.0 -E production &

+ 6 - 1
frameworks/Ruby/rails/run_trinidad.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm jruby-1.7.13 do bundle exec trinidad --config config/trinidad.yml &

+ 8 - 1
frameworks/Ruby/rails/run_unicorn.sh

@@ -1,9 +1,16 @@
 #!/bin/bash
 
+sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
+
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 $NGINX_HOME/sbin/nginx -c $TROOT/config/nginx.conf
 

+ 11 - 4
frameworks/Ruby/sinatra/install.sh

@@ -2,13 +2,20 @@
 
 fw_depends rvm nginx java maven
 
-rvm install ruby-2.0.0-p0
-rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile
+if [ "$TRAVIS" = "true" ]
+then
+	rvmsudo rvm install ruby-2.0.0-p0
+	rvmsudo rvm install jruby-1.7.8
+	rvmsudo rvm install rbx-2.2.10
+else
+	rvm install ruby-2.0.0-p0
+	rvm install jruby-1.7.8
+	rvm install rbx-2.2.10
+fi
 
-rvm install jruby-1.7.8
+rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile --path vendor/bundle
 rvm jruby-1.7.8 do bundle install --gemfile=$TROOT/Gemfile
 
 export LC_ALL=en_US.UTF-8 
 export LANG=en_US.UTF-8
-rvm install rbx-2.2.10
 rvm rbx-2.2.10 do bundle install --gemfile=$TROOT/Gemfile

+ 6 - 1
frameworks/Ruby/sinatra/run_jruby_puma.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm jruby-1.7.8 do bundle --jobs 4
 

+ 6 - 1
frameworks/Ruby/sinatra/run_mri_puma.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm ruby-2.0.0-p0 do bundle --jobs 4
 

+ 6 - 1
frameworks/Ruby/sinatra/run_rbx_puma.sh

@@ -3,6 +3,11 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 DB_HOST=${DBHOST} rvm rbx-2.2.10 do bundle exec puma &

+ 6 - 1
frameworks/Ruby/sinatra/run_thin.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm ruby-2.0.0-p0 do bundle --jobs 4
 

+ 6 - 1
frameworks/Ruby/sinatra/run_torqbox.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm jruby-1.7.8 do bundle --jobs 4
 

+ 6 - 1
frameworks/Ruby/sinatra/run_trinidad.sh

@@ -3,7 +3,12 @@
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm jruby-1.7.8 do bundle --jobs 4
 

+ 8 - 1
frameworks/Ruby/sinatra/run_unicorn.sh

@@ -1,9 +1,16 @@
 #!/bin/bash
 
+sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
+
 # We assume single-user installation as 
 # done in our rvm.sh script and 
 # in Travis-CI
-source $HOME/.rvm/scripts/rvm
+if [ "$TRAVIS" = "true" ]
+then
+	source /home/travis/.rvm/scripts/rvm
+else
+	source $HOME/.rvm/scripts/rvm
+fi
 
 rvm ruby-2.0.0-p0 do bundle --jobs 4
 

+ 0 - 3
frameworks/Scala/play-scala-mongodb/bash_profile.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-export PLAY2_HOME=${IROOT}/play-2.2.0

+ 0 - 24
frameworks/Scala/play-scala-mongodb/benchmark_config

@@ -1,24 +0,0 @@
-{
-  "framework": "play-scala-mongodb",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "port": 9000,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "MongoDB",
-      "framework": "play2",
-      "language": "Scala",
-      "orm": "Raw",
-      "platform": "Netty",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "play-scala-rmongo",
-      "notes": "Uses Reactive Mongo",
-      "versus": "netty"
-    }
-  }]
-}

+ 0 - 3
frameworks/Scala/play-scala-mongodb/install.sh

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

+ 0 - 48
frameworks/Scala/play-scala-mongodb/setup.py

@@ -1,48 +0,0 @@
-
-import subprocess
-import sys
-import setup_util
-import os
-from zipfile import ZipFile
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("play-scala-mongodb/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
-
-  subprocess.check_call("play clean dist", shell=True, cwd="play-scala-mongodb", stderr=errfile, stdout=logfile)
-
-  if os.name == 'nt':
-    ZipFile("./play-scala-mongodb/target/universal/play-scala-mongodb-1.0-SNAPSHOT.zip").extractall("./play-scala-mongodb/target/universal")
-    with open("./play-scala-mongodb/target/universal/play-scala-mongodb-1.0-SNAPSHOT/bin/play-scala-mongodb.bat", "w+") as f:
-      f.write("java %1 -cp \"./lib/*;\" play.core.server.NettyServer .")
-    subprocess.Popen("play-scala-mongodb.bat", shell=True, cwd="play-scala-mongodb/target/universal/play-scala-mongodb-1.0-SNAPSHOT/bin", stderr=errfile, stdout=logfile)
-  else:
-    subprocess.check_call("unzip play-scala-mongodb-1.0-SNAPSHOT.zip", shell=True, cwd="play-scala-mongodb/target/universal", stderr=errfile, stdout=logfile)
-    subprocess.check_call("chmod +x play-scala-mongodb", shell=True, cwd="play-scala-mongodb/target/universal/play-scala-mongodb-1.0-SNAPSHOT/bin", stderr=errfile, stdout=logfile)
-    subprocess.Popen("./play-scala-mongodb", shell=True, cwd="play-scala-mongodb/target/universal/play-scala-mongodb-1.0-SNAPSHOT/bin", stderr=errfile, stdout=logfile)
-
-  return 0
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    with open("./play-scala-mongodb/target/universal/play-scala-mongodb-1.0-SNAPSHOT/RUNNING_PID") as f:
-      pid = int(f.read())
-      os.kill(pid, 15)
-  else:
-    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
-    for line in out.splitlines():
-      if 'NettyServer' in line:
-        pid = int(line.split(None, 2)[1])
-        os.kill(pid, 15)
-
-  try:
-    os.remove("play-scala-mongodb/target/universal/play-scala-mongodb-1.0-SNAPSHOT/RUNNING_PID")
-  except OSError:
-    return 1
-
-  # Takes up so much disk space
-  if os.name == 'nt':
-    subprocess.check_call("del /f /s /q target", shell=True, cwd="play-scala-mongodb", stderr=errfile, stdout=logfile)
-  else:
-    subprocess.check_call("rm -rf target", shell=True, cwd="play-scala-mongodb", stderr=errfile, stdout=logfile)
-
-  return 0

+ 0 - 12
frameworks/Scala/play-scala-mongodb/setup.sh

@@ -1,12 +0,0 @@
-#!/bin/bash
-
-sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
-
-${PLAY2_HOME}/play clean dist
-
-cd target/universal
-unzip play-scala-mongodb-1.0-SNAPSHOT.zip
-cd play-scala-mongodb-1.0-SNAPSHOT/bin
-chmod +x play-scala-mongodb
-
-./play-scala-mongodb &

+ 19 - 0
frameworks/Scala/play2-scala/benchmark_config

@@ -82,6 +82,25 @@
         "query_url": "/queries?queries=", 
         "fortune_url": "/fortunes", 
         "update_url": "/update?queries="
+      },
+      "scala-mongodb": {
+        "setup_file": "setup_scala_mongodb",
+        "db_url": "/db",
+        "query_url": "/queries?queries=",
+        "port": 9000,
+        "approach": "Realistic",
+        "classification": "Fullstack",
+        "database": "MongoDB",
+        "framework": "play2",
+        "language": "Scala",
+        "orm": "Raw",
+        "platform": "Netty",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "play2-scala-mongodb",
+        "notes": "Uses Reactive Mongo",
+        "versus": "netty"
       }
     }
   ]

+ 0 - 0
frameworks/Scala/play-scala-mongodb/.gitignore → frameworks/Scala/play2-scala/play2-scala-mongodb/.gitignore


+ 0 - 0
frameworks/Scala/play-scala-mongodb/README.md → frameworks/Scala/play2-scala/play2-scala-mongodb/README.md


+ 0 - 0
frameworks/Scala/play-scala-mongodb/app/controllers/Application.scala → frameworks/Scala/play2-scala/play2-scala-mongodb/app/controllers/Application.scala


+ 0 - 0
frameworks/Scala/play-scala-mongodb/conf/application.conf → frameworks/Scala/play2-scala/play2-scala-mongodb/conf/application.conf


+ 0 - 0
frameworks/Scala/play-scala-mongodb/conf/play.plugins → frameworks/Scala/play2-scala/play2-scala-mongodb/conf/play.plugins


+ 0 - 0
frameworks/Scala/play-scala-mongodb/conf/routes → frameworks/Scala/play2-scala/play2-scala-mongodb/conf/routes


+ 1 - 1
frameworks/Scala/play-scala-mongodb/project/Build.scala → frameworks/Scala/play2-scala/play2-scala-mongodb/project/Build.scala

@@ -3,7 +3,7 @@ import Keys._
 
 object ApplicationBuild extends Build {
 
-  val appName         = "play-scala-mongodb"
+  val appName         = "play2-scala-mongodb"
   val appVersion      = "1.0-SNAPSHOT"
 
   val appDependencies = Seq(

+ 0 - 0
frameworks/Scala/play-scala-mongodb/project/build.properties → frameworks/Scala/play2-scala/play2-scala-mongodb/project/build.properties


+ 0 - 0
frameworks/Scala/play-scala-mongodb/project/plugins.sbt → frameworks/Scala/play2-scala/play2-scala-mongodb/project/plugins.sbt


+ 0 - 0
frameworks/Scala/play-scala-mongodb/source_code → frameworks/Scala/play2-scala/play2-scala-mongodb/source_code


+ 16 - 0
frameworks/Scala/play2-scala/setup_scala_mongodb.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+
+cd play2-scala-mongodb
+sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
+
+# If application has an already existing process id, clear it.
+if [ -f ${TROOT}/play2-scala-mongodb/target/universal/stage/RUNNING_PID ]
+then
+  rm -f -r ${TROOT}/play2-scala-mongodb/target/universal/stage/RUNNING_PID
+fi
+
+# Stage application.
+${IROOT}/sbt/bin/sbt stage
+
+# Execute Start script in background.
+${TROOT}/play2-scala-mongodb/target/universal/stage/bin/play2-scala-mongodb &

+ 1 - 1
toolset/benchmark/benchmarker.py

@@ -493,7 +493,7 @@ class Benchmarker:
       else:
         sys.exit(code)
 
-    logDir = os.path.join(self.latest_results_directory, 'logs', test.name)
+    logDir = os.path.join(self.latest_results_directory, 'logs', test.name.lower())
 
     try:
       os.makedirs(logDir)

+ 26 - 8
toolset/setup/linux/database.sh

@@ -30,6 +30,14 @@ export TFB_DISTRIB_RELEASE=$DISTRIB_RELEASE
 export TFB_DISTRIB_CODENAME=$DISTRIB_CODENAME
 export TFB_DISTRIB_DESCRIPTION=$DISTRIB_DESCRIPTION
 
+##############################
+# check environment
+##############################
+
+# verify that $TFB_DBHOST is set
+echo "TFB_DBHOST: $TFB_DBHOST"
+[ -z "$TFB_DBHOST" ] && echo "ERROR: TFB_DBHOST is not set!"
+
 ##############################
 # Prerequisites
 ##############################
@@ -170,24 +178,34 @@ sudo ln -s /opt/apache-cassandra-$CASS_V /opt/cassandra
 
 rm -rf /ssd/cassandra /ssd/log/cassandra
 mkdir -p /ssd/cassandra /ssd/log/cassandra
-sudo chown -R cassandra:cassandra /ssd/cassandra
+sudo chown -R cassandra:cassandra /ssd/cassandra /ssd/log/cassandra
+
+cp cassandra/cassandra.yaml cassandra/cassandra.yaml.mod
+cat <<EOF > cassandra/cass_conf_replace.sed
+s/- seeds: "\([^"]*\)"/- seeds: "$TFB_DBHOST"/
+s/listen_address: \(.*\)/listen_address: $TFB_DBHOST/
+s/rpc_address: \(.*\)/rpc_address: $TFB_DBHOST/
+EOF
+sed -i -f cassandra/cass_conf_replace.sed cassandra/cassandra.yaml.mod
+
 sudo cp -f cassandra/cassandra.init /etc/init.d/cassandra
 sudo cp -f cassandra/cassandra.init.env /etc/default/cassandra
-sudo cp -f cassandra/cassandra.yaml /opt/apache-cassandra-$CASS_V/conf
+sudo cp -f cassandra/cassandra.yaml.mod /opt/apache-cassandra-$CASS_V/conf/cassandra.yaml
 sudo cp -f cassandra/log4j-server.properties /opt/apache-cassandra-$CASS_V/conf
+
 sudo update-rc.d cassandra defaults
-sudo service cassandra start
+sudo service cassandra restart
 
 for i in {1..45}; do
-  nc -z localhost 9160 && break || sleep 1;
+  nc -z $TFB_DBHOST 9160 && break || sleep 1;
   echo "Waiting for Cassandra ($i/45}"
 done
-nc -z localhost 9160
+nc -z $TFB_DBHOST 9160
 if [ $? -eq 0 ]; then
-  cat cassandra/cleanup-keyspace.cql | /opt/apache-cassandra-$CASS_V/bin/cqlsh 127.0.0.1
+  cat cassandra/cleanup-keyspace.cql | /opt/apache-cassandra-$CASS_V/bin/cqlsh $TFB_DBHOST
   python cassandra/db-data-gen.py > cassandra/tfb-data.cql
-  /opt/apache-cassandra-$CASS_V/bin/cqlsh -f cassandra/create-keyspace.cql 127.0.0.1
-  /opt/apache-cassandra-$CASS_V/bin/cqlsh -f cassandra/tfb-data.cql 127.0.0.1
+  /opt/apache-cassandra-$CASS_V/bin/cqlsh -f cassandra/create-keyspace.cql $TFB_DBHOST
+  /opt/apache-cassandra-$CASS_V/bin/cqlsh -f cassandra/tfb-data.cql $TFB_DBHOST
 else
   >&2 echo "Cassandra did not start, skipping"
 fi

+ 9 - 1
toolset/setup/linux/installer.py

@@ -19,6 +19,14 @@ class Installer:
     linux_install_root = self.fwroot + "/toolset/setup/linux"
     imode = self.benchmarker.install
 
+    script_vars = {
+      'TFB_DBHOST': self.benchmarker.database_host
+    }
+    l=[]
+    for k,v in script_vars.iteritems():
+      l.append("export %s=%s" % (k,v))
+    script_vars_str = "\n".join(l) + "\n\n"
+
     if imode == 'all' or imode == 'server':
       self.__install_server_software()
 
@@ -30,7 +38,7 @@ class Installer:
         p = subprocess.Popen(self.benchmarker.database_ssh_string.split(" ") +
                              ["bash"], stdin=subprocess.PIPE)
         remote_script = myfile.read()
-        p.communicate(remote_script)
+        p.communicate(script_vars_str + remote_script)
         returncode = p.returncode
         if returncode != 0:
           self.__install_error("status code %s running subprocess '%s'." % (returncode, self.benchmarker.database_ssh_string))

+ 4 - 4
toolset/setup/linux/languages/go.sh

@@ -1,9 +1,9 @@
 #!/bin/bash
 
-RETCODE=$(fw_exists ${IROOT}/go1.3.installed)
+RETCODE=$(fw_exists ${IROOT}/go1.4.2.installed)
 [ ! "$RETCODE" == 0 ] || { return 0; }
 
-fw_get https://storage.googleapis.com/golang/go1.3.linux-amd64.tar.gz
-fw_untar go1.3.linux-amd64.tar.gz
+fw_get https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
+fw_untar go1.4.2.linux-amd64.tar.gz
 
-touch ${IROOT}/go1.3.installed
+touch ${IROOT}/go1.4.2.installed

+ 1 - 1
toolset/setup/linux/languages/rvm.sh

@@ -10,7 +10,7 @@ RETCODE=$(fw_exists rvm.installed)
 # Never run installation inside of TRAVIS, 
 # just rely on their default RVM installaton
 [ "$TRAVIS" != "true" ] || { \
-  source ~/.rvm/scripts/rvm
+  source /home/travis/.rvm/scripts/rvm
   touch rvm.installed
   return 0;
 }