Browse Source

Upgraded version of ffead-cpp with latest changes (#5497)

* Upgraded version of ffead-cpp with latest changes

* Fixed cached tests

* Disable apache tests

* Fixed edge case test scenario
Sumeet Chhetri 5 years ago
parent
commit
8df13f3585
51 changed files with 793 additions and 683 deletions
  1. 64 64
      frameworks/C++/ffead-cpp/benchmark_config.json
  2. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-apache-memcached.dockerfile
  3. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-apache-mongo.dockerfile
  4. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-apache-mysql.dockerfile
  5. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-apache-postgresql.dockerfile
  6. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-apache-redis.dockerfile
  7. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-memcached.dockerfile
  8. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-mysql.dockerfile
  9. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-memcached.dockerfile
  10. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-mongo.dockerfile
  11. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-mysql.dockerfile
  12. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-postgresql.dockerfile
  13. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-redis.dockerfile
  14. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql.dockerfile
  15. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-redis.dockerfile
  16. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp.dockerfile
  17. 78 14
      frameworks/C++/ffead-cpp/install_ffead-cpp-framework-forsql.sh
  18. 61 13
      frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh
  19. 12 12
      frameworks/C++/ffead-cpp/run_ffead.sh
  20. 10 0
      frameworks/C++/ffead-cpp/te-benchmark-um/CMakeLists.txt
  21. 4 1
      frameworks/C++/ffead-cpp/te-benchmark-um/config/application.xml
  22. 1 1
      frameworks/C++/ffead-cpp/te-benchmark-um/config/cache.xml
  23. 1 1
      frameworks/C++/ffead-cpp/te-benchmark-um/config/cachememcached.xml
  24. 1 1
      frameworks/C++/ffead-cpp/te-benchmark-um/config/cacheredis.xml
  25. 0 0
      frameworks/C++/ffead-cpp/te-benchmark-um/config/sdorm.xml
  26. 1 0
      frameworks/C++/ffead-cpp/te-benchmark-um/config/sdormmongo.xml
  27. 0 0
      frameworks/C++/ffead-cpp/te-benchmark-um/config/sdormmysql.xml
  28. 0 0
      frameworks/C++/ffead-cpp/te-benchmark-um/config/sdormpostgresql.xml
  29. 70 0
      frameworks/C++/ffead-cpp/te-benchmark-um/include/TeBkUm.h
  30. 7 7
      frameworks/C++/ffead-cpp/te-benchmark-um/include/TeBkUmWorld.h
  31. 43 0
      frameworks/C++/ffead-cpp/te-benchmark-um/sql-src/TeBkUmWorldmongo.cpp
  32. 7 7
      frameworks/C++/ffead-cpp/te-benchmark-um/sql-src/TeBkUmWorldmongo.h
  33. 34 0
      frameworks/C++/ffead-cpp/te-benchmark-um/sql-src/TeBkUmWorldsql.cpp
  34. 7 7
      frameworks/C++/ffead-cpp/te-benchmark-um/sql-src/TeBkUmWorldsql.h
  35. 315 0
      frameworks/C++/ffead-cpp/te-benchmark-um/src/TeBkUm.cpp
  36. 43 0
      frameworks/C++/ffead-cpp/te-benchmark-um/src/TeBkUmWorld.cpp
  37. 18 0
      frameworks/C++/ffead-cpp/te-benchmark-um/src/autotools/Makefile.am
  38. 1 1
      frameworks/C++/ffead-cpp/te-benchmark-um/tpe/fortunes.tpe
  39. 0 10
      frameworks/C++/ffead-cpp/te-benchmark/CMakeLists.txt
  40. 0 31
      frameworks/C++/ffead-cpp/te-benchmark/include/TeBkFortune.h
  41. 0 25
      frameworks/C++/ffead-cpp/te-benchmark/include/TeBkFortuneTemplate.h
  42. 0 22
      frameworks/C++/ffead-cpp/te-benchmark/include/TeBkMessage.h
  43. 0 52
      frameworks/C++/ffead-cpp/te-benchmark/include/TeBkRestController.h
  44. 0 43
      frameworks/C++/ffead-cpp/te-benchmark/sql-src/TeBkWorldmongo.cpp
  45. 0 34
      frameworks/C++/ffead-cpp/te-benchmark/sql-src/TeBkWorldsql.cpp
  46. 0 36
      frameworks/C++/ffead-cpp/te-benchmark/src/TeBkFortune.cpp
  47. 0 40
      frameworks/C++/ffead-cpp/te-benchmark/src/TeBkFortuneTemplate.cpp
  48. 0 20
      frameworks/C++/ffead-cpp/te-benchmark/src/TeBkMessage.cpp
  49. 0 162
      frameworks/C++/ffead-cpp/te-benchmark/src/TeBkRestController.cpp
  50. 0 43
      frameworks/C++/ffead-cpp/te-benchmark/src/TeBkWorld.cpp
  51. 0 21
      frameworks/C++/ffead-cpp/te-benchmark/src/autotools/Makefile.am

+ 64 - 64
frameworks/C++/ffead-cpp/benchmark_config.json

@@ -2,12 +2,12 @@
 	"framework": "ffead-cpp",
 	"tests": [{
 		"default": {
-			"json_url": "/te-benchmark/json",
-			"plaintext_url": "/te-benchmark/plaintext",
-			"db_url": "/te-benchmark/db",
-			"query_url": "/te-benchmark/queries?queries=",
-			"fortune_url": "/te-benchmark/fortunes",
-			"update_url": "/te-benchmark/updates?queries=",
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/te-benchmark-um/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -25,12 +25,12 @@
 			"tags": []
 		},
 		"mysql": {
-			"json_url": "/te-benchmark/json",
-			"plaintext_url": "/te-benchmark/plaintext",
-			"db_url": "/te-benchmark/db",
-			"query_url": "/te-benchmark/queries?queries=",
-			"fortune_url": "/te-benchmark/fortunes",
-			"update_url": "/te-benchmark/updates?queries=",
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/te-benchmark-um/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -48,12 +48,12 @@
 			"tags": []
 		},
 		"postgresql": {
-			"json_url": "/te-benchmark/json",
-			"plaintext_url": "/te-benchmark/plaintext",
-			"db_url": "/te-benchmark/db",
-			"query_url": "/te-benchmark/queries?queries=",
-			"fortune_url": "/te-benchmark/fortunes",
-			"update_url": "/te-benchmark/updates?queries=",
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/te-benchmark-um/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -71,12 +71,12 @@
 			"tags": []
 		},
 		"apache-mongo": {
-			"json_url": "/te-benchmark/json",
-			"plaintext_url": "/te-benchmark/plaintext",
-			"db_url": "/te-benchmark/db",
-			"query_url": "/te-benchmark/queries?queries=",
-			"fortune_url": "/te-benchmark/fortunes",
-			"update_url": "/te-benchmark/updates?queries=",
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/te-benchmark-um/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -94,12 +94,12 @@
 			"tags": ["broken"]
 		},
 		"apache-mysql": {
-			"json_url": "/te-benchmark/json",
-			"plaintext_url": "/te-benchmark/plaintext",
-			"db_url": "/te-benchmark/db",
-			"query_url": "/te-benchmark/queries?queries=",
-			"fortune_url": "/te-benchmark/fortunes",
-			"update_url": "/te-benchmark/updates?queries=",
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/te-benchmark-um/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -114,15 +114,15 @@
 			"display_name": "ffead-cpp-apache-mysql",
 			"notes": "",
 			"versus": "",
-			"tags": []
+			"tags": ["broken"]
 		},
 		"apache-postgresql": {
-			"json_url": "/te-benchmark/json",
-			"plaintext_url": "/te-benchmark/plaintext",
-			"db_url": "/te-benchmark/db",
-			"query_url": "/te-benchmark/queries?queries=",
-			"fortune_url": "/te-benchmark/fortunes",
-			"update_url": "/te-benchmark/updates?queries=",
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/te-benchmark-um/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -137,15 +137,15 @@
 			"display_name": "ffead-cpp-apache-postgresql",
 			"notes": "",
 			"versus": "",
-			"tags": []
+			"tags": ["broken"]
 		},
 		"nginx-mongo": {
-			"json_url": "/te-benchmark/json",
-			"plaintext_url": "/te-benchmark/plaintext",
-			"db_url": "/te-benchmark/db",
-			"query_url": "/te-benchmark/queries?queries=",
-			"fortune_url": "/te-benchmark/fortunes",
-			"update_url": "/te-benchmark/updates?queries=",
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/te-benchmark-um/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -163,12 +163,12 @@
 			"tags": []
 		},
 		"nginx-mysql": {
-			"json_url": "/te-benchmark/json",
-			"plaintext_url": "/te-benchmark/plaintext",
-			"db_url": "/te-benchmark/db",
-			"query_url": "/te-benchmark/queries?queries=",
-			"fortune_url": "/te-benchmark/fortunes",
-			"update_url": "/te-benchmark/updates?queries=",
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/te-benchmark-um/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -186,12 +186,12 @@
 			"tags": []
 		},
 		"nginx-postgresql": {
-			"json_url": "/te-benchmark/json",
-			"plaintext_url": "/te-benchmark/plaintext",
-			"db_url": "/te-benchmark/db",
-			"query_url": "/te-benchmark/queries?queries=",
-			"fortune_url": "/te-benchmark/fortunes",
-			"update_url": "/te-benchmark/updates?queries=",
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/te-benchmark-um/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -209,7 +209,7 @@
 			"tags": []
 		},
 		"redis": {
-			"cached_query_url": "/te-benchmark/cached-worlds?count=",
+			"cached_query_url": "/te-benchmark-um/cached-worlds?count=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -229,7 +229,7 @@
 			"tags": []
 		},
 		"nginx-redis": {
-			"cached_query_url": "/te-benchmark/cached-worlds?count=",
+			"cached_query_url": "/te-benchmark-um/cached-worlds?count=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -249,7 +249,7 @@
 			"tags": []
 		},
 		"apache-redis": {
-			"cached_query_url": "/te-benchmark/cached-worlds?count=",
+			"cached_query_url": "/te-benchmark-um/cached-worlds?count=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -266,10 +266,10 @@
 			"notes": "",
 			"versus": "",
 			"wait_before_sending_requests": 10,
-			"tags": []
+			"tags": ["broken"]
 		},
 		"memcached": {
-			"cached_query_url": "/te-benchmark/cached-worlds?count=",
+			"cached_query_url": "/te-benchmark-um/cached-worlds?count=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -289,7 +289,7 @@
 			"tags": []
 		},
 		"nginx-memcached": {
-			"cached_query_url": "/te-benchmark/cached-worlds?count=",
+			"cached_query_url": "/te-benchmark-um/cached-worlds?count=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -309,7 +309,7 @@
 			"tags": []
 		},
 		"apache-memcached": {
-			"cached_query_url": "/te-benchmark/cached-worlds?count=",
+			"cached_query_url": "/te-benchmark-um/cached-worlds?count=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -326,7 +326,7 @@
 			"notes": "",
 			"versus": "",
 			"wait_before_sending_requests": 10,
-			"tags": []
+			"tags": ["broken"]
 		}
 	}]
 }

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-apache-memcached.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-apache-mongo.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-apache-mysql.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-apache-postgresql.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-apache-redis.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-memcached.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-mysql.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-nginx-memcached.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-nginx-mongo.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-nginx-mysql.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-nginx-postgresql.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-nginx-redis.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-postgresql.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-redis.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp.dockerfile

@@ -8,7 +8,7 @@ RUN mkdir /installs
 
 WORKDIR /
 
-COPY te-benchmark/ te-benchmark/
+COPY te-benchmark-um/ te-benchmark-um/
 COPY *.sh ./
 RUN chmod 755 *.sh
 

+ 78 - 14
frameworks/C++/ffead-cpp/install_ffead-cpp-framework-forsql.sh

@@ -22,37 +22,54 @@ cd $IROOT
 wget -q https://github.com/sumeetchhetri/ffead-cpp/archive/master.zip
 unzip master.zip
 mv ffead-cpp-master ffead-cpp-src
-mv ${TROOT}/ffead-cpp-src ffead-cpp-src
 cd ffead-cpp-src/
 
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
-rm -rf web/te-benchmark
+rm -rf web/te-benchmark-um
 cp -f ${TROOT}/server.sh script/
-cp -rf ${TROOT}/te-benchmark web/
+cp -rf ${TROOT}/te-benchmark-um web/
 sed -i 's|THRD_PSIZ=6|THRD_PSIZ='${SERV_THREADS}'|g' resources/server.prop
 sed -i 's|W_THRD_PSIZ=2|W_THRD_PSIZ='${WRIT_THREADS}'|g' resources/server.prop
+sed -i 's|ENABLE_CRS=true|ENABLE_CRS=false|g' resources/server.prop
+sed -i 's|ENABLE_SEC=true|ENABLE_SEC=false|g' resources/server.prop
+sed -i 's|ENABLE_FLT=true|ENABLE_FLT=false|g' resources/server.prop
+sed -i 's|ENABLE_CNT=true|ENABLE_CNT=true|g' resources/server.prop
+sed -i 's|ENABLE_CNT_MPG=true|ENABLE_CNT_MPG=false|g' resources/server.prop
+sed -i 's|ENABLE_CNT_PTH=true|ENABLE_CNT_PTH=false|g' resources/server.prop
+sed -i 's|ENABLE_CNT_EXT=true|ENABLE_CNT_EXT=false|g' resources/server.prop
+sed -i 's|ENABLE_CNT_RST=true|ENABLE_CNT_RST=true|g' resources/server.prop
+sed -i 's|ENABLE_EXT=true|ENABLE_EXT=true|g' resources/server.prop
+sed -i 's|ENABLE_SCR=true|ENABLE_SCR=false|g' resources/server.prop
+sed -i 's|ENABLE_SWS=true|ENABLE_SWS=false|g' resources/server.prop
 sed -i 's|LOGGING_ENABLED=true|LOGGING_ENABLED=false|g' resources/server.prop
 
-rm -rf web/default web/oauthApp web/flexApp web/markers
+rm -rf web/default web/oauthApp web/flexApp web/markers web/te-benchmark
 
-sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdorm.xml
-sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormmongo.xml
-sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormmysql.xml
-sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormpostgresql.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark-um/config/sdorm.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark-um/config/sdormmongo.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark-um/config/sdormmysql.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark-um/config/sdormpostgresql.xml
+sed -i 's|<pool-size>30</pool-size>|<pool-size>${MAX_THREADS}</pool-size>|g' web/te-benchmark-um/config/sdorm.xml
+sed -i 's|<pool-size>30</pool-size>|<pool-size>${MAX_THREADS}</pool-size>|g' web/te-benchmark-um/config/sdormmongo.xml
+sed -i 's|<pool-size>30</pool-size>|<pool-size>${MAX_THREADS}</pool-size>|g' web/te-benchmark-um/config/sdormmysql.xml
+sed -i 's|<pool-size>30</pool-size>|<pool-size>${MAX_THREADS}</pool-size>|g' web/te-benchmark-um/config/sdormpostgresql.xml
 sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbcinst.ini
 sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbc.ini
 sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/default)||g' CMakeLists.txt
 sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/flexApp)||g' CMakeLists.txt
 sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/oauthApp)||g' CMakeLists.txt
 sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/markers)||g' CMakeLists.txt
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/te-benchmark)||g' CMakeLists.txt
 sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/default/libdefault${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/flexApp/libflexApp${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/oauthApp/liboauthApp${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/markers/libmarkers${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/te-benchmark/libte_benchmark${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 sed -i 's|web/default/src/autotools/Makefile||g' configure.ac
 sed -i 's|web/flexApp/src/autotools/Makefile||g' configure.ac
 sed -i 's|web/oauthApp/src/autotools/Makefile||g' configure.ac
 sed -i 's|web/markers/src/autotools/Makefile||g' configure.ac
+sed -i 's|web/te-benchmark/src/autotools/Makefile||g' configure.ac
 
 #./autogen.sh
 #./configure --enable-debug=no --enable-apachemod=yes --enable-nginxmod=yes --enable-mod_sdormmongo=yes --enable-mod_sdormsql=yes --enable-mod_rediscache=yes --enable-mod_memcached=yes CPPFLAGS="$CPPFLAGS -I${IROOT}/include/libmongoc-1.0 -I${IROOT}/include/libbson-1.0 -I${IROOT}/include/" LDFLAGS="$LDFLAGS -L${IROOT} -L${IROOT}/lib"
@@ -64,12 +81,52 @@ cp resources/sample-odbcinst.ini ${IROOT}/odbcinst.ini
 cp resources/sample-odbc.ini ${IROOT}/odbc.ini
 
 cd ${IROOT}/ffead-cpp-src/
-
-cd ${IROOT}/ffead-cpp-src/
+sed -i 's|Timer t1;|//Timer t1;|g' src/framework/ServiceTask.cpp
+sed -i 's|t1.start();|//t1.start();|g' src/framework/ServiceTask.cpp
+sed -i 's|t1.end();|//t1.end();|g' src/framework/ServiceTask.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/framework/ServiceTask.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/framework/ControllerHandler.cpp
+sed -i 's|t.start();|//t.start();|g' src/framework/ControllerHandler.cpp
+sed -i 's|t.end();|//t.end();|g' src/framework/ControllerHandler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/framework/ControllerHandler.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/modules/server-util/RequestReaderHandler.cpp
+sed -i 's|t.start();|//t.start();|g' src/modules/server-util/RequestReaderHandler.cpp
+sed -i 's|t.end();|//t.end();|g' src/modules/server-util/RequestReaderHandler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/server-util/RequestReaderHandler.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|t.start();|//t.start();|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|t.end();|//t.end();|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|Timer to;|//Timer to;|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|to.start();|//to.start();|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|to.end();|//to.end();|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|Timer t;|//Timer t;|g' web/te-benchmark-um/src/TeBkUm.cpp
+sed -i 's|t.start();|//t.start();|g' web/te-benchmark-um/src/TeBkUm.cpp
+sed -i 's|t.end();|//t.end();|g' web/te-benchmark-um/src/TeBkUm.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' web/te-benchmark-um/src/TeBkUm.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/modules/http/http11/Http11Handler.cpp
+sed -i 's|t.start();|//t.start();|g' src/modules/http/http11/Http11Handler.cpp
+sed -i 's|t.end();|//t.end();|g' src/modules/http/http11/Http11Handler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/http/http11/Http11Handler.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|t.start();|//t.start();|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|t.end();|//t.end();|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|Timer to;|//Timer to;|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|to.start();|//to.start();|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|to.end();|//to.end();|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/http/HttpServiceHandler.cpp
 #Build for sql now
-cp -f web/te-benchmark/sql-src/TeBkWorldsql.h web/te-benchmark/include/TeBkWorld.h
-cp -f web/te-benchmark/sql-src/TeBkWorldsql.cpp web/te-benchmark/src/TeBkWorld.cpp
-make install -j4
+cp -f web/te-benchmark-um/sql-src/TeBkUmWorldsql.h web/te-benchmark-um/include/TeBkUmWorld.h
+cp -f web/te-benchmark-um/sql-src/TeBkUmWorldsql.cpp web/te-benchmark-um/src/TeBkUmWorld.cpp
+make install -j${MAX_THREADS}
+
+rm -f /usr/local/lib/libffead-*
+rm -f /usr/local/lib/libte_benc*
+rm -f /usr/local/lib/libinter.so
+rm -f /usr/local/lib/libdinter.so
+
 cd ffead-cpp-3.0-bin
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
 ./server.sh &
@@ -87,6 +144,13 @@ cd ${IROOT}/ffead-cpp-src/
 cp -rf ffead-cpp-3.0-bin ${IROOT}/ffead-cpp-3.0
 rm -rf ffead-cpp-3.0-bin
 
+ln -s ${IROOT}/ffead-cpp-3.0/lib/libte_benchmark_um.so /usr/local/lib/libte_benchmark_um.so
+ln -s ${IROOT}/ffead-cpp-3.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so
+ln -s ${IROOT}/ffead-cpp-3.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so
+ln -s ${IROOT}/ffead-cpp-3.0/lib/libinter.so /usr/local/lib/libinter.so
+ln -s ${IROOT}/ffead-cpp-3.0/lib/libdinter.so /usr/local/lib/libdinter.so
+ldconfig
+
 cd ${IROOT}/ffead-cpp-3.0
 cp -f ${TROOT}/run_ffead.sh ./
 
@@ -95,4 +159,4 @@ chmod 755 $FFEAD_CPP_PATH/*.sh
 rm -f $FFEAD_CPP_PATH/*.cntrl
 rm -f $FFEAD_CPP_PATH/tmp/*.sess
 #cache related dockerfiles will add the cache.xml accordingly whenever needed
-rm -f web/te-benchmark/config/cache.xml
+rm -f web/te-benchmark-um/config/cache.xml

+ 61 - 13
frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh

@@ -25,44 +25,51 @@ mv ffead-cpp-master ffead-cpp-src
 cd ffead-cpp-src/
 
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
-rm -rf web/te-benchmark
+rm -rf web/te-benchmark-um
 cp -f ${TROOT}/server.sh script/
-cp -rf ${TROOT}/te-benchmark web/
+cp -rf ${TROOT}/te-benchmark-um web/
 sed -i 's|THRD_PSIZ=6|THRD_PSIZ='${SERV_THREADS}'|g' resources/server.prop
 sed -i 's|W_THRD_PSIZ=2|W_THRD_PSIZ='${WRIT_THREADS}'|g' resources/server.prop
 sed -i 's|ENABLE_CRS=true|ENABLE_CRS=false|g' resources/server.prop
 sed -i 's|ENABLE_SEC=true|ENABLE_SEC=false|g' resources/server.prop
 sed -i 's|ENABLE_FLT=true|ENABLE_FLT=false|g' resources/server.prop
-sed -i 's|ENABLE_CNT=false|ENABLE_CNT=true|g' resources/server.prop
+sed -i 's|ENABLE_CNT=true|ENABLE_CNT=true|g' resources/server.prop
 sed -i 's|ENABLE_CNT_MPG=true|ENABLE_CNT_MPG=false|g' resources/server.prop
 sed -i 's|ENABLE_CNT_PTH=true|ENABLE_CNT_PTH=false|g' resources/server.prop
 sed -i 's|ENABLE_CNT_EXT=true|ENABLE_CNT_EXT=false|g' resources/server.prop
-sed -i 's|ENABLE_CNT_RST=false|ENABLE_CNT_RST=true|g' resources/server.prop
-sed -i 's|ENABLE_EXT=false|ENABLE_EXT=true|g' resources/server.prop
+sed -i 's|ENABLE_CNT_RST=true|ENABLE_CNT_RST=true|g' resources/server.prop
+sed -i 's|ENABLE_EXT=true|ENABLE_EXT=true|g' resources/server.prop
 sed -i 's|ENABLE_SCR=true|ENABLE_SCR=false|g' resources/server.prop
 sed -i 's|ENABLE_SWS=true|ENABLE_SWS=false|g' resources/server.prop
 sed -i 's|LOGGING_ENABLED=true|LOGGING_ENABLED=false|g' resources/server.prop
 
-rm -rf web/default web/oauthApp web/flexApp web/markers
+rm -rf web/default web/oauthApp web/flexApp web/markers web/te-benchmark
 
-sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdorm.xml
-sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormmongo.xml
-sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormmysql.xml
-sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormpostgresql.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark-um/config/sdorm.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark-um/config/sdormmongo.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark-um/config/sdormmysql.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark-um/config/sdormpostgresql.xml
+sed -i 's|<pool-size>30</pool-size>|<pool-size>${MAX_THREADS}</pool-size>|g' web/te-benchmark-um/config/sdorm.xml
+sed -i 's|<pool-size>30</pool-size>|<pool-size>${MAX_THREADS}</pool-size>|g' web/te-benchmark-um/config/sdormmongo.xml
+sed -i 's|<pool-size>30</pool-size>|<pool-size>${MAX_THREADS}</pool-size>|g' web/te-benchmark-um/config/sdormmysql.xml
+sed -i 's|<pool-size>30</pool-size>|<pool-size>${MAX_THREADS}</pool-size>|g' web/te-benchmark-um/config/sdormpostgresql.xml
 sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbcinst.ini
 sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbc.ini
 sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/default)||g' CMakeLists.txt
 sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/flexApp)||g' CMakeLists.txt
 sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/oauthApp)||g' CMakeLists.txt
 sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/markers)||g' CMakeLists.txt
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/te-benchmark)||g' CMakeLists.txt
 sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/default/libdefault${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/flexApp/libflexApp${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/oauthApp/liboauthApp${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/markers/libmarkers${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/te-benchmark/libte_benchmark${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 sed -i 's|web/default/src/autotools/Makefile||g' configure.ac
 sed -i 's|web/flexApp/src/autotools/Makefile||g' configure.ac
 sed -i 's|web/oauthApp/src/autotools/Makefile||g' configure.ac
 sed -i 's|web/markers/src/autotools/Makefile||g' configure.ac
+sed -i 's|web/te-benchmark/src/autotools/Makefile||g' configure.ac
 
 #./autogen.sh
 #./configure --enable-debug=no --enable-apachemod=yes --enable-nginxmod=yes --enable-mod_sdormmongo=yes --enable-mod_sdormsql=yes --enable-mod_rediscache=yes --enable-mod_memcached=yes CPPFLAGS="$CPPFLAGS -I${IROOT}/include/libmongoc-1.0 -I${IROOT}/include/libbson-1.0 -I${IROOT}/include/" LDFLAGS="$LDFLAGS -L${IROOT} -L${IROOT}/lib"
@@ -74,8 +81,49 @@ cp resources/sample-odbcinst.ini ${IROOT}/odbcinst.ini
 cp resources/sample-odbc.ini ${IROOT}/odbc.ini
 
 cd ${IROOT}/ffead-cpp-src/
+sed -i 's|Timer t1;|//Timer t1;|g' src/framework/ServiceTask.cpp
+sed -i 's|t1.start();|//t1.start();|g' src/framework/ServiceTask.cpp
+sed -i 's|t1.end();|//t1.end();|g' src/framework/ServiceTask.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/framework/ServiceTask.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/framework/ControllerHandler.cpp
+sed -i 's|t.start();|//t.start();|g' src/framework/ControllerHandler.cpp
+sed -i 's|t.end();|//t.end();|g' src/framework/ControllerHandler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/framework/ControllerHandler.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/modules/server-util/RequestReaderHandler.cpp
+sed -i 's|t.start();|//t.start();|g' src/modules/server-util/RequestReaderHandler.cpp
+sed -i 's|t.end();|//t.end();|g' src/modules/server-util/RequestReaderHandler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/server-util/RequestReaderHandler.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|t.start();|//t.start();|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|t.end();|//t.end();|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|Timer to;|//Timer to;|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|to.start();|//to.start();|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|to.end();|//to.end();|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/server-util/SocketInterface.cpp
+sed -i 's|Timer t;|//Timer t;|g' web/te-benchmark-um/src/TeBkUm.cpp
+sed -i 's|t.start();|//t.start();|g' web/te-benchmark-um/src/TeBkUm.cpp
+sed -i 's|t.end();|//t.end();|g' web/te-benchmark-um/src/TeBkUm.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' web/te-benchmark-um/src/TeBkUm.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/modules/http/http11/Http11Handler.cpp
+sed -i 's|t.start();|//t.start();|g' src/modules/http/http11/Http11Handler.cpp
+sed -i 's|t.end();|//t.end();|g' src/modules/http/http11/Http11Handler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/http/http11/Http11Handler.cpp
+sed -i 's|Timer t;|//Timer t;|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|t.start();|//t.start();|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|t.end();|//t.end();|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|Timer to;|//Timer to;|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|to.start();|//to.start();|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|to.end();|//to.end();|g' src/modules/http/HttpServiceHandler.cpp
+sed -i 's|CommonUtils::ts|//CommonUtils::ts|g' src/modules/http/HttpServiceHandler.cpp
+make install -j${MAX_THREADS}
+
+rm -f /usr/local/lib/libffead-*
+rm -f /usr/local/lib/libte_benc*
+rm -f /usr/local/lib/libinter.so
+rm -f /usr/local/lib/libdinter.so
 
-make install -j4
 cd ffead-cpp-3.0-bin
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
 ./server.sh &
@@ -93,7 +141,7 @@ cd ${IROOT}/ffead-cpp-src/
 cp -rf ffead-cpp-3.0-bin ${IROOT}/ffead-cpp-3.0
 rm -rf ffead-cpp-3.0-bin
 
-ln -s ${IROOT}/ffead-cpp-3.0/lib/libte_benchmark.so /usr/local/lib/libte_benchmark.so
+ln -s ${IROOT}/ffead-cpp-3.0/lib/libte_benchmark_um.so /usr/local/lib/libte_benchmark_um.so
 ln -s ${IROOT}/ffead-cpp-3.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so
 ln -s ${IROOT}/ffead-cpp-3.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so
 ln -s ${IROOT}/ffead-cpp-3.0/lib/libinter.so /usr/local/lib/libinter.so
@@ -108,4 +156,4 @@ chmod 755 $FFEAD_CPP_PATH/*.sh
 rm -f $FFEAD_CPP_PATH/*.cntrl
 rm -f $FFEAD_CPP_PATH/tmp/*.sess
 #cache related dockerfiles will add the cache.xml accordingly whenever needed
-rm -f web/te-benchmark/config/cache.xml
+rm -f web/te-benchmark-um/config/cache.xml

+ 12 - 12
frameworks/C++/ffead-cpp/run_ffead.sh

@@ -20,35 +20,35 @@ service apache2 stop
 service memcached stop
 
 rm -f /tmp/cache.lock
-rm -f web/te-benchmark/config/cache.xml
+rm -f web/te-benchmark-um/config/cache.xml
 
 if [ $2 = "redis" ]
 then
 	service redis-server start
-	cp -f web/te-benchmark/config/cacheredis.xml web/te-benchmark/config/cache.xml
-	cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
+	cp -f web/te-benchmark-um/config/cacheredis.xml web/te-benchmark-um/config/cache.xml
+	cp -f web/te-benchmark-um/config/sdormmongo.xml web/te-benchmark-um/config/sdorm.xml
 fi
 
 if [ $2 = "memcached" ]
 then
 	service memcached start
-	cp -f web/te-benchmark/config/cachememcached.xml web/te-benchmark/config/cache.xml
-	cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
+	cp -f web/te-benchmark-um/config/cachememcached.xml web/te-benchmark-um/config/cache.xml
+	cp -f web/te-benchmark-um/config/sdormmongo.xml web/te-benchmark-um/config/sdorm.xml
 fi
 
 if [ $2 = "mongo" ]
 then
-	cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
+	cp -f web/te-benchmark-um/config/sdormmongo.xml web/te-benchmark-um/config/sdorm.xml
 fi
 
 if [ $2 = "mysql" ]
 then
-	cp -f web/te-benchmark/config/sdormmysql.xml web/te-benchmark/config/sdorm.xml
+	cp -f web/te-benchmark-um/config/sdormmysql.xml web/te-benchmark-um/config/sdorm.xml
 fi
 
 if [ $2 = "postgresql" ]
 then
-	cp -f web/te-benchmark/config/sdormpostgresql.xml web/te-benchmark/config/sdorm.xml
+	cp -f web/te-benchmark-um/config/sdormpostgresql.xml web/te-benchmark-um/config/sdorm.xml
 fi
 
 rm -f rtdcf/*.d rtdcf/*.o 
@@ -69,15 +69,15 @@ fi
 
 if [ $1 = "apache" ]
 then
-	sed -i 's|<pool-size>30</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/sdorm.xml
-	sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/cache.xml
+	sed -i 's|<pool-size>30</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark-um/config/sdorm.xml
+	sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark-um/config/cache.xml
 	apachectl -D FOREGROUND
 fi
 
 if [ $1 = "nginx" ]
 then
-	sed -i 's|<pool-size>30</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/sdorm.xml
-	sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/cache.xml
+	sed -i 's|<pool-size>30</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark-um/config/sdorm.xml
+	sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark-um/config/cache.xml
 	nginx -g 'daemon off;'
 fi
 

+ 10 - 0
frameworks/C++/ffead-cpp/te-benchmark-um/CMakeLists.txt

@@ -0,0 +1,10 @@
+
+file(GLOB sources
+    "include/*.h"
+    "src/*.cpp"
+)
+
+include_directories("${CMAKE_SOURCE_DIR}/web/te-benchmark-um/include")
+add_library(te_benchmark_um SHARED ${sources})
+set_property(TARGET te_benchmark_um PROPERTY POSITION_INDEPENDENT_CODE ON)
+target_link_libraries(te_benchmark_um ffead-modules ffead-framework ${HAVE_CURLLIB} ${HAVE_SSLLIB} ${HAVE_MEMCACHEDLIB} ${HAVE_ODBCLIB} ${HAVE_MONGOCLIB} ${HAVE_BSONLIB} ${HAVE_ZLIB} ${HAVE_CRYPTOLIB})

+ 4 - 1
frameworks/C++/ffead-cpp/te-benchmark/config/application.xml → frameworks/C++/ffead-cpp/te-benchmark-um/config/application.xml

@@ -1,4 +1,4 @@
-<app libname="te_benchmark">
+<app libname="te_benchmark_um" router="TeBkUmRouter">
 	<cors-config>
 		<allow-origins>*</allow-origins>
 		<allow-methods>GET, POST, HEAD, PUT, DELETE</allow-methods>
@@ -18,4 +18,7 @@
 			value="Thu, 15 Apr 2020 20:00:00 GMT" />
 		<control header="Last-Modified" remove="true" />
 	</cache-control>
+	<templates>
+		<template class="TeBkUmRouter" file="fortunes.tpe" path="fortunes"/>
+	</templates>
 </app>

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark/config/cache.xml → frameworks/C++/ffead-cpp/te-benchmark-um/config/cache.xml

@@ -6,7 +6,7 @@
                                 <password>sumeet</password>
                         </node>
                 </nodes>
-                <init>TeBkRestController.updateCache</init>
+                <init>TeBkUmRouter.updateCache</init>
                 <name>Memory-Cached</name>
                 <type>memory</type>
         </cache>

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark/config/cachememcached.xml → frameworks/C++/ffead-cpp/te-benchmark-um/config/cachememcached.xml

@@ -6,7 +6,7 @@
                                 <port>11211</port>
                         </node>
                 </nodes>
-                <init>TeBkRestController.updateCache</init>
+                <init>TeBkUmRouter.updateCache</init>
                 <pool-size>10</pool-size>
                 <expiryTime>3600</expiryTime>
                 <name>Memcached-Cached</name>

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark/config/cacheredis.xml → frameworks/C++/ffead-cpp/te-benchmark-um/config/cacheredis.xml

@@ -6,7 +6,7 @@
                                 <port>6379</port>
                         </node>
                 </nodes>
-                <init>TeBkRestController.updateCache</init>
+                <init>TeBkUmRouter.updateCache</init>
                 <pool-size>10</pool-size>
                 <expiryTime>3600</expiryTime>
                 <name>Redis-Cached</name>

+ 0 - 0
frameworks/C++/ffead-cpp/te-benchmark/config/sdorm.xml → frameworks/C++/ffead-cpp/te-benchmark-um/config/sdorm.xml


+ 1 - 0
frameworks/C++/ffead-cpp/te-benchmark/config/sdormmongo.xml → frameworks/C++/ffead-cpp/te-benchmark-um/config/sdormmongo.xml

@@ -6,6 +6,7 @@
 					<host>localhost</host>
 					<port>27017</port>
 					<databaseName>hello_world</databaseName>
+					<connectionTimeout>10000</connectionTimeout>
 				</node>
 			</nodes>
 			<pool-size>30</pool-size>

+ 0 - 0
frameworks/C++/ffead-cpp/te-benchmark/config/sdormmysql.xml → frameworks/C++/ffead-cpp/te-benchmark-um/config/sdormmysql.xml


+ 0 - 0
frameworks/C++/ffead-cpp/te-benchmark/config/sdormpostgresql.xml → frameworks/C++/ffead-cpp/te-benchmark-um/config/sdormpostgresql.xml


+ 70 - 0
frameworks/C++/ffead-cpp/te-benchmark-um/include/TeBkUm.h

@@ -0,0 +1,70 @@
+/*
+ * TeBkUm.h
+ *
+ *  Created on: 03-Feb-2020
+ *      Author: sumeetc
+ */
+
+#ifndef WEB_TE_BENCHMARK_UM_INCLUDE_TeBkUm_H_
+#define WEB_TE_BENCHMARK_UM_INCLUDE_TeBkUm_H_
+#include "TemplateHandler.h"
+#include "vector"
+#include "DataSourceManager.h"
+#include <stdlib.h>
+#include <algorithm>
+#include "CryptoHandler.h"
+#include "vector"
+#include "CastUtil.h"
+#include <stdlib.h>
+#include "CacheManager.h"
+#include "HttpRequest.h"
+#include "HttpResponse.h"
+#include "JSONSerialize.h"
+#include "string"
+#include "TeBkUmWorld.h"
+#include "yuarel.h"
+#include "Router.h"
+
+typedef std::string (*TeBkUmTemplatePtr) (Context*);
+
+#pragma @Entity
+#pragma @Table name="fortune"
+class TeBkUmFortune {
+	#pragma @Id dbf="id"
+	int id;
+	#pragma @Column dbf="message"
+	std::string message;
+public:
+	TeBkUmFortune();
+	virtual ~TeBkUmFortune();
+	int getId() const;
+	void setId(int id);
+	const std::string& getMessage() const;
+	void setMessage(const std::string& message);
+	bool operator < (const TeBkUmFortune& other) const;
+};
+
+class TeBkUmMessage {
+	std::string message;
+public:
+	virtual ~TeBkUmMessage();
+	const std::string& getMessage() const;
+	void setMessage(const std::string& message);
+};
+
+#pragma @Router
+class TeBkUmRouter : public Router {
+	static const std::string HELLO_WORLD;
+	static std::string WORLD;
+	bool strToNum(const char* str, int len, int& ret);
+	void db(TeBkUmWorld&);
+	void queries(const char*, int, std::vector<TeBkUmWorld>&);
+	void updates(const char*, int, std::vector<TeBkUmWorld>&);
+	void cachedWorlds(const char*, int, std::vector<TeBkUmWorld>&);
+	void getContext(HttpRequest* request, Context* context);
+public:
+	void updateCache();
+	void route(HttpRequest* req, HttpResponse* res, void* dlib, void* ddlib);
+};
+
+#endif /* WEB_TE_BENCHMARK_UM_INCLUDE_TeBkUm_H_ */

+ 7 - 7
frameworks/C++/ffead-cpp/te-benchmark/include/TeBkWorld.h → frameworks/C++/ffead-cpp/te-benchmark-um/include/TeBkUmWorld.h

@@ -1,18 +1,18 @@
 /*
- * TeBkWorld.h
+ * TeBkUmWorld.h
  *
  *  Created on: 11-Mar-2015
  *      Author: sumeetc
  */
 
-#ifndef TEBKWORLD_H_
-#define TEBKWORLD_H_
+#ifndef TeBkUmWORLD_H_
+#define TeBkUmWORLD_H_
 #include "string"
 
 
 #pragma @Entity
 #pragma @Table name="world"
-class TeBkWorld {
+class TeBkUmWorld {
 	#pragma @Id dbf="_id"
 	int id;
 	#pragma @Column dbf="randomNumber"
@@ -21,8 +21,8 @@ class TeBkWorld {
 	#pragma @Column dbf="id"
 	int anotherId;
 public:
-	TeBkWorld();
-	virtual ~TeBkWorld();
+	TeBkUmWorld();
+	virtual ~TeBkUmWorld();
 	int getId() const;
 	void setId(int id);
 	int getRandomNumber() const;
@@ -31,4 +31,4 @@ public:
 	void setAnotherId(int anotherId);
 };
 
-#endif /* TEBKWORLD_H_ */
+#endif /* TeBkUmWORLD_H_ */

+ 43 - 0
frameworks/C++/ffead-cpp/te-benchmark-um/sql-src/TeBkUmWorldmongo.cpp

@@ -0,0 +1,43 @@
+/*
+ * TeBkUmWorld.cpp
+ *
+ *  Created on: 11-Mar-2015
+ *      Author: sumeetc
+ */
+
+#include "TeBkUmWorld.h"
+
+int TeBkUmWorld::getId() const {
+	return id;
+}
+
+void TeBkUmWorld::setId(int id) {
+	this->id = id;
+}
+
+int TeBkUmWorld::getRandomNumber() const {
+	return randomNumber;
+}
+
+void TeBkUmWorld::setRandomNumber(int randomNumber) {
+	this->randomNumber = randomNumber;
+}
+
+TeBkUmWorld::TeBkUmWorld() {
+	id = 0;
+	randomNumber = 0;
+	anotherId = 0;
+}
+
+TeBkUmWorld::~TeBkUmWorld() {
+	// TODO Auto-generated destructor stub
+}
+
+int TeBkUmWorld::getAnotherId() const {
+	return anotherId;
+}
+
+void TeBkUmWorld::setAnotherId(int anotherId) {
+	this->anotherId = anotherId;
+}
+

+ 7 - 7
frameworks/C++/ffead-cpp/te-benchmark/sql-src/TeBkWorldmongo.h → frameworks/C++/ffead-cpp/te-benchmark-um/sql-src/TeBkUmWorldmongo.h

@@ -1,18 +1,18 @@
 /*
- * TeBkWorld.h
+ * TeBkUmWorld.h
  *
  *  Created on: 11-Mar-2015
  *      Author: sumeetc
  */
 
-#ifndef TEBKWORLD_H_
-#define TEBKWORLD_H_
+#ifndef TeBkUmWORLD_H_
+#define TeBkUmWORLD_H_
 #include "string"
 
 
 #pragma @Entity
 #pragma @Table name="world"
-class TeBkWorld {
+class TeBkUmWorld {
 	#pragma @Id dbf="_id"
 	int id;
 	#pragma @Column dbf="randomNumber"
@@ -21,8 +21,8 @@ class TeBkWorld {
 	#pragma @Column dbf="id"
 	int anotherId;
 public:
-	TeBkWorld();
-	virtual ~TeBkWorld();
+	TeBkUmWorld();
+	virtual ~TeBkUmWorld();
 	int getId() const;
 	void setId(int id);
 	int getRandomNumber() const;
@@ -31,4 +31,4 @@ public:
 	void setAnotherId(int anotherId);
 };
 
-#endif /* TEBKWORLD_H_ */
+#endif /* TeBkUmWORLD_H_ */

+ 34 - 0
frameworks/C++/ffead-cpp/te-benchmark-um/sql-src/TeBkUmWorldsql.cpp

@@ -0,0 +1,34 @@
+/*
+ * TeBkUmWorld.cpp
+ *
+ *  Created on: 11-Mar-2015
+ *      Author: sumeetc
+ */
+
+#include "TeBkUmWorld.h"
+
+int TeBkUmWorld::getId() const {
+	return id;
+}
+
+void TeBkUmWorld::setId(int id) {
+	this->id = id;
+}
+
+int TeBkUmWorld::getRandomNumber() const {
+	return randomNumber;
+}
+
+void TeBkUmWorld::setRandomNumber(int randomNumber) {
+	this->randomNumber = randomNumber;
+}
+
+TeBkUmWorld::TeBkUmWorld() {
+	id = 0;
+	randomNumber = 0;
+}
+
+TeBkUmWorld::~TeBkUmWorld() {
+	// TODO Auto-generated destructor stub
+}
+

+ 7 - 7
frameworks/C++/ffead-cpp/te-benchmark/sql-src/TeBkWorldsql.h → frameworks/C++/ffead-cpp/te-benchmark-um/sql-src/TeBkUmWorldsql.h

@@ -1,29 +1,29 @@
 /*
- * TeBkWorld.h
+ * TeBkUmWorld.h
  *
  *  Created on: 11-Mar-2015
  *      Author: sumeetc
  */
 
-#ifndef TEBKWORLD_H_
-#define TEBKWORLD_H_
+#ifndef TeBkUmWORLD_H_
+#define TeBkUmWORLD_H_
 #include "string"
 
 
 #pragma @Entity
 #pragma @Table name="world"
-class TeBkWorld {
+class TeBkUmWorld {
 	#pragma @Id dbf="id"
 	int id;
 	#pragma @Column dbf="randomNumber"
 	int randomNumber;
 public:
-	TeBkWorld();
-	virtual ~TeBkWorld();
+	TeBkUmWorld();
+	virtual ~TeBkUmWorld();
 	int getId() const;
 	void setId(int id);
 	int getRandomNumber() const;
 	void setRandomNumber(int randomNumber);
 };
 
-#endif /* TEBKWORLD_H_ */
+#endif /* TeBkUmWORLD_H_ */

+ 315 - 0
frameworks/C++/ffead-cpp/te-benchmark-um/src/TeBkUm.cpp

@@ -0,0 +1,315 @@
+/*
+ * TeBkUmUm.cpp
+ *
+ *  Created on: 03-Feb-2020
+ *      Author: sumeetc
+ */
+#include "TeBkUm.h"
+
+int TeBkUmFortune::getId() const {
+	return id;
+}
+
+void TeBkUmFortune::setId(int id) {
+	this->id = id;
+}
+
+const std::string& TeBkUmFortune::getMessage() const {
+	return message;
+}
+
+void TeBkUmFortune::setMessage(const std::string& message) {
+	this->message = message;
+}
+
+TeBkUmFortune::TeBkUmFortune() {
+	id = 0;
+}
+
+TeBkUmFortune::~TeBkUmFortune() {
+}
+
+bool TeBkUmFortune::operator < (const TeBkUmFortune& other) const {
+	return message.compare(other.message)<0;
+}
+
+TeBkUmMessage::~TeBkUmMessage() {
+}
+
+const std::string& TeBkUmMessage::getMessage() const {
+	return message;
+}
+
+void TeBkUmMessage::setMessage(const std::string& message) {
+	this->message = message;
+}
+
+const std::string TeBkUmRouter::HELLO_WORLD = "Hello, World!";
+std::string TeBkUmRouter::WORLD = "world";
+
+void TeBkUmRouter::db(TeBkUmWorld& w) {
+	DataSourceInterface* sqli = DataSourceManager::getImpl();
+	int rid = rand() % 10000 + 1;
+	GenericObject id;
+	id << rid;
+	try {
+		w = sqli->get<TeBkUmWorld>(id);
+		delete sqli;
+	} catch(const std::exception& e) {
+		delete sqli;
+		throw e;
+	}
+}
+
+void TeBkUmRouter::queries(const char* q, int ql, std::vector<TeBkUmWorld>& wlst) {
+	int queryCount = 0;
+	strToNum(q, ql, queryCount);
+	if(queryCount<1)queryCount=1;
+	else if(queryCount>500)queryCount=500;
+
+	DataSourceInterface* sqli = DataSourceManager::getImpl();
+
+	try {
+		sqli->startSession(&WORLD);
+		for (int c = 0; c < queryCount; ++c) {
+			int rid = rand() % 10000 + 1;
+			GenericObject id;
+			id << rid;
+			TeBkUmWorld w = sqli->get<TeBkUmWorld>(id);
+			wlst.push_back(w);
+		}
+		sqli->endSession();
+		delete sqli;
+	} catch(const std::exception& e) {
+		delete sqli;
+		throw e;
+	}
+}
+
+void TeBkUmRouter::updates(const char* q, int ql, std::vector<TeBkUmWorld>& wlst) {
+	int queryCount = 0;
+	strToNum(q, ql, queryCount);
+	if(queryCount<1)queryCount=1;
+	else if(queryCount>500)queryCount=500;
+
+	DataSourceInterface* sqli = DataSourceManager::getImpl();
+
+	try {
+		sqli->startSession(&WORLD);
+		for (int c = 0; c < queryCount; ++c) {
+			int rid = rand() % 10000 + 1;
+			GenericObject id;
+			id << rid;
+			TeBkUmWorld w = sqli->get<TeBkUmWorld>(id);
+			int newRandomNumber = rand() % 10000 + 1;
+			if(w.getRandomNumber() == newRandomNumber) {
+				newRandomNumber += 1;
+				if(newRandomNumber>=10000) {
+					newRandomNumber = 1;
+				}
+			}
+			w.setRandomNumber(newRandomNumber);
+			wlst.push_back(w);
+		}
+
+		sqli->startTransaction();
+		sqli->bulkUpdate<TeBkUmWorld>(wlst);
+		sqli->commit();
+
+		sqli->endSession();
+		delete sqli;
+	} catch(const std::exception& e) {
+		delete sqli;
+		throw e;
+	}
+}
+
+void TeBkUmRouter::updateCache() {
+	CacheInterface* cchi = CacheManager::getImpl();
+	DataSourceInterface* sqli = DataSourceManager::getImpl();
+
+	try {
+		sqli->startSession(&WORLD);
+		std::vector<TeBkUmWorld> wlist = sqli->getAll<TeBkUmWorld>();
+		sqli->endSession();
+		for (int c = 0; c < (int)wlist.size(); ++c) {
+			TeBkUmWorld& w = wlist.at(c);
+			cchi->setO(CastUtil::fromNumber(w.getId()), w);
+		}
+		delete sqli;
+		delete cchi;
+	} catch(const std::exception& e) {
+		delete sqli;
+		delete cchi;
+		throw e;
+	}
+}
+
+void TeBkUmRouter::cachedWorlds(const char* q, int ql, std::vector<TeBkUmWorld>& wlst) {
+	int queryCount = 0;
+	strToNum(q, ql, queryCount);
+	if(queryCount<1)queryCount=1;
+	else if(queryCount>500)queryCount=500;
+
+	CacheInterface* cchi = CacheManager::getImpl();
+
+	try {
+		std::vector<std::string> keys;
+		for (int c = 0; c < queryCount; ++c) {
+			int rid = rand() % 10000 + 1;
+			keys.push_back(CastUtil::fromNumber(rid));
+		}
+
+		wlst = cchi->mgetO<TeBkUmWorld>(keys);
+		delete cchi;
+	} catch(const std::exception& e) {
+		delete cchi;
+		throw e;
+	}
+}
+
+void TeBkUmRouter::getContext(HttpRequest* request, Context* context) {
+	DataSourceInterface* sqli = DataSourceManager::getImpl();
+
+	try {
+		std::vector<TeBkUmFortune> flst = sqli->getAll<TeBkUmFortune>();
+		for(int i=0;i<(int)flst.size();i++)
+		{
+			std::string nm = flst.at(i).getMessage();
+			CryptoHandler::sanitizeHtml(nm);
+			flst.at(i).setMessage(nm);
+		}
+
+		TeBkUmFortune nf;
+		nf.setId(0);
+		nf.setMessage("Additional fortune added at request time.");
+		flst.push_back(nf);
+		std::sort (flst.begin(), flst.end());
+		delete sqli;
+
+		context->insert(std::pair<std::string, GenericObject>("fortunes", GenericObject()));
+		context->find("fortunes")->second << flst;
+	} catch(...) {
+		delete sqli;
+		throw;
+	}
+}
+
+//https://stackoverflow.com/questions/9631225/convert-strings-specified-by-length-not-nul-terminated-to-int-float
+bool TeBkUmRouter::strToNum(const char* str, int len, int& ret) {
+    ret = 0;
+    for(int i = 0; i < len; ++i)
+    {
+    	if(!isdigit(str[i])) return false;
+        ret = ret * 10 + (str[i] - '0');
+    }
+    return true;
+}
+
+void TeBkUmRouter::route(HttpRequest* req, HttpResponse* res, void* dlib, void* ddlib) {
+	Timer t;
+	t.start();
+	std::string_view path = req->getPath();
+	if(StringUtil::endsWith(path, "/fortunes")) {
+		Context ctx;
+		getContext(req, &ctx);
+
+		std::string fname = "_tebenchmarkumtpefortunestpeemittTemplateHTML";
+		void* mkr = dlsym(ddlib, fname.c_str());
+		if(mkr!=NULL)
+		{
+			TeBkUmTemplatePtr f =  (TeBkUmTemplatePtr)mkr;
+			std::string msg = f(&ctx);
+			res->setContent(msg);
+			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_SHTML);
+			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+		}
+	} else {
+		if(StringUtil::endsWith(path, "/json")) {
+			t.end();
+			CommonUtils::tsContRstLkp += t.timerNanoSeconds();
+			t.start();
+			TeBkUmMessage msg;
+			msg.setMessage(HELLO_WORLD);
+			res->setContent(JSONSerialize::serializeUnknown(&msg, 0, "TeBkUmMessage"));
+			res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+			t.end();
+			CommonUtils::tsContRstSer += t.timerNanoSeconds();
+		} else if(StringUtil::endsWith(path, "/plaintext")) {
+			t.end();
+			CommonUtils::tsContRstLkp += t.timerNanoSeconds();
+			t.start();
+			res->setContent(HELLO_WORLD);
+			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_PLAIN);
+			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+			t.end();
+			CommonUtils::tsContRstSer += t.timerNanoSeconds();
+		} else if(StringUtil::endsWith(path, "/db")) {
+			t.end();
+			CommonUtils::tsContRstLkp += t.timerNanoSeconds();
+			t.start();
+			TeBkUmWorld msg;
+			db(msg);
+			t.end();
+			CommonUtils::tsContExec += t.timerNanoSeconds();
+			t.start();
+			res->setContent(JSONSerialize::serializeUnknown(&msg, 0, "TeBkUmWorld"));
+			res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+			t.end();
+			CommonUtils::tsContRstSer += t.timerNanoSeconds();
+		} else if(StringUtil::endsWith(path, "/queries")) {
+			t.end();
+			CommonUtils::tsContRstLkp += t.timerNanoSeconds();
+			t.start();
+			struct yuarel_param params[1];
+			yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
+			std::vector<TeBkUmWorld> msg;
+			queries(params[0].val, params[0].val_len, msg);
+			t.end();
+			CommonUtils::tsContExec += t.timerNanoSeconds();
+			t.start();
+			res->setContent(JSONSerialize::serializeUnknown(&msg, 100, "std::vector<TeBkUmWorld>"));
+			res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+			t.end();
+			CommonUtils::tsContRstSer += t.timerNanoSeconds();
+		} else if(StringUtil::endsWith(path, "/updates")) {
+			t.end();
+			CommonUtils::tsContRstLkp += t.timerNanoSeconds();
+			t.start();
+			struct yuarel_param params[1];
+			yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
+			std::vector<TeBkUmWorld> msg;
+			updates(params[0].val, params[0].val_len, msg);
+			t.end();
+			CommonUtils::tsContExec += t.timerNanoSeconds();
+			t.start();
+			res->setContent(JSONSerialize::serializeUnknown(&msg, 100, "std::vector<TeBkUmWorld>"));
+			res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+			t.end();
+			CommonUtils::tsContRstSer += t.timerNanoSeconds();
+		} else if(StringUtil::endsWith(path, "/cached-worlds")) {
+			t.end();
+			CommonUtils::tsContRstLkp += t.timerNanoSeconds();
+			t.start();
+			struct yuarel_param params[1];
+			yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
+			std::vector<TeBkUmWorld> msg;
+			cachedWorlds(params[0].val, params[0].val_len, msg);
+			t.end();
+			CommonUtils::tsContExec += t.timerNanoSeconds();
+			t.start();
+			res->setContent(JSONSerialize::serializeUnknown(&msg, 100, "std::vector<TeBkUmWorld>"));
+			res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+			t.end();
+			CommonUtils::tsContRstSer += t.timerNanoSeconds();
+		} else {
+			res->setHTTPResponseStatus(HTTPResponseStatus::NotFound);
+		}
+	}
+	res->setDone(true);
+}

+ 43 - 0
frameworks/C++/ffead-cpp/te-benchmark-um/src/TeBkUmWorld.cpp

@@ -0,0 +1,43 @@
+/*
+ * TeBkUmWorld.cpp
+ *
+ *  Created on: 11-Mar-2015
+ *      Author: sumeetc
+ */
+
+#include "TeBkUmWorld.h"
+
+int TeBkUmWorld::getId() const {
+	return id;
+}
+
+void TeBkUmWorld::setId(int id) {
+	this->id = id;
+}
+
+int TeBkUmWorld::getRandomNumber() const {
+	return randomNumber;
+}
+
+void TeBkUmWorld::setRandomNumber(int randomNumber) {
+	this->randomNumber = randomNumber;
+}
+
+TeBkUmWorld::TeBkUmWorld() {
+	id = 0;
+	randomNumber = 0;
+	anotherId = 0;
+}
+
+TeBkUmWorld::~TeBkUmWorld() {
+	// TODO Auto-generated destructor stub
+}
+
+int TeBkUmWorld::getAnotherId() const {
+	return anotherId;
+}
+
+void TeBkUmWorld::setAnotherId(int anotherId) {
+	this->anotherId = anotherId;
+}
+

+ 18 - 0
frameworks/C++/ffead-cpp/te-benchmark-um/src/autotools/Makefile.am

@@ -0,0 +1,18 @@
+AUTOMAKE_OPTIONS = subdir-objects
+ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
+
+AM_CPPFLAGS=-I"../../../../include" -I"../../include"
+
+packageIdentifier=${PACKAGE_NAME}-${PACKAGE_VERSION}-bin
+distdir=${PACKAGE_NAME}-${PACKAGE_VERSION}-src
+fprefix=../../../../${packageIdentifier}
+prefix=${abs_builddir}
+
+lib_LTLIBRARIES = libte_benchmark_um.la
+libte_benchmark_la_SOURCES = ../TeBkUmWorld.cpp \
+				../TeBkUm.cpp
+
+libte_benchmark_um_la_LDFLAGS = -no-undefined 
+libte_benchmark_um_la_LIBADD = -L"${fprefix}/lib" -lffead-modules -lffead-framework
+
+#dist_noinst_SCRIPTS = autogen.sh

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark/tpe/fortunes.tpe → frameworks/C++/ffead-cpp/te-benchmark-um/tpe/fortunes.tpe

@@ -1,4 +1,4 @@
-#declare std::vector<TeBkFortune> fortunes#
+#declare std::vector<TeBkUmFortune> fortunes#
 <!DOCTYPE html>
 <html>
 <head><title>Fortunes</title></head>

+ 0 - 10
frameworks/C++/ffead-cpp/te-benchmark/CMakeLists.txt

@@ -1,10 +0,0 @@
-
-file(GLOB sources
-    "include/*.h"
-    "src/*.cpp"
-)
-
-include_directories("${CMAKE_SOURCE_DIR}/web/te-benchmark/include")
-add_library(te_benchmark SHARED ${sources})
-set_property(TARGET te_benchmark PROPERTY POSITION_INDEPENDENT_CODE ON)
-target_link_libraries(te_benchmark ffead-modules ffead-framework ${HAVE_CURLLIB} ${HAVE_SSLLIB} ${HAVE_MEMCACHEDLIB} ${HAVE_ODBCLIB} ${HAVE_MONGOCLIB} ${HAVE_BSONLIB} ${HAVE_ZLIB} ${HAVE_CRYPTOLIB})

+ 0 - 31
frameworks/C++/ffead-cpp/te-benchmark/include/TeBkFortune.h

@@ -1,31 +0,0 @@
-/*
- * TeBkFortune.h
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#ifndef TEBKFORTUNE_H_
-#define TEBKFORTUNE_H_
-#include "string"
-
-
-
-#pragma @Entity
-#pragma @Table name="fortune"
-class TeBkFortune {
-	#pragma @Id dbf="id"
-	int id;
-	#pragma @Column dbf="message"
-	std::string message;
-public:
-	TeBkFortune();
-	virtual ~TeBkFortune();
-	int getId() const;
-	void setId(int id);
-	const std::string& getMessage() const;
-	void setMessage(const std::string& message);
-	bool operator < (const TeBkFortune& other) const;
-};
-
-#endif /* TEBKFORTUNE_H_ */

+ 0 - 25
frameworks/C++/ffead-cpp/te-benchmark/include/TeBkFortuneTemplate.h

@@ -1,25 +0,0 @@
-/*
- * TeBkFortuneTemplate.h
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#ifndef TEBKFORTUNETEMPLATE_H_
-#define TEBKFORTUNETEMPLATE_H_
-#include "TemplateHandler.h"
-#include "TeBkFortune.h"
-#include "vector"
-#include "DataSourceManager.h"
-#include <stdlib.h>
-#include <algorithm>
-#include "CryptoHandler.h"
-
-#pragma @Template path="fortunes" file="fortunes.tpe"
-class TeBkFortuneTemplate {
-public:
-	virtual ~TeBkFortuneTemplate();
-	void getContext(HttpRequest* request, Context* context);
-};
-
-#endif /* TEBKFORTUNETEMPLATE_H_ */

+ 0 - 22
frameworks/C++/ffead-cpp/te-benchmark/include/TeBkMessage.h

@@ -1,22 +0,0 @@
-/*
- * TeBkMessage.h
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#ifndef TEBKMESSAGE_H_
-#define TEBKMESSAGE_H_
-#include "string"
-
-
-
-class TeBkMessage {
-	std::string message;
-public:
-	virtual ~TeBkMessage();
-	const std::string& getMessage() const;
-	void setMessage(const std::string& message);
-};
-
-#endif /* TEBKMESSAGE_H_ */

+ 0 - 52
frameworks/C++/ffead-cpp/te-benchmark/include/TeBkRestController.h

@@ -1,52 +0,0 @@
-/*
- * TeBkRestController.h
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#ifndef TEBKRESTCONTROLLER_H_
-#define TEBKRESTCONTROLLER_H_
-#include "TeBkWorld.h"
-#include "vector"
-#include "CastUtil.h"
-#include "TeBkMessage.h"
-#include "DataSourceManager.h"
-#include <stdlib.h>
-#include "CacheManager.h"
-#include "Thread.h"
-
-
-#pragma @RestController path="/"
-class TeBkRestController {
-public:
-	#pragma @GET path="/json" statusCode="200" ocontentType="application/json"
-	TeBkMessage json();
-
-	#pragma @GET path="/db" statusCode="200" ocontentType="application/json"
-	TeBkWorld db();
-
-	#pragma @GET path="/queries" statusCode="200" ocontentType="application/json"
-	std::vector<TeBkWorld> queries(
-					#pragma @QueryParam name="queries"
-					std::string queries);
-
-	#pragma @GET path="/updates" statusCode="200" ocontentType="application/json"
-	std::vector<TeBkWorld> updates(
-					#pragma @QueryParam name="queries"
-					std::string queries);
-
-	#pragma @GET path="/plaintext" statusCode="200" ocontentType="text/plain"
-	std::string plaintext();
-
-	#pragma @GET path="/cached-worlds" statusCode="200" ocontentType="application/json"
-	std::vector<TeBkWorld> cachedWorlds(
-					#pragma @QueryParam name="count"
-					std::string count);
-
-	void updateCache();
-	TeBkRestController();
-	virtual ~TeBkRestController();
-};
-
-#endif /* TEBKRESTCONTROLLER_H_ */

+ 0 - 43
frameworks/C++/ffead-cpp/te-benchmark/sql-src/TeBkWorldmongo.cpp

@@ -1,43 +0,0 @@
-/*
- * TeBkWorld.cpp
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#include "TeBkWorld.h"
-
-int TeBkWorld::getId() const {
-	return id;
-}
-
-void TeBkWorld::setId(int id) {
-	this->id = id;
-}
-
-int TeBkWorld::getRandomNumber() const {
-	return randomNumber;
-}
-
-void TeBkWorld::setRandomNumber(int randomNumber) {
-	this->randomNumber = randomNumber;
-}
-
-TeBkWorld::TeBkWorld() {
-	id = 0;
-	randomNumber = 0;
-	anotherId = 0;
-}
-
-TeBkWorld::~TeBkWorld() {
-	// TODO Auto-generated destructor stub
-}
-
-int TeBkWorld::getAnotherId() const {
-	return anotherId;
-}
-
-void TeBkWorld::setAnotherId(int anotherId) {
-	this->anotherId = anotherId;
-}
-

+ 0 - 34
frameworks/C++/ffead-cpp/te-benchmark/sql-src/TeBkWorldsql.cpp

@@ -1,34 +0,0 @@
-/*
- * TeBkWorld.cpp
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#include "TeBkWorld.h"
-
-int TeBkWorld::getId() const {
-	return id;
-}
-
-void TeBkWorld::setId(int id) {
-	this->id = id;
-}
-
-int TeBkWorld::getRandomNumber() const {
-	return randomNumber;
-}
-
-void TeBkWorld::setRandomNumber(int randomNumber) {
-	this->randomNumber = randomNumber;
-}
-
-TeBkWorld::TeBkWorld() {
-	id = 0;
-	randomNumber = 0;
-}
-
-TeBkWorld::~TeBkWorld() {
-	// TODO Auto-generated destructor stub
-}
-

+ 0 - 36
frameworks/C++/ffead-cpp/te-benchmark/src/TeBkFortune.cpp

@@ -1,36 +0,0 @@
-/*
- * TeBkFortune.cpp
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#include "TeBkFortune.h"
-
-int TeBkFortune::getId() const {
-	return id;
-}
-
-void TeBkFortune::setId(int id) {
-	this->id = id;
-}
-
-const std::string& TeBkFortune::getMessage() const {
-	return message;
-}
-
-void TeBkFortune::setMessage(const std::string& message) {
-	this->message = message;
-}
-
-TeBkFortune::TeBkFortune() {
-	id = 0;
-}
-
-TeBkFortune::~TeBkFortune() {
-	// TODO Auto-generated destructor stub
-}
-
-bool TeBkFortune::operator < (const TeBkFortune& other) const {
-	return message.compare(other.message)<0;
-}

+ 0 - 40
frameworks/C++/ffead-cpp/te-benchmark/src/TeBkFortuneTemplate.cpp

@@ -1,40 +0,0 @@
-/*
- * TeBkFortuneTemplate.cpp
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#include "TeBkFortuneTemplate.h"
-
-TeBkFortuneTemplate::~TeBkFortuneTemplate() {
-	// TODO Auto-generated destructor stub
-}
-
-void TeBkFortuneTemplate::getContext(HttpRequest* request, Context* context)
-{
-	DataSourceInterface* sqli = DataSourceManager::getImpl();
-
-	try {
-		std::vector<TeBkFortune> flst = sqli->getAll<TeBkFortune>();
-		for(int i=0;i<(int)flst.size();i++)
-		{
-			std::string nm = flst.at(i).getMessage();
-			CryptoHandler::sanitizeHtml(nm);
-			flst.at(i).setMessage(nm);
-		}
-
-		TeBkFortune nf;
-		nf.setId(0);
-		nf.setMessage("Additional fortune added at request time.");
-		flst.push_back(nf);
-		std::sort (flst.begin(), flst.end());
-		delete sqli;
-
-		context->insert(std::pair<std::string, GenericObject>("fortunes", GenericObject()));
-		context->find("fortunes")->second << flst;
-	} catch(...) {
-		delete sqli;
-		throw;
-	}
-}

+ 0 - 20
frameworks/C++/ffead-cpp/te-benchmark/src/TeBkMessage.cpp

@@ -1,20 +0,0 @@
-/*
- * TeBkMessage.cpp
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#include "TeBkMessage.h"
-
-TeBkMessage::~TeBkMessage() {
-	// TODO Auto-generated destructor stub
-}
-
-const std::string& TeBkMessage::getMessage() const {
-	return message;
-}
-
-void TeBkMessage::setMessage(const std::string& message) {
-	this->message = message;
-}

+ 0 - 162
frameworks/C++/ffead-cpp/te-benchmark/src/TeBkRestController.cpp

@@ -1,162 +0,0 @@
-/*
- * TeBkRestController.cpp
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#include "TeBkRestController.h"
-
-TeBkRestController::TeBkRestController() {
-}
-
-TeBkRestController::~TeBkRestController() {
-}
-
-TeBkMessage TeBkRestController::json() {
-	TeBkMessage msg;
-	msg.setMessage("Hello, World!");
-	return msg;
-}
-
-TeBkWorld TeBkRestController::db() {
-	DataSourceInterface* sqli = DataSourceManager::getImpl();
-	int rid = rand() % 10000 + 1;
-	GenericObject id;
-	id << rid;
-	try {
-		TeBkWorld w = sqli->get<TeBkWorld>(id);
-		delete sqli;
-		return w;
-	} catch(const std::exception& e) {
-		delete sqli;
-		throw e;
-	}
-}
-
-std::vector<TeBkWorld> TeBkRestController::queries(std::string queries) {
-	std::vector<TeBkWorld> wlst;
-	int queryCount = 1;
-	try {
-		queryCount = CastUtil::lexical_cast<int>(queries);
-	} catch(const std::exception& e) {
-	}
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
-
-	DataSourceInterface* sqli = DataSourceManager::getImpl();
-
-	try {
-		std::string tbName = "world";
-		sqli->startSession(&tbName);
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			GenericObject id;
-			id << rid;
-			TeBkWorld w = sqli->get<TeBkWorld>(id);
-			wlst.push_back(w);
-		}
-		sqli->endSession();
-		delete sqli;
-		return wlst;
-	} catch(const std::exception& e) {
-		delete sqli;
-		throw e;
-	}
-}
-
-std::vector<TeBkWorld> TeBkRestController::updates(std::string queries) {
-	std::vector<TeBkWorld> wlst;
-	int queryCount = 1;
-	try {
-		queryCount = CastUtil::lexical_cast<int>(queries);
-	} catch(const std::exception& e) {
-	}
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
-
-	DataSourceInterface* sqli = DataSourceManager::getImpl();
-
-	try {
-		std::string tbName = "world";
-		sqli->startSession(&tbName);
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			GenericObject id;
-			id << rid;
-			TeBkWorld w = sqli->get<TeBkWorld>(id);
-			int newRandomNumber = rand() % 10000 + 1;
-			if(w.getRandomNumber() == newRandomNumber) {
-				newRandomNumber -= 1;
-			}
-			w.setRandomNumber(newRandomNumber);
-			wlst.push_back(w);
-		}
-
-		sqli->startTransaction();
-		sqli->bulkUpdate<TeBkWorld>(wlst);
-		sqli->commit();
-
-		sqli->endSession();
-		delete sqli;
-		return wlst;
-	} catch(const std::exception& e) {
-		delete sqli;
-		throw e;
-	}
-}
-
-std::string TeBkRestController::plaintext() {
-	return "Hello, World!";
-}
-
-void TeBkRestController::updateCache() {
-	CacheInterface* cchi = CacheManager::getImpl();
-	DataSourceInterface* sqli = DataSourceManager::getImpl();
-
-	try {
-		std::string tbName = "world";
-		sqli->startSession(&tbName);
-		std::vector<TeBkWorld> wlist = sqli->getAll<TeBkWorld>();
-		sqli->endSession();
-		for (int c = 0; c < (int)wlist.size(); ++c) {
-			TeBkWorld& w = wlist.at(c);
-			cchi->setO(CastUtil::lexical_cast<std::string>(w.getId()), w);
-		}
-		delete sqli;
-		delete cchi;
-	} catch(const std::exception& e) {
-		delete sqli;
-		delete cchi;
-		throw e;
-	}
-}
-
-std::vector<TeBkWorld> TeBkRestController::cachedWorlds(std::string count) {
-	int queryCount = 1;
-	try {
-		queryCount = CastUtil::lexical_cast<int>(count);
-	} catch(const std::exception& e) {
-	}
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
-
-	CacheInterface* cchi = CacheManager::getImpl();
-
-	try {
-		std::vector<std::string> keys;
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			keys.push_back(CastUtil::lexical_cast<std::string>(rid));
-		}
-
-		std::vector<TeBkWorld> wlst = cchi->mgetO<TeBkWorld>(keys);
-
-		delete cchi;
-		return wlst;
-	} catch(const std::exception& e) {
-		delete cchi;
-		throw e;
-	}
-}
-

+ 0 - 43
frameworks/C++/ffead-cpp/te-benchmark/src/TeBkWorld.cpp

@@ -1,43 +0,0 @@
-/*
- * TeBkWorld.cpp
- *
- *  Created on: 11-Mar-2015
- *      Author: sumeetc
- */
-
-#include "TeBkWorld.h"
-
-int TeBkWorld::getId() const {
-	return id;
-}
-
-void TeBkWorld::setId(int id) {
-	this->id = id;
-}
-
-int TeBkWorld::getRandomNumber() const {
-	return randomNumber;
-}
-
-void TeBkWorld::setRandomNumber(int randomNumber) {
-	this->randomNumber = randomNumber;
-}
-
-TeBkWorld::TeBkWorld() {
-	id = 0;
-	randomNumber = 0;
-	anotherId = 0;
-}
-
-TeBkWorld::~TeBkWorld() {
-	// TODO Auto-generated destructor stub
-}
-
-int TeBkWorld::getAnotherId() const {
-	return anotherId;
-}
-
-void TeBkWorld::setAnotherId(int anotherId) {
-	this->anotherId = anotherId;
-}
-

+ 0 - 21
frameworks/C++/ffead-cpp/te-benchmark/src/autotools/Makefile.am

@@ -1,21 +0,0 @@
-AUTOMAKE_OPTIONS = subdir-objects
-ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
-
-AM_CPPFLAGS=-I"../../../../include" -I"../../include"
-
-packageIdentifier=${PACKAGE_NAME}-${PACKAGE_VERSION}-bin
-distdir=${PACKAGE_NAME}-${PACKAGE_VERSION}-src
-fprefix=../../../../${packageIdentifier}
-prefix=${abs_builddir}
-
-lib_LTLIBRARIES = libte_benchmark.la
-libte_benchmark_la_SOURCES = ../TeBkFortune.cpp \
-				../TeBkFortuneTemplate.cpp \
-				../TeBkMessage.cpp \
-				../TeBkRestController.cpp \
-				../TeBkWorld.cpp
-
-libte_benchmark_la_LDFLAGS = -no-undefined 
-libte_benchmark_la_LIBADD = -L"${fprefix}/lib" -lffead-modules -lffead-framework
-
-#dist_noinst_SCRIPTS = autogen.sh