Pārlūkot izejas kodu

[C++/ulib] Remove ULib (#9760)

It seems ULib isn't running anymore in the tests as all tests are tagged
as broken.
The framework also has been updated in 5 years:
https://github.com/stefanocasazza/ULib
Petrik de Heus 5 mēneši atpakaļ
vecāks
revīzija
a85fdb3132
37 mainītis faili ar 0 papildinājumiem un 2785 dzēšanām
  1. 0 134
      frameworks/C++/ulib/README.md
  2. 0 160
      frameworks/C++/ulib/benchmark_config.json
  3. 0 108
      frameworks/C++/ulib/config.toml
  4. 0 56
      frameworks/C++/ulib/src/cached_worlds.usp
  5. 0 45
      frameworks/C++/ulib/src/db.usp
  6. 0 14
      frameworks/C++/ulib/src/edb.usp
  7. 0 14
      frameworks/C++/ulib/src/equery.usp
  8. 0 28
      frameworks/C++/ulib/src/eupdate.usp
  9. 0 316
      frameworks/C++/ulib/src/fortune.h
  10. 0 67
      frameworks/C++/ulib/src/fortune.usp
  11. 0 115
      frameworks/C++/ulib/src/fortuneNoSql.h
  12. 0 52
      frameworks/C++/ulib/src/json.usp
  13. 0 14
      frameworks/C++/ulib/src/libFortune.cxx
  14. 0 8
      frameworks/C++/ulib/src/libFortuneNoSql.cxx
  15. 0 17
      frameworks/C++/ulib/src/libWorld.cxx
  16. 0 16
      frameworks/C++/ulib/src/libWorldNoSql.cxx
  17. 0 14
      frameworks/C++/ulib/src/mdb.usp
  18. 0 14
      frameworks/C++/ulib/src/mfortune.usp
  19. 0 14
      frameworks/C++/ulib/src/mquery.usp
  20. 0 14
      frameworks/C++/ulib/src/mupdate.usp
  21. 0 30
      frameworks/C++/ulib/src/plaintext.usp
  22. 0 62
      frameworks/C++/ulib/src/query.usp
  23. 0 14
      frameworks/C++/ulib/src/rdb.usp
  24. 0 14
      frameworks/C++/ulib/src/rfortune.usp
  25. 0 14
      frameworks/C++/ulib/src/rquery.usp
  26. 0 14
      frameworks/C++/ulib/src/rupdate.usp
  27. 0 99
      frameworks/C++/ulib/src/update.usp
  28. 0 368
      frameworks/C++/ulib/src/world.h
  29. 0 270
      frameworks/C++/ulib/src/worldNoSql.h
  30. 0 82
      frameworks/C++/ulib/ulib-json.dockerfile
  31. 0 82
      frameworks/C++/ulib/ulib-json_fit.dockerfile
  32. 0 91
      frameworks/C++/ulib/ulib-mongodb.dockerfile
  33. 0 87
      frameworks/C++/ulib/ulib-mysql.dockerfile
  34. 0 82
      frameworks/C++/ulib/ulib-plaintext_fit.dockerfile
  35. 0 87
      frameworks/C++/ulib/ulib-postgres.dockerfile
  36. 0 87
      frameworks/C++/ulib/ulib-postgres_fit.dockerfile
  37. 0 82
      frameworks/C++/ulib/ulib.dockerfile

+ 0 - 134
frameworks/C++/ulib/README.md

@@ -1,134 +0,0 @@
-#ULib Benchmarking Test
-
-This is the [ULib](http://stefanocasazza.github.io/ULib/) portion of a [benchmarking test suite](https://github.com/TechEmpower/FrameworkBenchmarks) comparing a variety of web development platforms.
-
-### JSON Encoding Test
-
-* [JSON test source](src/json.usp)
-
-### Data-Store/Database Mapping Test
-
-* [Database test source (SQL)](src/db.usp)
-* [Database test source (REDIS)](src/rdb.usp)
-* [Database test source (MONGODB)](src/mdb.usp)
-* [Database test source (ELASTICSEARCH)](src/edb.usp)
-
-### Variable Query Test
-
-* [Variable Query test source (SQL)](src/query.usp)
-* [Variable Query test source (REDIS)](src/rquery.usp)
-* [Variable Query test source (MONGODB)](src/mquery.usp)
-* [Variable Query test source (ELASTICSEARCH)](src/equery.usp)
-
-### Variable Query (caching) Test
-
-* [Variable Query caching test source (SQL)](src/cached_worlds.usp)
-
-### Fortune Query Test
-
-* [Fortune Query test source (SQL)](src/fortune.usp)
-* [Fortune Query test source (REDIS)](src/rfortune.usp)
-* [Fortune Query test source (MONGODB)](src/mfortune.usp)
-
-### Variable Query (update) Test
-
-* [Variable Query (update) test source (SQL)](src/update.usp)
-* [Variable Query (update) test source (REDIS)](src/rupdate.usp)
-* [Variable Query (update) test source (MONGODB)](src/mupdate.usp)
-* [Variable Query (update) test source (ELASTICSEARCH)](src/eupdate.usp)
-
-### Plaintext Test
-
-* [Plaintext test source](src/plaintext.usp)
-
-## Infrastructure Software Versions
-The tests were run with:
-
-* [ULib Version 2.4.2](https://github.com/stefanocasazza/ULib/archive/v2.4.2.tar.gz)
-
-Output
-======
-
-[/json](http://www.techempower.com/benchmarks/#section=json)
------
-```
-HTTP/1.1 200 OK
-Date: Thu, 03 Jul 2014 10:11:10 GMT
-Server: ULib 
-Content-Length: 27
-Content-Type: application/json
-
-{"message":"Hello, World!"}
-```
-
-[/db](http://www.techempower.com/benchmarks/#section=db)
----
-```
-HTTP/1.1 200 OK
-Date: Thu, 03 Jul 2014 10:14:51 GMT
-Server: ULib 
-Content-Length: 31
-Content-Type: application/json
-
-{"id":6227,"randomNumber":8489}
-```
-
-[/query?queries=10](http://www.techempower.com/benchmarks/#section=query)
--------------------
-```
-HTTP/1.1 200 OK
-Date: Thu, 03 Jul 2014 10:14:51 GMT
-Server: ULib 
-Content-Length: 320
-Content-Type: application/json
-
-[{"id":6851,"randomNumber":7598},{"id":3968,"randomNumber":7325},{"id":8159,"randomNumber":348},{"id":9560,"randomNumber":7333},{"id":9938,"randomNumber":9080},{"id":1598,"randomNumber":1623},{"id":3280,"randomNumber":8707},{"id":4521,"randomNumber":6063},{"id":8173,"randomNumber":3690},{"id":3648,"randomNumber":8803}]
-```
-
-[/cached_worlds?queries=10](http://www.techempower.com/benchmarks/#section=caching)
--------------------
-```
-HTTP/1.1 200 OK
-Date: Thu, 03 Jul 2014 10:14:51 GMT
-Server: ULib 
-Content-Length: 320
-Content-Type: application/json
-
-[{"id":6851,"randomNumber":7598},{"id":3968,"randomNumber":7325},{"id":8159,"randomNumber":348},{"id":9560,"randomNumber":7333},{"id":9938,"randomNumber":9080},{"id":1598,"randomNumber":1623},{"id":3280,"randomNumber":8707},{"id":4521,"randomNumber":6063},{"id":8173,"randomNumber":3690},{"id":3648,"randomNumber":8803}]
-```
-
-[/fortune](http://www.techempower.com/benchmarks/#section=fortune)
----------
-```
-HTTP/1.1 200 OK
-Date: Thu, 03 Jul 2014 10:14:51 GMT
-Server: ULib 
-Content-Type: text/html; charset=UTF-8
-Content-Length: 1227
-
-<!doctype html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr><tr><td>11</td><td>&lt;script&gt;alert(&quot;This should not be displayed in a browser alert box.&quot;);&lt;/script&gt;</td></tr><tr><td>4</td><td>A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1</td></tr><tr><td>5</td><td>A computer program does what you tell it to do, not what you want it to do.</td></tr><tr><td>2</td><td>A computer scientist is someone who fixes things that aren&apos;t broken.</td></tr><tr><td>8</td><td>A list is only as strong as its weakest link. — Donald Knuth</td></tr><tr><td>0</td><td>Additional fortune added at request time.</td></tr><tr><td>3</td><td>After enough decimal places, nobody gives a damn.</td></tr><tr><td>7</td><td>Any program that runs right is obsolete.</td></tr><tr><td>10</td><td>Computers make very fast, very accurate mistakes.</td></tr><tr><td>6</td><td>Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen</td></tr><tr><td>9</td><td>Feature: A bug with seniority.</td></tr><tr><td>1</td><td>fortune: No such file or directory</td></tr><tr><td>12</td><td>フレームワークのベンチマーク</td></tr></table></body></html>
-```
-
-[/update?queries=10](http://www.techempower.com/benchmarks/#section=update)
--------------------
-```
-HTTP/1.1 200 OK
-Date: Thu, 03 Jul 2014 10:14:51 GMT
-Server: ULib 
-Content-Length: 319
-Content-Type: application/json
-
-[{"id":7171,"randomNumber":351},{"id":6019,"randomNumber":9725},{"id":8118,"randomNumber":4023},{"id":7965,"randomNumber":1388},{"id":7797,"randomNumber":2249},{"id":112,"randomNumber":1108},{"id":6127,"randomNumber":4323},{"id":2597,"randomNumber":7509},{"id":2978,"randomNumber":7883},{"id":1111,"randomNumber":2228}]
-```
-
-[/plaintext](http://www.techempower.com/benchmarks/#section=plaintext)
-----------
-```
-HTTP/1.1 200 OK
-Date: Thu, 03 Jul 2014 10:14:51 GMT
-Server: ULib 
-Content-Type: text/plain
-Content-Length: 13
-
-Hello, World!
-```

+ 0 - 160
frameworks/C++/ulib/benchmark_config.json

@@ -1,160 +0,0 @@
-{
-  "framework": "ulib",
-  "tests": [{
-    "default": {
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "None",
-      "framework": "None",
-      "language": "C++",
-      "orm": "Micro",
-      "platform": "None",
-      "webserver": "ULib",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ULib",
-      "notes": "",
-      "versus": "",
-      "tags": ["broken"]
-    },
-    "plaintext_fit": {
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "None",
-      "framework": "None",
-      "language": "C++",
-      "orm": "Micro",
-      "platform": "None",
-      "webserver": "ULib",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ULib-fit",
-      "notes": "",
-      "versus": "",
-      "tags": ["broken"]
-    },
-    "json": {
-      "json_url": "/json",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "None",
-      "framework": "None",
-      "language": "C++",
-      "orm": "Micro",
-      "platform": "None",
-      "webserver": "ULib",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ULib",
-      "notes": "",
-      "versus": "",
-      "tags": ["broken"]
-    },
-    "json_fit": {
-      "json_url": "/json",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "None",
-      "framework": "None",
-      "language": "C++",
-      "orm": "Micro",
-      "platform": "None",
-      "webserver": "ULib",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ULib-fit",
-      "notes": "",
-      "versus": "",
-      "tags": ["broken"]
-    },
-    "mysql": {
-      "db_url": "/db",
-      "query_url": "/query?queries=",
-      "fortune_url": "/fortune",
-      "cached_query_url": "/cached_worlds?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "MySQL",
-      "framework": "None",
-      "language": "C++",
-      "orm": "Micro",
-      "platform": "None",
-      "webserver": "ULib",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ULib-mysql",
-      "notes": "",
-      "versus": "",
-      "tags": ["broken"]
-    },
-    "postgres": {
-      "db_url": "/db",
-      "fortune_url": "/fortune",
-      "update_url": "/update?queries=",
-      "cached_query_url": "/cached_worlds?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "Postgres",
-      "framework": "None",
-      "language": "C++",
-      "orm": "Micro",
-      "platform": "None",
-      "webserver": "ULib",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ULib-postgres",
-      "notes": "",
-      "versus": "",
-      "tags": ["broken"]
-    },
-    "postgres_fit": {
-      "db_url": "/db",
-      "fortune_url": "/fortune",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "Postgres",
-      "framework": "None",
-      "language": "C++",
-      "orm": "Micro",
-      "platform": "None",
-      "webserver": "ULib",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ULib-fit",
-      "notes": "",
-      "versus": "",
-      "tags": ["broken"]
-    },
-    "mongodb": {
-      "setup_file": "setup_mongodb",
-      "db_url": "/mdb",
-      "query_url": "/mquery?queries=",
-      "fortune_url": "/mfortune",
-      "update_url": "/mupdate?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "MongoDB",
-      "framework": "None",
-      "language": "C++",
-      "orm": "Micro",
-      "platform": "None",
-      "webserver": "ULib",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ULib-mongodb",
-      "notes": "",
-      "versus": "",
-      "tags": ["broken"]
-    }
-  }]
-}

+ 0 - 108
frameworks/C++/ulib/config.toml

@@ -1,108 +0,0 @@
-[framework]
-name = "ulib"
-
-[plaintext_fit]
-urls.plaintext = "/plaintext"
-approach = "Realistic"
-classification = "Platform"
-database = "None"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "ULib"
-versus = ""
-
-[postgres]
-urls.db = "/db"
-urls.update = "/update?queries="
-urls.fortune = "/fortune"
-urls.cached_query = "/cached_worlds?queries="
-approach = "Realistic"
-classification = "Platform"
-database = "Postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "ULib"
-versus = ""
-
-[main]
-urls.plaintext = "/plaintext"
-approach = "Realistic"
-classification = "Platform"
-database = "None"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "ULib"
-versus = ""
-
-[mongodb]
-urls.db = "/mdb"
-urls.query = "/mquery?queries="
-urls.update = "/mupdate?queries="
-urls.fortune = "/mfortune"
-approach = "Realistic"
-classification = "Platform"
-database = "MongoDB"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "ULib"
-versus = ""
-
-[json_fit]
-urls.json = "/json"
-approach = "Realistic"
-classification = "Platform"
-database = "None"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "ULib"
-versus = ""
-
-[postgres_fit]
-urls.db = "/db"
-urls.fortune = "/fortune"
-approach = "Realistic"
-classification = "Platform"
-database = "Postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "ULib"
-versus = ""
-
-[json]
-urls.json = "/json"
-approach = "Realistic"
-classification = "Platform"
-database = "None"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "ULib"
-versus = ""
-
-[mysql]
-urls.db = "/db"
-urls.query = "/query?queries="
-urls.fortune = "/fortune"
-urls.cached_query = "/cached_worlds?queries="
-approach = "Realistic"
-classification = "Platform"
-database = "MySQL"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "ULib"
-versus = ""

+ 0 - 56
frameworks/C++/ulib/src/cached_worlds.usp

@@ -1,56 +0,0 @@
-<!--#
-Test type 7: Caching
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "world.h"
-
-static UCache* cache;
-
-static void usp_init_cached_worlds()
-{
-   U_TRACE(5, "::usp_init_cached_worlds()")
-
-   UOrmSession sql_query(U_CONSTANT_TO_PARAM("hello_world"));
-
-   if (sql_query.isReady() == false)
-      {
-      U_WARNING("usp_init_cached_worlds(): we cound't connect to db");
-
-      return;
-      }
-
-   World world_query;
-   UOrmStatement stmt_query(sql_query, U_CONSTANT_TO_PARAM("SELECT * FROM World"));
-
-   stmt_query.into(world_query);
-   stmt_query.execute();
-
-   // creat and fill the cache
-
-   U_NEW(UCache, cache, UCache);
-
-   (void) cache->open(U_STRING_FROM_CONSTANT("/tmp/ULib_cached_worlds.cache"), 10000 * 64, U_NULLPTR, true);
-
-   do {
-      cache->add(world_query.id, world_query.randomNumber);
-      }
-   while (stmt_query.nextRow());
-
-   World::handlerFork();
-}
-
-static void handlerQuery(uint32_t i)
-{
-   U_TRACE(5, "::handlerQuery(%u)", i)
-
-   U_INTERNAL_ASSERT_POINTER(cache)
-
-   World::rnum = cache->getNumber(World::rnumber[i]);
-}
--->
-<!--#header
--->
-<!--#code
-World::doUpdateNoSql(handlerQuery);
--->

+ 0 - 45
frameworks/C++/ulib/src/db.usp

@@ -1,45 +0,0 @@
-<!--#
-Test type 2: Single database query
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "world.h"
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-static void handlerResult(void* res, uint32_t num_result)
-{
-   U_TRACE(5, "::handlerResult(%p,%u)", res, num_result)
-
-   U_INTERNAL_ASSERT_EQUALS(num_result, 1)
-   U_INTERNAL_ASSERT_EQUALS(PQnfields((PGresult*)res), 1)
-   U_INTERNAL_ASSERT_EQUALS(PQntuples((PGresult*)res), 1)
-
-   char* randomNumber = U_SYSCALL(PQgetvalue, "%p,%d,%d", (PGresult*)res, 0, 0);
-
-   World::handlerOneResult(ntohl(*(uint32_t*)randomNumber));
-}
-#endif
-
-static void usp_init_db() { World::handlerInitSql(); }
-static void usp_fork_db() { World::handlerForkSql(); }
--->
-<!--#header
--->
-<!--#code
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-if (World::pstmt)
-   {
-   World::sendQueryPrepared();
-
-   UServer_Base::handler_db1->handlerQuery(handlerResult);
-   }
-else
-#endif
-{
-World::pworld_query->id = World::rnumber[0];
-
-(void) World::pstmt_query->execute();
-
-World::handlerOneResult(World::pworld_query->randomNumber);
-}
--->

+ 0 - 14
frameworks/C++/ulib/src/edb.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 2: Single database query
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "worldNoSql.h"
-
-static void usp_fork_edb() { WorldNoSql::handlerForkElasticSearch(); }
--->
-<!--#header
--->
-<!--#code
-WorldNoSql::doOneQuery(WorldNoSql::handlerQueryElasticSearch);
--->

+ 0 - 14
frameworks/C++/ulib/src/equery.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 3: Multiple database queries
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "worldNoSql.h"
-
-static void usp_fork_equery() { WorldNoSql::handlerForkElasticSearch(); }
--->
-<!--#header
--->
-<!--#code
-WorldNoSql::doQuery(WorldNoSql::handlerQueryElasticSearch);
--->

+ 0 - 28
frameworks/C++/ulib/src/eupdate.usp

@@ -1,28 +0,0 @@
-<!--#
-Test type 5: Database updates
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "worldNoSql.h"
-
-static void usp_fork_eupdate()
-{
-   U_TRACE(5, "::usp_fork_eupdate()")
-
-   WorldNoSql::handlerForkElasticSearch();
-
-   if (WorldNoSql::es)
-      {
-      (void) memcpy(WorldNoSql::es_buffer1,       U_CONSTANT_TO_PARAM("/tfb/world/"));
-      WorldNoSql::pbuffer1 = WorldNoSql::es_buffer1 + U_CONSTANT_SIZE("/tfb/world/");
-
-      (void) memcpy(WorldNoSql::es_buffer2,       U_CONSTANT_TO_PARAM("{\"doc\":{\"_id\":\""));
-      WorldNoSql::pbuffer2 = WorldNoSql::es_buffer2 + U_CONSTANT_SIZE("{\"doc\":{\"_id\":\"");
-      }
-}
--->
-<!--#header
--->
-<!--#code
-World::doUpdateNoSql(WorldNoSql::handlerUpdateElasticSearch);
--->

+ 0 - 316
frameworks/C++/ulib/src/fortune.h

@@ -1,316 +0,0 @@
-// fortune.h
-
-#ifndef FORTUNE_H
-#define FORTUNE_H 1
-
-#include <ulib/orm/orm.h>
-#include <ulib/json/value.h>
-#include <ulib/utility/uhttp.h>
-#include <ulib/orm/orm_driver.h>
-#include <ulib/utility/xml_escape.h>
-#include <ulib/net/server/client_image.h>
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-#	include <ulib/event/event_db.h>
-#  include <ulib/orm/driver/orm_driver_pgsql.h>
-#endif
-
-class U_EXPORT Fortune {
-public:
-	uint32_t id;
-	UString message;
-
-	Fortune(uint32_t _id) : id(_id), message(101U)
-		{
-		U_TRACE_CTOR(5, Fortune, "%u", _id)
-		}
-
-	Fortune(uint32_t _id, const UString& _message) : id(_id), message(_message)
-		{
-		U_TRACE_CTOR(5, Fortune, "%u,%V", _id, _message.rep)
-		}
-
-	Fortune(const Fortune& f) : id(f.id), message(f.message)
-		{
-		U_TRACE_CTOR(5, Fortune, "%p", &f)
-		}
-
-	~Fortune()
-		{
-		U_TRACE_DTOR(5, Fortune)
-		}
-
-	// SERVICE
-
-	bool operator<(const Fortune& other) const { return cmp_obj(&message, &other.message); }
-
-	static int cmp_obj(const void* a, const void* b)
-		{
-		U_TRACE(5, "Fortune::cmp_obj(%p,%p)", a, b)
-
-#	ifdef U_STDCPP_ENABLE
-		/**
-		 * The comparison function must follow a strict-weak-ordering
-		 *
-		 * 1) For all x, it is not the case that x < x (irreflexivity)
-		 * 2) For all x, y, if x < y then it is not the case that y < x (asymmetry)
-		 * 3) For all x, y, and z, if x < y and y < z then x < z (transitivity)
-		 * 4) For all x, y, and z, if x is incomparable with y, and y is incomparable with z, then x is incomparable with z (transitivity of incomparability)
-		 */
-
-		return (((const Fortune*)a)->message.compare(((const Fortune*)b)->message) < 0);
-#	else
-		return (*(const Fortune**)a)->message.compare((*(const Fortune**)b)->message);
-#	endif
-		}
-
-	// JSON
-
-	void toJSON(UString& json)
-		{
-		U_TRACE(5, "Fortune::toJSON(%V)", json.rep)
-
-		json.toJSON(U_JSON_METHOD_HANDLER(id,		 unsigned int));
-		json.toJSON(U_JSON_METHOD_HANDLER(message, UString));
-		}
-
-	void fromJSON(UValue& json)
-		{
-		U_TRACE(5, "Fortune::fromJSON(%p)", &json)
-
-		json.fromJSON(U_JSON_METHOD_HANDLER(id,		unsigned int));
-		json.fromJSON(U_JSON_METHOD_HANDLER(message, UString));
-		}
-
-	// ORM
-
-	void bindParam(UOrmStatement* stmt)
-		{
-		U_TRACE(5, "Fortune::bindParam(%p)", stmt)
-
-		stmt->bindParam(U_ORM_TYPE_HANDLER(id,		  unsigned int));
-		stmt->bindParam(U_ORM_TYPE_HANDLER(message, UString));
-		}
-
-	void bindResult(UOrmStatement* stmt)
-		{
-		U_TRACE(5, "Fortune::bindResult(%p)", stmt)
-
-		stmt->bindResult(U_ORM_TYPE_HANDLER(id,		unsigned int));
-		stmt->bindResult(U_ORM_TYPE_HANDLER(message, UString));
-		}
-
-	static uint32_t uid;
-	static char* pwbuffer;
-	static UString* pmessage;
-	static UVector<Fortune*>* pvfortune;
-
-	static UOrmSession*	  psql_fortune;
-	static UOrmStatement* pstmt_fortune;
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-	static PGconn* conn;
-	static UPgSqlStatement* pstmt;
-
-	static void sendQueryPrepared()
-		{
-		U_TRACE_NO_PARAM(5, "Fortune::sendQueryPrepared()")
-
-		(void) U_SYSCALL(PQsendQueryPrepared, "%p,%S,%u,%p,%p,%p,%u", conn, pstmt->stmtName, 0, 0, 0, 0, 1);
-		}
-#endif
-
-	static void replace(uint32_t i, uint32_t _id, const char* msg, uint32_t len)
-		{
-		U_TRACE(5, "Fortune::replace(%u,%u,%.*S,%u)", i, _id, len, msg, len)
-
-		U_INTERNAL_ASSERT_POINTER(pvfortune)
-
-		Fortune* elem = pvfortune->at(i);
-
-		elem->id = _id;
-
-		UXMLEscape::encode(msg, len, elem->message);
-		}
-
-	static void replace(uint32_t i)													 { replace(i, uid, U_STRING_TO_PARAM(*pmessage)); }
-	static void replace(uint32_t i, uint32_t _id)								 { replace(i, _id, U_STRING_TO_PARAM(*pmessage)); }
-	static void replace(uint32_t i,					 const UString& message) { replace(i, i+1, U_STRING_TO_PARAM(message)); }
-	static void replace(uint32_t i, uint32_t _id, const UString& message) { replace(i, _id, U_STRING_TO_PARAM(message)); }
-
-	static void initQuery()
-		{
-		U_TRACE_NO_PARAM(5, "::initQuery()")
-
-		char* ptr = UClientImage_Base::wbuffer->data();
-
-		U_INTERNAL_DUMP("wbuffer(%u) = %#.10S", UClientImage_Base::wbuffer->size(), ptr)
-
-		if (u_get_unalignedp64(ptr+48) != U_MULTICHAR_CONSTANT64('h','a','r','s','e','t','=','U'))
-			{
-			u_put_unalignedp64(ptr,	    U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'));
-			u_put_unalignedp64(ptr+8,   U_MULTICHAR_CONSTANT64('L','e','n','g','t','h',':',' '));
-			u_put_unalignedp64(ptr+16,  U_MULTICHAR_CONSTANT64('x','x','x','x','x','x','x','x'));
-			u_put_unalignedp64(ptr+24,  U_MULTICHAR_CONSTANT64('\r','\n','C','o','n','t','e','n'));
-			u_put_unalignedp64(ptr+32,  U_MULTICHAR_CONSTANT64('t','-','T','y','p','e',':',' '));
-			u_put_unalignedp64(ptr+40,  U_MULTICHAR_CONSTANT64('t','e','x','t','/','h','t','m'));
-			u_put_unalignedp64(ptr+48,  U_MULTICHAR_CONSTANT64('l',';',' ','c','h','a','r','s'));
-			u_put_unalignedp64(ptr+56,  U_MULTICHAR_CONSTANT64('e','t','=','U','T','F','-','8'));
-			u_put_unalignedp64(ptr+64,  U_MULTICHAR_CONSTANT64('\r','\n','\r','\n','<','!','d','o'));
-			u_put_unalignedp64(ptr+72,  U_MULTICHAR_CONSTANT64('c','t','y','p','e',' ','h','t'));
-			u_put_unalignedp64(ptr+80,  U_MULTICHAR_CONSTANT64('m','l','>','<','h','t','m','l'));
-			u_put_unalignedp64(ptr+88,  U_MULTICHAR_CONSTANT64('>','<','h','e','a','d','>','<'));
-			u_put_unalignedp64(ptr+96,  U_MULTICHAR_CONSTANT64('t','i','t','l','e','>','F','o'));
-			u_put_unalignedp64(ptr+104, U_MULTICHAR_CONSTANT64('r','t','u','n','e','s','<','/'));
-			u_put_unalignedp64(ptr+112, U_MULTICHAR_CONSTANT64('t','i','t','l','e','>','<','/'));
-			u_put_unalignedp64(ptr+120, U_MULTICHAR_CONSTANT64('h','e','a','d','>','<','b','o'));
-			u_put_unalignedp64(ptr+128, U_MULTICHAR_CONSTANT64('d','y','>','<','t','a','b','l'));
-			u_put_unalignedp64(ptr+136, U_MULTICHAR_CONSTANT64('e','>','<','t','r','>','<','t'));
-			u_put_unalignedp64(ptr+144, U_MULTICHAR_CONSTANT64('h','>','i','d','<','/','t','h'));
-			u_put_unalignedp64(ptr+152, U_MULTICHAR_CONSTANT64('>','<','t','h','>','m','e','s'));
-			u_put_unalignedp64(ptr+160, U_MULTICHAR_CONSTANT64('s','a','g','e','<','/','t','h'));
-			u_put_unalignedp64(ptr+168, U_MULTICHAR_CONSTANT64('>','<','/','t','r','>','\0','\0'));
-
-			pwbuffer	= ptr + U_CONSTANT_SIZE("Content-Length: xxxxxxxx\r\nContent-Type: text/html; charset=UTF-8\r\n\r\n"
-														"<!doctype html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>");
-			}
-
-		U_INTERNAL_ASSERT_EQUALS(u_get_unalignedp64(UClientImage_Base::wbuffer->data()), U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'))
-		}
-
-	static void endQuery()
-		{
-		U_TRACE_NO_PARAM(5, "::endQuery()")
-
-		U_INTERNAL_ASSERT_POINTER(pvfortune)
-
-		Fortune* elem = pvfortune->last();
-
-		elem->id = 0;
-		elem->message.rep->replace(U_CONSTANT_TO_PARAM("Additional fortune added at request time."));
-
-		pvfortune->sort(Fortune::cmp_obj);
-
-		char* ptr = pwbuffer;
-		uint32_t content_length = U_CONSTANT_SIZE("<!doctype html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>");
-
-		for (uint32_t sz, i = 0, n = pvfortune->size(); i < n; ++i)
-			{
-			elem = pvfortune->at(i);
-
-			u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64('<','t','r','>','<','t','d','>'));
-
-			ptr = u_num2str32(elem->id, ptr+8);
-
-			u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','t','d'));
-									 ptr += 8;
-
-			*ptr++ = '>';
-
-			(void) memcpy(ptr, elem->message.data(), sz = elem->message.size());
-							  ptr += sz;
-
-			u_put_unalignedp64(ptr,   U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','/','t'));
-			u_put_unalignedp16(ptr+8, U_MULTICHAR_CONSTANT16('r','>'));
-									 ptr += 8+2;
-			}
-
-		u_put_unalignedp64(ptr,    U_MULTICHAR_CONSTANT64('<','/','t','a','b','l','e','>'));
-		u_put_unalignedp64(ptr+8,  U_MULTICHAR_CONSTANT64('<','/','b','o','d','y','>','<'));
-		u_put_unalignedp64(ptr+16, U_MULTICHAR_CONSTANT64('/','h','t','m','l','>','\0','\0'));
-
-		content_length += (ptr - pwbuffer) + U_CONSTANT_SIZE("</table></body></html>");
-
-		ptr = pwbuffer	- U_CONSTANT_SIZE("xxxxxxxx\r\nContent-Type: text/html; charset=UTF-8\r\n\r\n"
-													"<!doctype html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>");
-
-		u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64(' ',' ',' ',' ',' ',' ',' ',' '));
-
-		(void) u_num2str32(content_length, ptr);
-
-		UClientImage_Base::wbuffer->size_adjust_constant(U_CONSTANT_SIZE("Content-Length: xxxxxxxx\r\nContent-Type: text/html; charset=UTF-8\r\n\r\n") + content_length);
-		}
-
-	static void doQuery(vPF handlerQuery)
-		{
-		U_TRACE(5, "Fortune::doQuery(%p)", handlerQuery)
-
-			initQuery();
-		handlerQuery();
-			 endQuery();
-		}
-
-	static void handlerInitSql()
-		{
-		U_TRACE_NO_PARAM(5, "Fortune::handlerInitSql()")
-
-#	ifdef U_STATIC_ORM_DRIVER_PGSQL
-		U_INTERNAL_DUMP("UServer_Base::handler_db2 = %p", UServer_Base::handler_db2)
-
-		if (UServer_Base::handler_db2 == U_NULLPTR) UServer_Base::handler_db2 = new UEventDB();
-#	endif
-		}
-
-	static void handlerFork()
-		{
-		U_TRACE_NO_PARAM(5, "Fortune::handlerFork()")
-
-		pmessage = new UString(101U);
-
-		pvfortune = new UVector<Fortune*>();
-
-		Fortune* elem;
-
-		for (uint32_t i = 0; i < 13; ++i)
-			{
-			elem = new Fortune(i+1);
-
-			pvfortune->push(elem);
-			}
-		}
-
-	static void handlerForkSql()
-		{
-		U_TRACE_NO_PARAM(5, "Fortune::handlerForkSql()")
-
-		if (psql_fortune == U_NULLPTR)
-			{
-			psql_fortune = new UOrmSession(U_CONSTANT_TO_PARAM("fortune"));
-
-			if (psql_fortune->isReady() == false)
-				{
-				U_WARNING("Fortune::handlerForkSql(): we cound't connect to db");
-
-				U_DELETE(psql_fortune)
-
-				psql_fortune = U_NULLPTR;
-
-				return;
-				}
-
-			pstmt_fortune = new UOrmStatement(*psql_fortune, U_CONSTANT_TO_PARAM("SELECT id, message FROM Fortune"));
-
-			handlerFork();
-
-			pstmt_fortune->into(uid, *pmessage);
-
-#		ifdef U_STATIC_ORM_DRIVER_PGSQL
-			if (UOrmDriver::isPGSQL())
-				{
-				UOrmDriverPgSql* pdrv = (UOrmDriverPgSql*)psql_fortune->getDriver();
-
-				 conn = (PGconn*)pdrv->UOrmDriver::connection;
-				pstmt = (UPgSqlStatement*)pstmt_fortune->getStatement();
-
-				pstmt->prepareStatement(pdrv);
-
-				UServer_Base::handler_db2->setConnection(conn);
-				}
-#		endif
-			}
-		}
-
-private:
-	U_DISALLOW_ASSIGN(Fortune)
-};
-#endif

+ 0 - 67
frameworks/C++/ulib/src/fortune.usp

@@ -1,67 +0,0 @@
-<!--#
-Test type 4: Fortunes
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "fortune.h"
-
-static void handlerQuery()
-{
-   U_TRACE_NO_PARAM(5, "::handlerQuery()")
-
-   uint32_t i = 0;
-
-   Fortune::pstmt_fortune->execute();
-
-   do {
-      Fortune::replace(i++);
-      }
-   while (Fortune::pstmt_fortune->nextRow());
-}
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-static void handlerResult(void* res, uint32_t num_result)
-{
-   U_TRACE(5, "::handlerResult(%p,%u)", res, num_result)
-
-   U_INTERNAL_ASSERT_EQUALS(num_result, 1)
-   U_INTERNAL_ASSERT_EQUALS(PQnfields((PGresult*)res), 2)
-
-   int sz;
-   char* id;
-   char* ptr;
-
-   Fortune::initQuery();
-
-   for (uint32_t i = 0, n = U_SYSCALL(PQntuples, "%p", (PGresult*)res); i < n; ++i)
-      {
-       id = U_SYSCALL(PQgetvalue,  "%p,%d,%d", (PGresult*)res, i, 0);
-      ptr = U_SYSCALL(PQgetvalue,  "%p,%d,%d", (PGresult*)res, i, 1);
-      sz  = U_SYSCALL(PQgetlength, "%p,%d,%d", (PGresult*)res, i, 1);
-
-      Fortune::replace(i, ntohl(*(uint32_t*)id), ptr, sz);
-      }
-
-   Fortune::endQuery();
-}
-#endif
-
-static void usp_init_fortune() { Fortune::handlerInitSql(); }
-static void usp_fork_fortune() { Fortune::handlerForkSql(); }
--->
-<!--#header
--->
-<!--#code
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-if (Fortune::pstmt)
-   {
-   Fortune::sendQueryPrepared();
-
-   UServer_Base::handler_db2->handlerQuery(handlerResult);
-   }
-else
-#endif
-{
-Fortune::doQuery(handlerQuery);
-}
--->

+ 0 - 115
frameworks/C++/ulib/src/fortuneNoSql.h

@@ -1,115 +0,0 @@
-// fortuneNoSql.h
-
-#ifndef FORTUNE_NO_SQL_H
-#define FORTUNE_NO_SQL_H 1
-
-#include "fortune.h"
-
-#include <ulib/net/client/redis.h>
-#include <ulib/net/client/elasticsearch.h>
-
-#ifdef USE_MONGODB
-#  include <ulib/net/client/mongodb.h>
-#endif
-
-class U_EXPORT FortuneNoSql {
-public:
-
-#ifdef USE_MONGODB
-	static UMongoDBClient* mc;
-#endif
-
-	static void handlerQueryMongoDB()
-		{
-		U_TRACE(5, "FortuneNoSql::handlerQueryMongoDB()")
-
-		U_INTERNAL_ASSERT_POINTER(Fortune::pmessage)
-
-#	ifdef USE_MONGODB
-		(void) mc->findAll();
-
-		for (uint32_t i = 0, n = mc->vitem.size(); i < n; ++i)
-			{
-			(void) U_JFIND(mc->vitem[i], "message", *Fortune::pmessage);
-
-			Fortune::replace(i, i+1);
-
-			Fortune::pmessage->clear();
-			}
-#	endif
-		}
-
-	static void handlerForkMongoDB()
-		{
-		U_TRACE_NO_PARAM(5, "FortuneNoSql::handlerForkMongoDB()")
-
-#	ifdef USE_MONGODB
-		if (mc == U_NULLPTR)
-			{
-			U_NEW(UMongoDBClient, mc, UMongoDBClient);
-
-			if (mc->connect(U_NULLPTR, 0) == false)
-				{
-				U_WARNING("FortuneNoSql::handlerForkMongoDB(): connection failed");
-
-				U_DELETE(mc)
-
-				mc = U_NULLPTR;
-
-				return;
-				}
-
-			if (mc->selectCollection("hello_world", "fortune") == false)
-				{
-				U_WARNING("FortuneNoSql::handlerForkMongoDB(): selectCollection() failed");
-
-				U_DELETE(mc)
-
-				mc = U_NULLPTR;
-
-				return;
-				}
-
-			Fortune::handlerFork();
-			}
-#	endif
-		}
-
-	static UREDISClient_Base* rc;
-
-	static void handlerQueryREDIS()
-		{
-		U_TRACE(5, "FortuneNoSql::handlerQueryREDIS()")
-
-		(void) rc->lrange(U_CONSTANT_TO_PARAM("fortunes 0 -1"));
-
-		for (uint32_t i = 0, n = rc->vitem.size(); i < n; ++i) Fortune::replace(i, rc->vitem[i]);
-		}
-
-	static void handlerForkREDIS()
-		{
-		U_TRACE_NO_PARAM(5, "Fortune::handlerForkREDIS()")
-
-		if (rc == U_NULLPTR)
-			{
-			U_NEW(UREDISClient<UTCPSocket>, rc, UREDISClient<UTCPSocket>);
-
-			if (rc->connect() == false)
-				{
-				U_WARNING("FortuneNoSql::handlerForkREDIS(): %V", rc->UClient_Base::getResponse().rep);
-
-				U_DELETE(rc)
-
-				rc = U_NULLPTR;
-
-				return;
-				}
-
-			Fortune::handlerFork();
-			}
-		}
-
-private:
-	U_DISALLOW_ASSIGN(FortuneNoSql)
-};
-#endif

+ 0 - 52
frameworks/C++/ulib/src/json.usp

@@ -1,52 +0,0 @@
-<!--#
-Test type 1: JSON serialization
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-static char* ptr;
-static UString* pkey;
-static UString* pvalue;
-
-static void usp_init_json()
-{
-   U_TRACE(5, "::usp_init_json()")
-
-   U_NEW_STRING(pkey,   UString(U_CONSTANT_TO_PARAM("message")));
-   U_NEW_STRING(pvalue, UString(U_CONSTANT_TO_PARAM("Hello, World!")));
-}
--->
-<!--#header
--->
-<!--#code
-char* pwbuffer = UClientImage_Base::wbuffer->data();
-
-U_INTERNAL_DUMP("pwbuffer = %#.10S", pwbuffer)
-
-if (u_get_unalignedp64(pwbuffer+44) != U_MULTICHAR_CONSTANT64('n','/','j','s','o','n','\r','\n'))
-   {
-   u_put_unalignedp64(pwbuffer,    U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'));
-   u_put_unalignedp64(pwbuffer+8,  U_MULTICHAR_CONSTANT64('L','e','n','g','t','h',':',' '));
-   u_put_unalignedp32(pwbuffer+16, U_MULTICHAR_CONSTANT32('x','x','\r','\n'));
-   u_put_unalignedp64(pwbuffer+20, U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'));
-   u_put_unalignedp64(pwbuffer+28, U_MULTICHAR_CONSTANT64('T','y','p','e',':',' ','a','p'));
-   u_put_unalignedp64(pwbuffer+36, U_MULTICHAR_CONSTANT64('p','l','i','c','a','t','i','o'));
-   u_put_unalignedp64(pwbuffer+44, U_MULTICHAR_CONSTANT64('n','/','j','s','o','n','\r','\n'));
-   u_put_unalignedp16(pwbuffer+52, U_MULTICHAR_CONSTANT16('\r','\n'));
-
-   ptr = pwbuffer + U_CONSTANT_SIZE("Content-Length: xx\r\nContent-Type: application/json\r\n\r\n");
-   }
-
-U_INTERNAL_ASSERT_EQUALS(u_get_unalignedp64(UClientImage_Base::wbuffer->data()), U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'))
-
-UValue::pstringify = ptr;
-
-UValue(*pkey, *pvalue).stringify();
-
-uint32_t content_length = (UValue::pstringify - ptr);
-
-U_INTERNAL_ASSERT_EQUALS(content_length, 27)
-
-(void) u_num2str32(content_length, ptr - U_CONSTANT_SIZE("xx\r\nContent-Type: application/json\r\n\r\n"));
-
-UClientImage_Base::wbuffer->size_adjust_constant(U_CONSTANT_SIZE("Content-Length: xx\r\nContent-Type: application/json\r\n\r\n") + content_length);
--->

+ 0 - 14
frameworks/C++/ulib/src/libFortune.cxx

@@ -1,14 +0,0 @@
-// fortune.cpp
-
-#include "fortune.h"
-
-char*					 Fortune::pwbuffer;
-uint32_t				 Fortune::uid;
-UString*				 Fortune::pmessage;
-UOrmSession*		 Fortune::psql_fortune;
-UOrmStatement*		 Fortune::pstmt_fortune;
-UVector<Fortune*>* Fortune::pvfortune;
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-PGconn*				 Fortune::conn;
-UPgSqlStatement*	 Fortune::pstmt;
-#endif

+ 0 - 8
frameworks/C++/ulib/src/libFortuneNoSql.cxx

@@ -1,8 +0,0 @@
-// fortuneNoSql.cpp
-
-#include "fortuneNoSql.h"
-
-#ifdef USE_MONGODB
-UMongoDBClient*	 FortuneNoSql::mc;
-#endif
-UREDISClient_Base* FortuneNoSql::rc;

+ 0 - 17
frameworks/C++/ulib/src/libWorld.cxx

@@ -1,17 +0,0 @@
-// world.cpp
-
-#include "world.h"
-
-char				  World::wbuffer[18000];
-char*				  World::ptr;
-char*				  World::pwbuffer;
-World*			  World::pworld_query;
-uint32_t			  World::rnum;
-uint32_t			  World::rnumber[501];
-UOrmSession*	  World::psql_query;
-UOrmStatement*	  World::pstmt_query;
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-char				  World::num2str[sizeof(unsigned int)];
-PGconn*			  World::conn;
-UPgSqlStatement* World::pstmt;
-#endif

+ 0 - 16
frameworks/C++/ulib/src/libWorldNoSql.cxx

@@ -1,16 +0,0 @@
-// worldNoSql.cpp
-
-#include "worldNoSql.h"
-
-#ifdef USE_MONGODB
-bson_t*					 WorldNoSql::query;
-UMongoDBClient*		 WorldNoSql::mc;
-#endif
-char						 WorldNoSql::rc_buffer[128];
-char						 WorldNoSql::es_buffer1[128];
-char						 WorldNoSql::es_buffer2[128];
-char*						 WorldNoSql::pbuffer1;
-char*						 WorldNoSql::pbuffer2;
-UString*					 WorldNoSql::str_rnumber;
-UREDISClient_Base*	 WorldNoSql::rc;
-UElasticSearchClient* WorldNoSql::es;

+ 0 - 14
frameworks/C++/ulib/src/mdb.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 2: Single database query
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "worldNoSql.h"
-
-static void usp_fork_mdb() { WorldNoSql::handlerForkMongoDB(); }
--->
-<!--#header
--->
-<!--#code
-WorldNoSql::doOneQuery(WorldNoSql::handlerQueryMongoDB);
--->

+ 0 - 14
frameworks/C++/ulib/src/mfortune.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 4: Fortunes
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "fortuneNoSql.h"
-
-static void usp_fork_mfortune() { FortuneNoSql::handlerForkMongoDB(); }
--->
-<!--#header
--->
-<!--#code
-Fortune::doQuery(FortuneNoSql::handlerQueryMongoDB);
--->

+ 0 - 14
frameworks/C++/ulib/src/mquery.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 3: Multiple database queries
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "worldNoSql.h"
-
-static void usp_fork_mquery() { WorldNoSql::handlerForkMongoDB(); }
--->
-<!--#header
--->
-<!--#code
-WorldNoSql::doQuery(WorldNoSql::handlerQueryMongoDB);
--->

+ 0 - 14
frameworks/C++/ulib/src/mupdate.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 5: Database updates
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "worldNoSql.h"
-
-static void usp_fork_mupdate() { WorldNoSql::handlerForkMongoDB(); }
--->
-<!--#header
--->
-<!--#code
-World::doUpdateNoSql(WorldNoSql::handlerUpdateMongoDB);
--->

+ 0 - 30
frameworks/C++/ulib/src/plaintext.usp

@@ -1,30 +0,0 @@
-<!--#declaration
-static char* ptr;
--->
-<!--#header
--->
-<!--#code
-char* pwbuffer = UClientImage_Base::wbuffer->data();
-
-U_INTERNAL_DUMP("pwbuffer = %#.10S", pwbuffer)
-
-if (u_get_unalignedp64(pwbuffer+36) != U_MULTICHAR_CONSTANT64('x','t','/','p','l','a','i','n'))
-   {
-   u_put_unalignedp64(pwbuffer,    U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'));
-   u_put_unalignedp64(pwbuffer+8,  U_MULTICHAR_CONSTANT64('L','e','n','g','t','h',':',' '));
-   u_put_unalignedp32(pwbuffer+16, U_MULTICHAR_CONSTANT32('1','3','\r','\n'));
-   u_put_unalignedp64(pwbuffer+20, U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'));
-   u_put_unalignedp64(pwbuffer+28, U_MULTICHAR_CONSTANT64('T','y','p','e',':',' ','t','e'));
-   u_put_unalignedp64(pwbuffer+36, U_MULTICHAR_CONSTANT64('x','t','/','p','l','a','i','n'));
-   u_put_unalignedp32(pwbuffer+44, U_MULTICHAR_CONSTANT32('\r','\n','\r','\n'));
-
-   ptr = pwbuffer + U_CONSTANT_SIZE("Content-Length: 13\r\nContent-Type: text/plain\r\n\r\n");
-   }
-
-U_INTERNAL_ASSERT_EQUALS(u_get_unalignedp64(UClientImage_Base::wbuffer->data()), U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'))
-
-u_put_unalignedp64(ptr,   U_MULTICHAR_CONSTANT64('H','e','l','l','o',',',' ','W'));
-u_put_unalignedp64(ptr+8, U_MULTICHAR_CONSTANT64('o','r','l','d','!','\0','\0','\0'));
-
-UClientImage_Base::wbuffer->size_adjust_constant(U_CONSTANT_SIZE("Content-Length: 13\r\nContent-Type: text/plain\r\n\r\n") + 13);
--->

+ 0 - 62
frameworks/C++/ulib/src/query.usp

@@ -1,62 +0,0 @@
-<!--#
-Test type 3: Multiple database queries
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "world.h"
-
-static uint32_t num_queries;
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-static void handlerResult(void* res, uint32_t num_result)
-{
-   U_TRACE(5, "::handlerResult(%p,%u)", res, num_result)
-
-   U_INTERNAL_ASSERT_EQUALS(PQnfields((PGresult*)res), 1)
-   U_INTERNAL_ASSERT_EQUALS(PQntuples((PGresult*)res), 1)
-
-   char* randomNumber = U_SYSCALL(PQgetvalue, "%p,%d,%d", (PGresult*)res, 0, 0);
-
-   if (num_result == 1) World::initResult();
-   else                 World::addResult(num_result);
-
-   World::addRandom(ntohl(*(uint32_t*)randomNumber));
-
-   if (num_result == num_queries) World::endResult();
-}
-#endif
-
-static void usp_init_query() { World::handlerInitSql(); }
-static void usp_fork_query() { World::handlerForkSql(); }
--->
-<!--#header
--->
-<!--#code
-uint32_t i = 0;
-
-num_queries = UHTTP::getFormFirstNumericValue(1, 500);
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-if (World::pstmt)
-   {
-   while (i < num_queries) World::sendQueryPrepared(i++);
-
-   UServer_Base::handler_db1->handlerQuery(handlerResult, num_queries);
-   }
-else
-#endif
-{
-World::initResult();
-
-for (; i < num_queries; ++i)
-   {
-   World::pworld_query->id = World::rnumber[i];
-
-   World::pstmt_query->execute();
-
-   World::handlerResult(i, World::pworld_query->randomNumber);
-   }
-
-World::endResult();
-}
--->

+ 0 - 14
frameworks/C++/ulib/src/rdb.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 2: Single database query
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "worldNoSql.h"
-
-static void usp_fork_rdb() { WorldNoSql::handlerForkREDIS(); }
--->
-<!--#header
--->
-<!--#code
-WorldNoSql::doOneQuery(WorldNoSql::handlerQueryREDIS);
--->

+ 0 - 14
frameworks/C++/ulib/src/rfortune.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 4: Fortunes
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "fortuneNoSql.h"
-
-static void usp_fork_rfortune() { FortuneNoSql::handlerForkREDIS(); }
--->
-<!--#header
--->
-<!--#code
-Fortune::doQuery(FortuneNoSql::handlerQueryREDIS);
--->

+ 0 - 14
frameworks/C++/ulib/src/rquery.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 3: Multiple database queries
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "worldNoSql.h"
-
-static void usp_fork_rquery() { WorldNoSql::handlerForkREDIS(); }
--->
-<!--#header
--->
-<!--#code
-WorldNoSql::doQuery(WorldNoSql::handlerQueryREDIS);
--->

+ 0 - 14
frameworks/C++/ulib/src/rupdate.usp

@@ -1,14 +0,0 @@
-<!--#
-Test type 5: Database updates
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "worldNoSql.h"
-
-static void usp_fork_rupdate() { WorldNoSql::handlerForkREDIS(); }
--->
-<!--#header
--->
-<!--#code
-World::doUpdateNoSql(WorldNoSql::handlerUpdateREDIS);
--->

+ 0 - 99
frameworks/C++/ulib/src/update.usp

@@ -1,99 +0,0 @@
-<!--#
-Test type 5: Database updates
-TechEmpower Web Framework Benchmarks
--->
-<!--#declaration
-#include "world.h"
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-static char query[8192];
-
-static void handlerResult(void* res, uint32_t num_result)
-{
-   U_TRACE(5, "::handlerResult(%p,%u)", res, num_result)
-
-   U_INTERNAL_ASSERT_EQUALS(PQnfields((PGresult*)res), 1)
-   U_INTERNAL_ASSERT_EQUALS(PQntuples((PGresult*)res), 1)
-
-   (void) U_SYSCALL(PQgetvalue, "%p,%d,%d", (PGresult*)res, 0, 0);
-}
-#endif
-
-static UOrmStatement* pstmt_update;
-
-static void usp_init_update() { World::handlerInitSql(); }
-static void usp_fork_update()
-{
-   U_TRACE(5, "::usp_fork_update()")
-
-   World::handlerForkSql();
-
-   if (World::psql_query)
-      {
-#  ifdef U_STATIC_ORM_DRIVER_PGSQL
-      if (World::pstmt) (void) memcpy(query, U_CONSTANT_TO_PARAM("UPDATE World SET randomNumber = v.randomNumber FROM (VALUES"));
-      else
-#  endif
-      {
-      U_NEW(UOrmStatement, pstmt_update, UOrmStatement(*World::psql_query, U_CONSTANT_TO_PARAM("UPDATE World SET randomNumber = ? WHERE id = ?")));
-
-      pstmt_update->use(World::pworld_query->randomNumber, World::pworld_query->id);
-      }
-      }
-}
--->
-<!--#header
--->
-<!--#code
-uint32_t i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
-
-World::initResult();
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-if (World::pstmt)
-   {
-   char* pquery = query + U_CONSTANT_SIZE("UPDATE World SET randomNumber = v.randomNumber FROM (VALUES");
-
-   for (; i < num_queries; ++i)
-      {
-      World::sendQueryPrepared(i);
-
-      *pquery = '(';
-       pquery = u_num2str32(World::rnumber[i], pquery+1);
-      *pquery = ',';
-       pquery = u_num2str32(World::rnum = u_get_num_random_range1(10000), pquery+1);
-
-      u_put_unalignedp16(pquery, U_MULTICHAR_CONSTANT16(')',','));
-                         pquery += 2;
-
-      World::handlerResult(i, World::rnum);
-      }
-
-   World::endResult();
-
-   (void) memcpy(pquery-1, ") AS v (id,randomNumber) WHERE World.id = v.id;",
-           U_CONSTANT_SIZE(") AS v (id,randomNumber) WHERE World.id = v.id;")+1);
-
-   (void) U_SYSCALL(PQsendQueryParams, "%p,%S,%u,%p,%p,%p,%p,%u", World::conn, query, 0, 0, 0, 0, 0, 1);
-
-   UServer_Base::handler_db1->handlerQuery(handlerResult, num_queries);
-   }
-else
-#endif
-{
-for (; i < num_queries; ++i)
-   {
-   World::pworld_query->id = World::rnumber[i];
-
-   World::pstmt_query->execute();
-
-   World::pworld_query->randomNumber = u_get_num_random_range1(10000);
-
-   pstmt_update->execute();
-
-   World::handlerResult(i, World::pworld_query->randomNumber);
-   }
-
-World::endResult();
-}
--->

+ 0 - 368
frameworks/C++/ulib/src/world.h

@@ -1,368 +0,0 @@
-// world.h
-
-#ifndef WORLD_H
-#define WORLD_H 1
-
-#include <ulib/orm/orm.h>
-#include <ulib/json/value.h>
-#include <ulib/utility/uhttp.h>
-#include <ulib/orm/orm_driver.h>
-#include <ulib/net/server/client_image.h>
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-#	include <ulib/event/event_db.h>
-#  include <ulib/orm/driver/orm_driver_pgsql.h>
-#endif
-
-class U_EXPORT World {
-public:
-	uint32_t id, randomNumber;
-
-	World()
-		{
-		U_TRACE_CTOR(5, World, "")
-
-		// coverity[uninit_ctor]
-#	ifdef U_COVERITY_FALSE_POSITIVE
-		id = randomNumber = 0;
-#	endif
-		}
-
-	World(uint32_t _id, uint32_t _randomNumber) : id(_id), randomNumber(_randomNumber)
-		{
-		U_TRACE_CTOR(5, World, "%u,%u", _id, _randomNumber)
-		}
-
-	World(const World& w) : id(w.id), randomNumber(w.randomNumber)
-		{
-		U_TRACE_CTOR(5, World, "%p", &w)
-
-		U_MEMORY_TEST_COPY(w)
-		}
-
-	~World()
-		{
-		U_TRACE_DTOR(5, World)
-		}
-
-	// JSON
-
-	void toJSON(UString& json)
-		{
-		U_TRACE(5, "World::toJSON(%V)", json.rep)
-
-		json.toJSON(U_JSON_METHOD_HANDLER(id,				unsigned int));
-		json.toJSON(U_JSON_METHOD_HANDLER(randomNumber,	unsigned int));
-		}
-
-	void fromJSON(UValue& json)
-		{
-		U_TRACE(5, "World::fromJSON(%p)", &json)
-
-		json.fromJSON(U_JSON_METHOD_HANDLER(id,			  unsigned int));
-		json.fromJSON(U_JSON_METHOD_HANDLER(randomNumber, unsigned int));
-		}
-
-	// ORM
-
-	void bindParam(UOrmStatement* stmt)
-		{
-		U_TRACE(5, "World::bindParam(%p)", stmt)
-
-		stmt->bindParam(U_ORM_TYPE_HANDLER(id,				 unsigned int));
-		stmt->bindParam(U_ORM_TYPE_HANDLER(randomNumber, unsigned int));
-		}
-
-	void bindResult(UOrmStatement* stmt)
-		{
-		U_TRACE(5, "World::bindResult(%p)", stmt)
-
-		stmt->bindResult(U_ORM_TYPE_HANDLER(id,			  unsigned int));
-		stmt->bindResult(U_ORM_TYPE_HANDLER(randomNumber, unsigned int));
-		}
-
-	// SERVICE
-
-	bool operator<(const World& other) const { return cmp_obj(&id, &other.id); }
-
-	static int cmp_obj(const void* a, const void* b)
-		{
-		U_TRACE(5, "World::cmp_obj(%p,%p)", a, b)
-
-#	ifdef U_STDCPP_ENABLE
-		/**
-		 * The comparison function must follow a strict-weak-ordering
-		 *
-		 * 1) For all x, it is not the case that x < x (irreflexivity)
-		 * 2) For all x, y, if x < y then it is not the case that y < x (asymmetry)
-		 * 3) For all x, y, and z, if x < y and y < z then x < z (transitivity)
-		 * 4) For all x, y, and z, if x is incomparable with y, and y is incomparable with z, then x is incomparable with z (transitivity of incomparability)
-		 */
-
-		return (((const World*)a)->id < (((const World*)b)->id));
-#	else
-		return (*(const World**)a)->id < ((*(const World**)b)->id);
-#	endif
-		}
-
-	static char* ptr;
-	static char* pwbuffer;
-	static char wbuffer[18000];
-	static uint32_t rnum, rnumber[501];
-
-	static World*        pworld_query;
-	static UOrmSession*	  psql_query;
-	static UOrmStatement* pstmt_query;
-
-#ifdef U_STATIC_ORM_DRIVER_PGSQL
-	static PGconn* conn;
-	static UPgSqlStatement* pstmt;
-	static char num2str[sizeof(unsigned int)];
-
-	static void _sendQueryPrepared()
-		{
-		U_TRACE_NO_PARAM(5, "World::_sendQueryPrepared()")
-
-		(void) U_SYSCALL(PQsendQueryPrepared, "%p,%S,%u,%p,%p,%p,%u", conn, pstmt->stmtName, 1, pstmt->paramValues, pstmt->paramLengths, pstmt->paramFormats, 1);
-		}
-
-	static void sendQueryPrepared()
-		{
-		U_TRACE_NO_PARAM(5, "World::sendQueryPrepared()")
-
-		U_INTERNAL_ASSERT_MAJOR(rnumber[0], 0)
-
-		*(unsigned int*)num2str = htonl(rnumber[0]);
-
-		_sendQueryPrepared();
-		}
-
-	static void sendQueryPrepared(uint32_t i)
-		{
-		U_TRACE(5, "World::sendQueryPrepared(%u)", i)
-
-		U_INTERNAL_ASSERT_MAJOR(rnumber[i], 0)
-
-		*(unsigned int*)num2str = htonl(rnumber[i]);
-
-		_sendQueryPrepared();
-		}
-#endif
-
-	static void initOneResult()
-		{
-		U_TRACE_NO_PARAM(5, "World::initOneResult()")
-
-		U_INTERNAL_DUMP("wbuffer = %#.10S", wbuffer)
-
-		if (u_get_unalignedp64(wbuffer+52) != U_MULTICHAR_CONSTANT64('\r','\n','{','"','i','d','"',':'))
-			{
-			u_put_unalignedp64(wbuffer,	 U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'));
-			u_put_unalignedp64(wbuffer+8,  U_MULTICHAR_CONSTANT64('L','e','n','g','t','h',':',' '));
-			u_put_unalignedp32(wbuffer+16, U_MULTICHAR_CONSTANT32('3','1','\r','\n'));
-			u_put_unalignedp64(wbuffer+20, U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'));
-			u_put_unalignedp64(wbuffer+28, U_MULTICHAR_CONSTANT64('T','y','p','e',':',' ','a','p'));
-			u_put_unalignedp64(wbuffer+36, U_MULTICHAR_CONSTANT64('p','l','i','c','a','t','i','o'));
-			u_put_unalignedp64(wbuffer+44, U_MULTICHAR_CONSTANT64('n','/','j','s','o','n','\r','\n'));
-			u_put_unalignedp64(wbuffer+52, U_MULTICHAR_CONSTANT64('\r','\n','{','"','i','d','"',':'));
-
-			pwbuffer = u_num2str32(rnumber[0], wbuffer + U_CONSTANT_SIZE("Content-Length: 31\r\nContent-Type: application/json\r\n\r\n{\"id\":"));
-
-			u_put_unalignedp64(pwbuffer,   U_MULTICHAR_CONSTANT64(',','"','r','a','n','d','o','m'));
-			u_put_unalignedp64(pwbuffer+8, U_MULTICHAR_CONSTANT64('N','u','m','b','e','r','"',':'));
-			}
-
-		U_INTERNAL_ASSERT_EQUALS(u_get_unalignedp64(wbuffer),	U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'))
-		}
-
-	static void endOneResult()
-		{
-		U_TRACE_NO_PARAM(5, "World::endOneResult()")
-
-		*ptr = '}';
-
-		uint32_t		  len = ptr-wbuffer+1,
-					body_len = len - U_CONSTANT_SIZE("Content-Length: 31\r\nContent-Type: application/json\r\n\r\n");
-
-		U_NUM2STR16(wbuffer+U_CONSTANT_SIZE("Content-Length: "), body_len);
-
-		UClientImage_Base::wbuffer->setConstant(wbuffer, len);
-		}
-
-	static void handlerOneResult(uint32_t random)
-		{
-		U_TRACE(5, "World::handlerOneResult(%u)", random)
-
-		initOneResult();
-
-		ptr = u_num2str32(random, pwbuffer+16);
-
-		endOneResult();
-		}
-
-	static void initResult()
-		{
-		U_TRACE_NO_PARAM(5, "World::initResult()")
-
-		U_INTERNAL_DUMP("wbuffer = %#.10S", wbuffer)
-
-		if (u_get_unalignedp64(wbuffer+56) != U_MULTICHAR_CONSTANT64('\n','[','{','"','i','d','"',':'))
-			{
-			u_put_unalignedp64(wbuffer,	 U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'));
-			u_put_unalignedp64(wbuffer+8,  U_MULTICHAR_CONSTANT64('L','e','n','g','t','h',':',' '));
-			u_put_unalignedp64(wbuffer+16, U_MULTICHAR_CONSTANT64('1','3','3','3','1','\r','\n','C'));
-			u_put_unalignedp64(wbuffer+24, U_MULTICHAR_CONSTANT64('o','n','t','e','n','t','-','T'));
-			u_put_unalignedp64(wbuffer+32, U_MULTICHAR_CONSTANT64('y','p','e',':',' ','a','p','p'));
-			u_put_unalignedp64(wbuffer+40, U_MULTICHAR_CONSTANT64('l','i','c','a','t','i','o','n'));
-			u_put_unalignedp64(wbuffer+48, U_MULTICHAR_CONSTANT64('/','j','s','o','n','\r','\n','\r'));
-			u_put_unalignedp64(wbuffer+56, U_MULTICHAR_CONSTANT64('\n','[','{','"','i','d','"',':'));
-
-			pwbuffer = u_num2str32(rnumber[0], wbuffer + U_CONSTANT_SIZE("Content-Length: 13331\r\nContent-Type: application/json\r\n\r\n[{\"id\":"));
-
-			u_put_unalignedp64(pwbuffer,   U_MULTICHAR_CONSTANT64(',','"','r','a','n','d','o','m'));
-			u_put_unalignedp64(pwbuffer+8, U_MULTICHAR_CONSTANT64('N','u','m','b','e','r','"',':'));
-			}
-
-		U_INTERNAL_ASSERT_EQUALS(u_get_unalignedp64(wbuffer),	U_MULTICHAR_CONSTANT64('C','o','n','t','e','n','t','-'))
-
-		ptr = pwbuffer;
-		}
-
-	static void endResult()
-		{
-		U_TRACE_NO_PARAM(5, "World::endResult()")
-
-		*(ptr-1) = ']';
-
-		uint32_t		  len = ptr-wbuffer,
-					body_len = len - U_CONSTANT_SIZE("Content-Length: 13331\r\nContent-Type: application/json\r\n\r\n");
-
-		ptr = u_num2str32(body_len, wbuffer + U_CONSTANT_SIZE("Content-Length: "));
-
-		while (*ptr != '\r') *ptr++ = ' ';
-
-		UClientImage_Base::wbuffer->setConstant(wbuffer, len);
-		}
-
-	static void addResult(uint32_t i)
-		{
-		U_TRACE(5, "World::addResult(%u)", i)
-
-		U_INTERNAL_ASSERT_MAJOR(i, 0)
-
-		u_put_unalignedp32(ptr,   U_MULTICHAR_CONSTANT32('{','"','i','d'));
-		u_put_unalignedp16(ptr+4, U_MULTICHAR_CONSTANT16('"',':'));
-
-		ptr = u_num2str32(rnumber[i], ptr+6);
-
-		u_put_unalignedp64(ptr,   U_MULTICHAR_CONSTANT64(',','"','r','a','n','d','o','m'));
-		u_put_unalignedp64(ptr+8, U_MULTICHAR_CONSTANT64('N','u','m','b','e','r','"',':'));
-		}
-
-	static void addRandom(uint32_t random)
-		{
-		U_TRACE(5, "World::addRandom(%u)", random)
-
-		ptr = u_num2str32(random, ptr+16);
-
-		u_put_unalignedp16(ptr, U_MULTICHAR_CONSTANT16('}',','));
-								 ptr += 2;
-		}
-
-	static void handlerResult(uint32_t i, uint32_t random)
-		{
-		U_TRACE(5, "World::handlerResult(%u,%u)", i, random)
-
-		if (i) addResult(i);
-
-		addRandom(random);
-		}
-
-	static void doUpdateNoSql(vPFu handlerUpdateNoSql)
-		{
-		U_TRACE(5, "World::doUpdateNoSql(%p)", handlerUpdateNoSql)
-
-		initResult();
-
-		for (uint32_t i = 0, n = UHTTP::getFormFirstNumericValue(1, 500); i < n; ++i)
-			{
-			handlerUpdateNoSql(i);
-
-			handlerResult(i, rnum);
-			}
-
-		endResult();
-		}
-
-	static void handlerInitSql()
-		{
-		U_TRACE_NO_PARAM(5, "World::handlerInitSql()")
-
-#	ifdef U_STATIC_ORM_DRIVER_PGSQL
-		U_INTERNAL_DUMP("UServer_Base::handler_db1 = %p", UServer_Base::handler_db1)
-
-		if (UServer_Base::handler_db1 == U_NULLPTR)
-			{
-			U_NEW(UEventDB, UServer_Base::handler_db1, UEventDB);
-			}
-#	endif
-		}
-
-	static void handlerFork()
-		{
-		U_TRACE_NO_PARAM(5, "World::handlerFork()")
-
-		if (rnumber[0] == 0) for (uint32_t i = 0; i <= 500; ++i) rnumber[i] = u_get_num_random_range1(10000);
-		}
-
-	static void handlerForkSql()
-		{
-		U_TRACE_NO_PARAM(5, "World::handlerForkSql()")
-
-		if (psql_query == U_NULLPTR)
-			{
-			U_NEW(UOrmSession, psql_query, UOrmSession(U_CONSTANT_TO_PARAM("hello_world")));
-
-			if (psql_query->isReady() == false)
-				{
-				U_WARNING("World::handlerForkSql(): we cound't connect to db");
-
-				U_DELETE(psql_query)
-
-				psql_query = U_NULLPTR;
-
-				return;
-				}
-
-			U_NEW(UOrmStatement, pstmt_query, UOrmStatement(*psql_query, U_CONSTANT_TO_PARAM("SELECT randomNumber, id FROM World WHERE id = ?")));
-
-			U_NEW(World, pworld_query, World);
-
-			pstmt_query->use( pworld_query->id);
-			pstmt_query->into(pworld_query->randomNumber);
-
-#		ifdef U_STATIC_ORM_DRIVER_PGSQL
-			if (UOrmDriver::isPGSQL())
-				{
-				UOrmDriverPgSql* pdrv = (UOrmDriverPgSql*)psql_query->getDriver();
-
-				 conn = (PGconn*)pdrv->UOrmDriver::connection;
-				pstmt = (UPgSqlStatement*)pstmt_query->getStatement();
-
-				(void) pstmt->setBindParam(pdrv);
-
-				pstmt->paramValues[0]  = num2str;
-				pstmt->paramLengths[0] = sizeof(unsigned int);
-
-				UServer_Base::handler_db1->setConnection(conn);
-				}
-#		endif
-
-			handlerFork();
-			}
-		}
-
-private:
-	U_DISALLOW_ASSIGN(World)
-};
-#endif

+ 0 - 270
frameworks/C++/ulib/src/worldNoSql.h

@@ -1,270 +0,0 @@
-// worldNoSql.h
-
-#ifndef WORLD_NO_SQL_H
-#define WORLD_NO_SQL_H 1
-
-#include "world.h"
-
-#include <ulib/net/client/redis.h>
-#include <ulib/net/client/elasticsearch.h>
-
-#ifdef USE_MONGODB
-#	include <ulib/net/client/mongodb.h>
-#endif
-
-class U_EXPORT WorldNoSql {
-public:
-
-	static UString* str_rnumber;
-
-	static void doOneQuery(vPFu handlerQuery)
-		{
-		U_TRACE(5, "WorldNoSql::doOneQuery(%p)", handlerQuery)
-
-		handlerQuery(World::rnumber[0]);
-
-		uint32_t sz = str_rnumber->size();
-
-		World::initOneResult();
-
-		(void) memcpy(World::pwbuffer+16, str_rnumber->data(), sz);
-
-		World::ptr = World::pwbuffer+16+sz;
-
-		World::endOneResult();
-
-		str_rnumber->clear();
-		}
-
-	static void handlerResult(uint32_t i)
-		{
-		U_TRACE(5, "WorldNoSql::handlerResult(%u)", i)
-
-		U_INTERNAL_ASSERT_POINTER(str_rnumber)
-		U_INTERNAL_ASSERT_POINTER(World::pwbuffer)
-
-		if (i) World::addResult(i);
-
-		uint32_t sz = str_rnumber->size();
-
-		(void) memcpy(World::ptr+16, str_rnumber->data(), sz);
-						  World::ptr += 16+						  sz;
-
-		u_put_unalignedp16(World::ptr, U_MULTICHAR_CONSTANT16('}',','));
-								 World::ptr += 2;
-
-		str_rnumber->clear();
-		}
-
-	static void doQuery(vPFu handlerQuery)
-		{
-		U_TRACE(5, "WorldNoSql::doQuery(%p)", handlerQuery)
-
-		World::initResult();
-
-		for (uint32_t i = 0, n = UHTTP::getFormFirstNumericValue(1, 500); i < n; ++i)
-			{
-			handlerQuery(World::rnumber[i]);
-
-			handlerResult(i);
-			}
-
-		World::endResult();
-		}
-
-	static void handlerFork()
-		{
-		U_TRACE_NO_PARAM(5, "WorldNoSql::handlerFork()")
-
-		if (str_rnumber == U_NULLPTR) U_NEW_STRING(str_rnumber, UString);
-
-		World::handlerFork();
-
-		U_INTERNAL_ASSERT_POINTER(str_rnumber)
-		}
-
-#ifdef USE_MONGODB
-	static bson_t* query;
-	static UMongoDBClient* mc;
-#endif
-
-	static void handlerQueryMongoDB(uint32_t uid)
-		{
-		U_TRACE(5, "WorldNoSql::handlerQueryMongoDB(%u)", uid)
-
-		U_INTERNAL_ASSERT_POINTER(str_rnumber)
-
-#	ifdef USE_MONGODB
-		(void) mc->findOne(uid, query);
-		(void) U_JFIND(mc->vitem[0], "randomNumber", *str_rnumber);
-
-		uint32_t pos = str_rnumber->find_first_of('.');
-
-		if (pos != U_NOT_FOUND) str_rnumber->size_adjust_constant(pos);
-#	endif
-		}
-
-	static void handlerUpdateMongoDB(uint32_t i)
-		{
-		U_TRACE(5, "WorldNoSql::handlerUpdateMongoDB(%u)", i)
-
-#	ifdef USE_MONGODB
-		(void) mc->findOne(World::rnumber[i], query);
-		(void) mc->update( World::rnumber[i], "randomNumber", World::rnum = u_get_num_random_range1(10000));
-#	endif
-		}
-
-	static void handlerForkMongoDB()
-		{
-		U_TRACE_NO_PARAM(5, "WorldNoSql::handlerForkMongoDB()")
-
-#	ifdef USE_MONGODB
-		if (mc == U_NULLPTR)
-			{
-			U_NEW(UMongoDBClient, mc, UMongoDBClient);
-
-			if (mc->connect(U_NULLPTR, 0) == false)
-				{
-				U_WARNING("WorldNoSql::handlerForkMongoDB(): connection failed");
-
-				U_DELETE(mc)
-
-				mc = U_NULLPTR;
-
-				return;
-				}
-
-			if (mc->selectCollection("hello_world", "world") == false)
-				{
-				U_WARNING("WorldNoSql::handlerForkMongoDB(): selectCollection() failed");
-
-				U_DELETE(mc)
-
-				mc = U_NULLPTR;
-
-				return;
-				}
-
-			query = (bson_t*) U_SYSCALL_NO_PARAM(bson_new);  
-
-			handlerFork();
-			}
-#	endif
-		}
-
-	static char rc_buffer[128];
-	static UREDISClient_Base* rc;
-
-	static void handlerQueryREDIS(uint32_t uid)
-		{
-		U_TRACE(5, "WorldNoSql::handlerQueryREDIS(%u)", uid)
-
-		U_INTERNAL_ASSERT_POINTER(str_rnumber)
-
-		char* ptr = rc_buffer+U_CONSTANT_SIZE("world:");
-
-		(void) rc->get(ptr, U_CONSTANT_SIZE("world:")+u_num2str32(uid, ptr)-ptr);
-
-		*str_rnumber = rc->vitem[0];
-		}
-
-	static void handlerUpdateREDIS(uint32_t i)
-		{
-		U_TRACE(5, "WorldNoSql::handlerUpdateREDIS(%u)", i)
-
-		char* start = rc_buffer+U_CONSTANT_SIZE("world:");
-		char* ptr = u_num2str32(World::rnumber[i], start);
-
-		(void) rc->get(start, ptr-start);
-
-		*ptr = ' ';
-		 ptr = u_num2str32(World::rnum = u_get_num_random_range1(10000), ptr+1);
-
-		(void) rc->mset(start, ptr-start);
-		}
-
-	static void handlerForkREDIS()
-		{
-		U_TRACE_NO_PARAM(5, "WorldNoSql::handlerForkREDIS()")
-
-		if (rc == U_NULLPTR)
-			{
-			U_NEW(UREDISClient<UTCPSocket>, rc, UREDISClient<UTCPSocket>);
-
-			if (rc->connect() == false)
-				{
-				U_WARNING("WorldNoSql::handlerForkREDIS(): %V", rc->UClient_Base::getResponse().rep);
-
-				U_DELETE(rc)
-
-				rc = U_NULLPTR;
-
-				return;
-				}
-
-			U_MEMCPY(rc_buffer, "world:", U_CONSTANT_SIZE("world:"));
-
-			handlerFork();
-			}
-		}
-
-	static char* pbuffer1;
-	static char* pbuffer2;
-	static char es_buffer1[128];
-	static char es_buffer2[128];
-	static UElasticSearchClient* es;
-
-#	define U_QLEN U_CONSTANT_SIZE("{\"query\":{\"match\":{\"_id\":\"")
-
-	static void handlerQueryElasticSearch(uint32_t uid)
-		{
-		U_TRACE(5, "WorldNoSql::handlerQueryElasticSearch(%u)", uid)
-
-		U_INTERNAL_ASSERT_POINTER(str_rnumber)
-
-		(void) es->sendPOST(U_CONSTANT_TO_PARAM("/tfb/world/_search"), es_buffer1, U_QLEN+
-																			u__snprintf(es_buffer1+ U_QLEN,
-																				  sizeof(es_buffer1)-U_QLEN, U_CONSTANT_TO_PARAM("%u\"}}}"), uid));
-
-		(void) U_JFIND(es->getContent(), "randomNumber", *str_rnumber);
-		}
-
-	static void handlerUpdateElasticSearch(uint32_t i)
-		{
-		U_TRACE(5, "WorldNoSql::handlerUpdateElasticSearch(%u)", i)
-
-		uint32_t len1 = u__snprintf(pbuffer1, 100, U_CONSTANT_TO_PARAM("%u/_update"), World::rnumber[i]),
-					len2 = u__snprintf(pbuffer2, 100, U_CONSTANT_TO_PARAM("%u\"}}"), World::rnum = u_get_num_random_range1(10000));
-
-		(void) es->sendPOST(es_buffer1, len1+U_CONSTANT_SIZE("/tfb/world/"), es_buffer2, len2+U_CONSTANT_SIZE("{\"doc\":{\"_id\":\""));
-		}
-
-	static void handlerForkElasticSearch()
-		{
-		U_TRACE_NO_PARAM(5, "WorldNoSql::handlerForkElasticSearch()")
-
-		if (es == U_NULLPTR)
-			{
-			U_NEW(UElasticSearchClient, es, UElasticSearchClient);
-
-			if (es->connect() == false)
-				{
-				U_WARNING("WorldNoSql::handlerForkElasticSearch(): connection disabled or failed");
-
-				U_DELETE(es)
-
-				es = U_NULLPTR;
-
-				return;
-				}
-
-			U_MEMCPY(es_buffer1, "{\"query\":{\"match\":{\"_id\":\"", U_QLEN);
-
-			handlerFork();
-			}
-		}
-
-private:
-	U_DISALLOW_ASSIGN(WorldNoSql)
-};
-#endif

+ 0 - 82
frameworks/C++/ulib/ulib-json.dockerfile

@@ -1,82 +0,0 @@
-FROM ubuntu:18.04
-
-COPY ./ ./
-
-RUN apt-get update -yqq && \
-	 apt-get install -yqq software-properties-common build-essential curl locales wget unzip git \
-    libmysqlclient-dev libpq-dev \
-    libpcre3 libpcre3-dev \
-    libssl-dev libcurl4-openssl-dev \
-    zlib1g-dev \
-    libreadline6-dev \
-    libbz2-dev \
-    libxslt-dev libgdbm-dev ncurses-dev  \
-    libffi-dev libtool bison libevent-dev \
-    liborc-0.4-0 \
-    libmcrypt-dev libicu-dev \
-    re2c libnuma-dev \
-	 postgresql-server-dev-all libcap2-bin && \
-	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-	 apt-get update -yqq && \
-	 apt-get install -yqq gcc-8 g++-8
-
-RUN locale-gen en_US.UTF-8
-
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-ENV DEBIAN_FRONTEND noninteractive
-
-ENV CC=gcc-8
-ENV CXX=g++-8
-ENV AR=gcc-ar-8
-ENV RANLIB=gcc-ranlib-8
-ENV IROOT=/install
-ENV ULIB_ROOT=$IROOT/ULib
-ENV ULIB_VERSION=2.4.2
-ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-
-WORKDIR $IROOT
-
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
-RUN tar xf ULib-${ULIB_VERSION}.tar.gz
-
-WORKDIR $IROOT/ULib-$ULIB_VERSION
-
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
-RUN cp /src/* src/ulib/net/server/plugin/usp
-RUN find . -exec touch {} \;
-
-RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD $(( 3 * $(nproc) / 2 ))" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
-
-RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
-    ./configure --prefix=$ULIB_ROOT \
-    --disable-static --disable-examples \
-    --without-ssl --disable-HCRS --without-pcre --without-expat \
-    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
-	 --enable-static-server-plugin=http
-
-RUN make install && \
-	 cd examples/userver && make install && \
-	 cd ../../src/ulib/net/server/plugin/usp && \
-    make json.la && \
-    cp .libs/json.so $ULIB_DOCUMENT_ROOT
-
-ENV PATH=${ULIB_ROOT}/bin:${PATH}
-
-ADD ./ /ulib
-WORKDIR /ulib
-
-ENV UMEMPOOL="58,0,0,41,273,-15,-14,-20,36"
-
-EXPOSE 8080
-
-CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
-    $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 0 - 82
frameworks/C++/ulib/ulib-json_fit.dockerfile

@@ -1,82 +0,0 @@
-FROM ubuntu:18.04
-
-COPY ./ ./
-
-RUN apt-get update -yqq && \
-	 apt-get install -yqq software-properties-common build-essential curl locales wget unzip git \
-    libmysqlclient-dev libpq-dev \
-    libpcre3 libpcre3-dev \
-    libssl-dev libcurl4-openssl-dev \
-    zlib1g-dev \
-    libreadline6-dev \
-    libbz2-dev \
-    libxslt-dev libgdbm-dev ncurses-dev  \
-    libffi-dev libtool bison libevent-dev \
-    liborc-0.4-0 \
-    libmcrypt-dev libicu-dev \
-    re2c libnuma-dev \
-	 postgresql-server-dev-all libcap2-bin && \
-	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-	 apt-get update -yqq && \
-	 apt-get install -yqq gcc-8 g++-8
-
-RUN locale-gen en_US.UTF-8
-
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-ENV DEBIAN_FRONTEND noninteractive
-
-ENV CC=gcc-8
-ENV CXX=g++-8
-ENV AR=gcc-ar-8
-ENV RANLIB=gcc-ranlib-8
-ENV IROOT=/install
-ENV ULIB_ROOT=$IROOT/ULib
-ENV ULIB_VERSION=2.4.2
-ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-
-WORKDIR $IROOT
-
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
-RUN tar xf ULib-${ULIB_VERSION}.tar.gz
-
-WORKDIR $IROOT/ULib-$ULIB_VERSION
-
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
-RUN cp /src/* src/ulib/net/server/plugin/usp
-RUN find . -exec touch {} \;
-
-RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD $(nproc)" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
-
-RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
-    ./configure --prefix=$ULIB_ROOT \
-    --disable-static --disable-examples \
-    --without-ssl --disable-HCRS --without-pcre --without-expat \
-    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
-	 --enable-static-server-plugin=http
-
-RUN make install && \
-	 cd examples/userver && make install && \
-	 cd ../../src/ulib/net/server/plugin/usp && \
-    make json.la && \
-    cp .libs/json.so $ULIB_DOCUMENT_ROOT
-
-ENV PATH=${ULIB_ROOT}/bin:${PATH}
-
-ADD ./ /ulib
-WORKDIR /ulib
-
-ENV UMEMPOOL="58,0,0,41,273,-15,-14,-20,36"
-
-EXPOSE 8080
-
-CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
-    $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 0 - 91
frameworks/C++/ulib/ulib-mongodb.dockerfile

@@ -1,91 +0,0 @@
-FROM ubuntu:18.04
-
-COPY ./ ./
-
-RUN apt-get update -yqq && \
-	 apt-get install -yqq software-properties-common build-essential curl locales wget unzip git \
-    libmysqlclient-dev libpq-dev \
-    libpcre3 libpcre3-dev \
-    libssl-dev libcurl4-openssl-dev \
-    zlib1g-dev \
-    libreadline6-dev \
-    libbz2-dev \
-    libxslt-dev libgdbm-dev ncurses-dev  \
-    libffi-dev libtool bison libevent-dev \
-    liborc-0.4-0 \
-    libmcrypt-dev libicu-dev \
-    re2c libnuma-dev \
-	 postgresql-server-dev-all libcap2-bin && \
-	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-	 apt-get update -yqq && \
-	 apt-get install -yqq gcc-8 g++-8
-
-RUN locale-gen en_US.UTF-8
-
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-ENV DEBIAN_FRONTEND noninteractive
-
-ENV CC=gcc-8
-ENV CXX=g++-8
-ENV AR=gcc-ar-8
-ENV RANLIB=gcc-ranlib-8
-ENV IROOT=/install
-ENV ULIB_ROOT=$IROOT/ULib
-ENV ULIB_VERSION=2.4.2
-ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-
-WORKDIR $IROOT
-
-RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.4.0/mongo-c-driver-1.4.0.tar.gz
-RUN tar xf mongo-c-driver-1.4.0.tar.gz
-RUN cd mongo-c-driver-1.4.0/ && \
-    ./configure --prefix=${IROOT} --libdir=${IROOT} --disable-automatic-init-and-cleanup && \
-    make && make install
-
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
-RUN tar xf ULib-${ULIB_VERSION}.tar.gz
-
-WORKDIR $IROOT/ULib-$ULIB_VERSION
-
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
-RUN cp /src/* src/ulib/net/server/plugin/usp
-RUN find . -exec touch {} \;
-
-RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD $(( 3 * $(nproc) / 2 ))" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET -2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
-
-RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
-    ./configure --prefix=$ULIB_ROOT \
-    --disable-static --disable-examples \
-    --without-ssl --disable-HCRS --without-pcre --without-expat \
-    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
-	 --enable-static-server-plugin=http \
-    --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
-
-RUN make install && \
-	 cd examples/userver && make install && \
-	 cd ../../src/ulib/net/server/plugin/usp && \
-    AM_LDFLAGS="-lFortune -lFortuneNoSql" make mfortune.la && \
-	 AM_LDFLAGS="-lWorld -lWorldNoSql" make mdb.la mquery.la mupdate.la && \
-    cp .libs/mdb.so .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
-
-ENV PATH=${ULIB_ROOT}/bin:${PATH}
-
-ADD ./ /ulib
-WORKDIR /ulib
-
-ENV MONGODB_HOST=tfb-database
-ENV UMEMPOOL="96,0,0,97,16417,-14,-20,-18,26"
-
-EXPOSE 8080
-
-CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
-    $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 0 - 87
frameworks/C++/ulib/ulib-mysql.dockerfile

@@ -1,87 +0,0 @@
-FROM ubuntu:18.04
-
-COPY ./ ./
-
-RUN apt-get update -yqq && \
-	 apt-get install -yqq software-properties-common build-essential curl locales wget unzip git \
-    libmysqlclient-dev libpq-dev \
-    libpcre3 libpcre3-dev \
-    libssl-dev libcurl4-openssl-dev \
-    zlib1g-dev \
-    libreadline6-dev \
-    libbz2-dev \
-    libxslt-dev libgdbm-dev ncurses-dev  \
-    libffi-dev libtool bison libevent-dev \
-    liborc-0.4-0 \
-    libmcrypt-dev libicu-dev \
-    re2c libnuma-dev \
-	 postgresql-server-dev-all libcap2-bin && \
-	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-	 apt-get update -yqq && \
-	 apt-get install -yqq gcc-8 g++-8
-
-RUN locale-gen en_US.UTF-8
-
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-ENV DEBIAN_FRONTEND noninteractive
-
-ENV CC=gcc-8
-ENV CXX=g++-8
-ENV AR=gcc-ar-8
-ENV RANLIB=gcc-ranlib-8
-ENV IROOT=/install
-ENV ULIB_ROOT=$IROOT/ULib
-ENV ULIB_VERSION=2.4.2
-ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-
-WORKDIR $IROOT
-
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
-RUN tar xf ULib-${ULIB_VERSION}.tar.gz
-
-WORKDIR $IROOT/ULib-$ULIB_VERSION
-
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
-RUN cp /src/* src/ulib/net/server/plugin/usp
-RUN find . -exec touch {} \;
-
-RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD $(nproc)" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET -2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER mysql" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
-
-RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
-    ./configure --prefix=$ULIB_ROOT \
-    --with-mysql \
-    --disable-static --disable-examples \
-    --without-ssl --disable-HCRS --without-pcre --without-expat \
-    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
-    --enable-static-orm-driver='mysql' --enable-static-server-plugin=http
-
-RUN make install && \
-	 cd examples/userver && make install && \
-	 cd ../../src/ulib/net/server/plugin/usp && \
-    AM_LDFLAGS="-lFortune" make fortune.la && \
-	 AM_LDFLAGS="-lWorld" make db.la query.la update.la cached_worlds.la && \
-    cp .libs/db.so .libs/query.so .libs/update.so .libs/fortune.so .libs/cached_worlds.so $ULIB_DOCUMENT_ROOT
-
-ENV PATH=${ULIB_ROOT}/bin:${PATH}
-
-ADD ./ /ulib
-WORKDIR /ulib
-
-ENV ORM_DRIVER="mysql"
-ENV ORM_OPTION="host=tfb-database user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=hello_world"
-ENV UMEMPOOL="96,0,0,97,16417,-14,-20,-18,26"
-
-EXPOSE 8080
-
-CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
-    $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 0 - 82
frameworks/C++/ulib/ulib-plaintext_fit.dockerfile

@@ -1,82 +0,0 @@
-FROM ubuntu:18.04
-
-COPY ./ ./
-
-RUN apt-get update -yqq && \
-	 apt-get install -yqq software-properties-common build-essential curl locales wget unzip git \
-    libmysqlclient-dev libpq-dev \
-    libpcre3 libpcre3-dev \
-    libssl-dev libcurl4-openssl-dev \
-    zlib1g-dev \
-    libreadline6-dev \
-    libbz2-dev \
-    libxslt-dev libgdbm-dev ncurses-dev  \
-    libffi-dev libtool bison libevent-dev \
-    liborc-0.4-0 \
-    libmcrypt-dev libicu-dev \
-    re2c libnuma-dev \
-	 postgresql-server-dev-all libcap2-bin && \
-	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-	 apt-get update -yqq && \
-	 apt-get install -yqq gcc-8 g++-8
-
-RUN locale-gen en_US.UTF-8
-
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-ENV DEBIAN_FRONTEND noninteractive
-
-ENV CC=gcc-8
-ENV CXX=g++-8
-ENV AR=gcc-ar-8
-ENV RANLIB=gcc-ranlib-8
-ENV IROOT=/install
-ENV ULIB_ROOT=$IROOT/ULib
-ENV ULIB_VERSION=2.4.2
-ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-
-WORKDIR $IROOT
-
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
-RUN tar xf ULib-${ULIB_VERSION}.tar.gz
-
-WORKDIR $IROOT/ULib-$ULIB_VERSION
-
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
-RUN cp /src/* src/ulib/net/server/plugin/usp
-RUN find . -exec touch {} \;
-
-RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD $(nproc)" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
-
-RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
-    ./configure --prefix=$ULIB_ROOT \
-    --disable-static --disable-examples \
-    --without-ssl --without-pcre --without-expat \
-    --without-libz --without-libuuid --without-magic --without-libares \
-	 --enable-static-server-plugin=http
-
-RUN make install && \
-	 cd examples/userver && make install && \
-	 cd ../../src/ulib/net/server/plugin/usp && \
-    make plaintext.la && \
-    cp .libs/plaintext.so $ULIB_DOCUMENT_ROOT
-
-ENV PATH=${ULIB_ROOT}/bin:${PATH}
-
-ADD ./ /ulib
-WORKDIR /ulib
-
-ENV UMEMPOOL="58,0,0,41,16401,-14,-15,11,25"
-
-EXPOSE 8080
-
-CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
-    $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 0 - 87
frameworks/C++/ulib/ulib-postgres.dockerfile

@@ -1,87 +0,0 @@
-FROM ubuntu:18.04
-
-COPY ./ ./
-
-RUN apt-get update -yqq && \
-	 apt-get install -yqq software-properties-common build-essential curl locales wget unzip git \
-    libmysqlclient-dev libpq-dev \
-    libpcre3 libpcre3-dev \
-    libssl-dev libcurl4-openssl-dev \
-    zlib1g-dev \
-    libreadline6-dev \
-    libbz2-dev \
-    libxslt-dev libgdbm-dev ncurses-dev  \
-    libffi-dev libtool bison libevent-dev \
-    liborc-0.4-0 \
-    libmcrypt-dev libicu-dev \
-    re2c libnuma-dev \
-	 postgresql-server-dev-all libcap2-bin libldap-dev && \
-	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-	 apt-get update -yqq && \
-	 apt-get install -yqq gcc-8 g++-8
-
-RUN locale-gen en_US.UTF-8
-
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-ENV DEBIAN_FRONTEND noninteractive
-
-ENV CC=gcc-8
-ENV CXX=g++-8
-ENV AR=gcc-ar-8
-ENV RANLIB=gcc-ranlib-8
-ENV IROOT=/install
-ENV ULIB_ROOT=$IROOT/ULib
-ENV ULIB_VERSION=2.4.2
-ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-
-WORKDIR $IROOT
-
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
-RUN tar xf ULib-${ULIB_VERSION}.tar.gz
-
-WORKDIR $IROOT/ULib-$ULIB_VERSION
-
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
-RUN cp /src/* src/ulib/net/server/plugin/usp
-RUN find . -exec touch {} \;
-
-RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD $(( 2 * $(nproc)))" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET -2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER pgsql" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
-
-RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
-    ./configure --prefix=$ULIB_ROOT \
-    --disable-static --disable-examples \
-    --with-pgsql \
-    --without-ssl --disable-HCRS --without-pcre --without-expat \
-    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
-    --enable-static-orm-driver='pgsql' --enable-static-server-plugin=http
-
-RUN make install && \
-	 cd examples/userver && make install && \
-	 cd ../../src/ulib/net/server/plugin/usp && \
-    AM_LDFLAGS="-lFortune" make fortune.la && \
-	 AM_LDFLAGS="-lWorld" make db.la query.la update.la cached_worlds.la && \
-    cp .libs/db.so .libs/query.so .libs/update.so .libs/fortune.so .libs/cached_worlds.so $ULIB_DOCUMENT_ROOT
-
-ENV PATH=${ULIB_ROOT}/bin:${PATH}
-
-ADD ./ /ulib
-WORKDIR /ulib
-
-ENV ORM_DRIVER="pgsql"
-ENV UMEMPOOL="96,0,0,97,16417,-14,-20,-18,26"
-ENV ORM_OPTION="host=tfb-database user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
-
-EXPOSE 8080
-
-CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
-    $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 0 - 87
frameworks/C++/ulib/ulib-postgres_fit.dockerfile

@@ -1,87 +0,0 @@
-FROM ubuntu:18.04
-
-COPY ./ ./
-
-RUN apt-get update -yqq && \
-	 apt-get install -yqq software-properties-common build-essential curl locales wget unzip git \
-    libmysqlclient-dev libpq-dev \
-    libpcre3 libpcre3-dev \
-    libssl-dev libcurl4-openssl-dev \
-    zlib1g-dev \
-    libreadline6-dev \
-    libbz2-dev \
-    libxslt-dev libgdbm-dev ncurses-dev  \
-    libffi-dev libtool bison libevent-dev \
-    liborc-0.4-0 \
-    libmcrypt-dev libicu-dev \
-    re2c libnuma-dev \
-	 postgresql-server-dev-all libcap2-bin libldap-dev && \
-	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-	 apt-get update -yqq && \
-	 apt-get install -yqq gcc-8 g++-8
-
-RUN locale-gen en_US.UTF-8
-
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-ENV DEBIAN_FRONTEND noninteractive
-
-ENV CC=gcc-8
-ENV CXX=g++-8
-ENV AR=gcc-ar-8
-ENV RANLIB=gcc-ranlib-8
-ENV IROOT=/install
-ENV ULIB_ROOT=$IROOT/ULib
-ENV ULIB_VERSION=2.4.2
-ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-
-WORKDIR $IROOT
-
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
-RUN tar xf ULib-${ULIB_VERSION}.tar.gz
-
-WORKDIR $IROOT/ULib-$ULIB_VERSION
-
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
-RUN cp /src/* src/ulib/net/server/plugin/usp
-RUN find . -exec touch {} \;
-
-RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD $(nproc)" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET -2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER pgsql" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
-
-RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
-    ./configure --prefix=$ULIB_ROOT \
-    --disable-static --disable-examples \
-    --with-pgsql \
-    --without-ssl --disable-HCRS --without-pcre --without-expat \
-    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
-    --enable-static-orm-driver='pgsql' --enable-static-server-plugin=http
-
-RUN make install && \
-	 cd examples/userver && make install && \
-	 cd ../../src/ulib/net/server/plugin/usp && \
-    AM_LDFLAGS="-lFortune" make fortune.la && \
-	 AM_LDFLAGS="-lWorld" make db.la query.la update.la cached_worlds.la && \
-    cp .libs/db.so .libs/query.so .libs/update.so .libs/fortune.so .libs/cached_worlds.so $ULIB_DOCUMENT_ROOT
-
-ENV PATH=${ULIB_ROOT}/bin:${PATH}
-
-ADD ./ /ulib
-WORKDIR /ulib
-
-ENV ORM_DRIVER="pgsql"
-ENV UMEMPOOL="96,0,0,97,16417,-14,-20,-18,26"
-ENV ORM_OPTION="host=tfb-database user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
-
-EXPOSE 8080
-
-CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
-    $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 0 - 82
frameworks/C++/ulib/ulib.dockerfile

@@ -1,82 +0,0 @@
-FROM ubuntu:18.04
-
-COPY ./ ./
-
-RUN apt-get update -yqq && \
-	 apt-get install -yqq software-properties-common build-essential curl locales wget unzip git \
-    libmysqlclient-dev libpq-dev \
-    libpcre3 libpcre3-dev \
-    libssl-dev libcurl4-openssl-dev \
-    zlib1g-dev \
-    libreadline6-dev \
-    libbz2-dev \
-    libxslt-dev libgdbm-dev ncurses-dev  \
-    libffi-dev libtool bison libevent-dev \
-    liborc-0.4-0 \
-    libmcrypt-dev libicu-dev \
-    re2c libnuma-dev \
-	 postgresql-server-dev-all libcap2-bin && \
-	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-	 apt-get update -yqq && \
-	 apt-get install -yqq gcc-8 g++-8
-
-RUN locale-gen en_US.UTF-8
-
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-ENV DEBIAN_FRONTEND noninteractive
-
-ENV CC=gcc-8
-ENV CXX=g++-8
-ENV AR=gcc-ar-8
-ENV RANLIB=gcc-ranlib-8
-ENV IROOT=/install
-ENV ULIB_ROOT=$IROOT/ULib
-ENV ULIB_VERSION=2.4.2
-ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-
-WORKDIR $IROOT
-
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
-RUN tar xf ULib-${ULIB_VERSION}.tar.gz
-
-WORKDIR $IROOT/ULib-$ULIB_VERSION
-
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
-RUN cp /src/* src/ulib/net/server/plugin/usp
-RUN find . -exec touch {} \;
-
-RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD $(( 3 * $(nproc) / 2 ))" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
-
-RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
-    ./configure --prefix=$ULIB_ROOT \
-    --disable-static --disable-examples \
-    --without-ssl --without-pcre --without-expat \
-    --without-libz --without-libuuid --without-magic --without-libares \
-	 --enable-static-server-plugin=http
-
-RUN make install && \
-	 cd examples/userver && make install && \
-	 cd ../../src/ulib/net/server/plugin/usp && \
-    make plaintext.la && \
-    cp .libs/plaintext.so $ULIB_DOCUMENT_ROOT
-
-ENV PATH=${ULIB_ROOT}/bin:${PATH}
-
-ADD ./ /ulib
-WORKDIR /ulib
-
-ENV UMEMPOOL="58,0,0,41,16401,-14,-15,11,25"
-
-EXPOSE 8080
-
-CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
-    $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg