diff --git a/frameworks/C++/ulib/README.md b/frameworks/C++/ulib/README.md deleted file mode 100644 index 6fc50e63b7f..00000000000 --- a/frameworks/C++/ulib/README.md +++ /dev/null @@ -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 - -Fortunes
idmessage
11<script>alert("This should not be displayed in a browser alert box.");</script>
4A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1
5A computer program does what you tell it to do, not what you want it to do.
2A computer scientist is someone who fixes things that aren't broken.
8A list is only as strong as its weakest link. — Donald Knuth
0Additional fortune added at request time.
3After enough decimal places, nobody gives a damn.
7Any program that runs right is obsolete.
10Computers make very fast, very accurate mistakes.
6Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen
9Feature: A bug with seniority.
1fortune: No such file or directory
12フレームワークのベンチマーク
-``` - -[/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! -``` diff --git a/frameworks/C++/ulib/benchmark_config.json b/frameworks/C++/ulib/benchmark_config.json deleted file mode 100644 index 86e4e513f40..00000000000 --- a/frameworks/C++/ulib/benchmark_config.json +++ /dev/null @@ -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"] - } - }] -} diff --git a/frameworks/C++/ulib/config.toml b/frameworks/C++/ulib/config.toml deleted file mode 100644 index 4288ea05d7d..00000000000 --- a/frameworks/C++/ulib/config.toml +++ /dev/null @@ -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 = "" diff --git a/frameworks/C++/ulib/src/cached_worlds.usp b/frameworks/C++/ulib/src/cached_worlds.usp deleted file mode 100644 index aa9025ba32a..00000000000 --- a/frameworks/C++/ulib/src/cached_worlds.usp +++ /dev/null @@ -1,56 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/db.usp b/frameworks/C++/ulib/src/db.usp deleted file mode 100644 index f1f8f9d2abe..00000000000 --- a/frameworks/C++/ulib/src/db.usp +++ /dev/null @@ -1,45 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/edb.usp b/frameworks/C++/ulib/src/edb.usp deleted file mode 100644 index 5e87c864293..00000000000 --- a/frameworks/C++/ulib/src/edb.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/equery.usp b/frameworks/C++/ulib/src/equery.usp deleted file mode 100644 index f05bcfbfebc..00000000000 --- a/frameworks/C++/ulib/src/equery.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/eupdate.usp b/frameworks/C++/ulib/src/eupdate.usp deleted file mode 100644 index 483fd82c825..00000000000 --- a/frameworks/C++/ulib/src/eupdate.usp +++ /dev/null @@ -1,28 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/fortune.h b/frameworks/C++/ulib/src/fortune.h deleted file mode 100644 index af237428531..00000000000 --- a/frameworks/C++/ulib/src/fortune.h +++ /dev/null @@ -1,316 +0,0 @@ -// fortune.h - -#ifndef FORTUNE_H -#define FORTUNE_H 1 - -#include -#include -#include -#include -#include -#include - -#ifdef U_STATIC_ORM_DRIVER_PGSQL -# include -# include -#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* 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" - "Fortunes"); - } - - 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("Fortunes
idmessage
"); - - 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("
idmessage
"); - - ptr = pwbuffer - U_CONSTANT_SIZE("xxxxxxxx\r\nContent-Type: text/html; charset=UTF-8\r\n\r\n" - "Fortunes"); - - 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* 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 diff --git a/frameworks/C++/ulib/src/fortune.usp b/frameworks/C++/ulib/src/fortune.usp deleted file mode 100644 index 038402a2585..00000000000 --- a/frameworks/C++/ulib/src/fortune.usp +++ /dev/null @@ -1,67 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/fortuneNoSql.h b/frameworks/C++/ulib/src/fortuneNoSql.h deleted file mode 100644 index 880304e011e..00000000000 --- a/frameworks/C++/ulib/src/fortuneNoSql.h +++ /dev/null @@ -1,115 +0,0 @@ -// fortuneNoSql.h - -#ifndef FORTUNE_NO_SQL_H -#define FORTUNE_NO_SQL_H 1 - -#include "fortune.h" - -#include -#include - -#ifdef USE_MONGODB -# include -#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, rc, UREDISClient); - - 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 diff --git a/frameworks/C++/ulib/src/json.usp b/frameworks/C++/ulib/src/json.usp deleted file mode 100644 index 9afe75aefa0..00000000000 --- a/frameworks/C++/ulib/src/json.usp +++ /dev/null @@ -1,52 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/libFortune.cxx b/frameworks/C++/ulib/src/libFortune.cxx deleted file mode 100644 index 1348e76e96d..00000000000 --- a/frameworks/C++/ulib/src/libFortune.cxx +++ /dev/null @@ -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::pvfortune; -#ifdef U_STATIC_ORM_DRIVER_PGSQL -PGconn* Fortune::conn; -UPgSqlStatement* Fortune::pstmt; -#endif diff --git a/frameworks/C++/ulib/src/libFortuneNoSql.cxx b/frameworks/C++/ulib/src/libFortuneNoSql.cxx deleted file mode 100644 index 7b05a9c15c7..00000000000 --- a/frameworks/C++/ulib/src/libFortuneNoSql.cxx +++ /dev/null @@ -1,8 +0,0 @@ -// fortuneNoSql.cpp - -#include "fortuneNoSql.h" - -#ifdef USE_MONGODB -UMongoDBClient* FortuneNoSql::mc; -#endif -UREDISClient_Base* FortuneNoSql::rc; diff --git a/frameworks/C++/ulib/src/libWorld.cxx b/frameworks/C++/ulib/src/libWorld.cxx deleted file mode 100644 index 214d809dc6b..00000000000 --- a/frameworks/C++/ulib/src/libWorld.cxx +++ /dev/null @@ -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 diff --git a/frameworks/C++/ulib/src/libWorldNoSql.cxx b/frameworks/C++/ulib/src/libWorldNoSql.cxx deleted file mode 100644 index 95b6895fd03..00000000000 --- a/frameworks/C++/ulib/src/libWorldNoSql.cxx +++ /dev/null @@ -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; diff --git a/frameworks/C++/ulib/src/mdb.usp b/frameworks/C++/ulib/src/mdb.usp deleted file mode 100644 index ffc16cd5f97..00000000000 --- a/frameworks/C++/ulib/src/mdb.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/mfortune.usp b/frameworks/C++/ulib/src/mfortune.usp deleted file mode 100644 index 7900caaa028..00000000000 --- a/frameworks/C++/ulib/src/mfortune.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/mquery.usp b/frameworks/C++/ulib/src/mquery.usp deleted file mode 100644 index 4c507a18912..00000000000 --- a/frameworks/C++/ulib/src/mquery.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/mupdate.usp b/frameworks/C++/ulib/src/mupdate.usp deleted file mode 100644 index 4fec5c328c1..00000000000 --- a/frameworks/C++/ulib/src/mupdate.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/plaintext.usp b/frameworks/C++/ulib/src/plaintext.usp deleted file mode 100644 index 40f909bc57c..00000000000 --- a/frameworks/C++/ulib/src/plaintext.usp +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/frameworks/C++/ulib/src/query.usp b/frameworks/C++/ulib/src/query.usp deleted file mode 100644 index 9c2004196e8..00000000000 --- a/frameworks/C++/ulib/src/query.usp +++ /dev/null @@ -1,62 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/rdb.usp b/frameworks/C++/ulib/src/rdb.usp deleted file mode 100644 index 564229833b1..00000000000 --- a/frameworks/C++/ulib/src/rdb.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/rfortune.usp b/frameworks/C++/ulib/src/rfortune.usp deleted file mode 100644 index 51f89828028..00000000000 --- a/frameworks/C++/ulib/src/rfortune.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/rquery.usp b/frameworks/C++/ulib/src/rquery.usp deleted file mode 100644 index 7173c2db981..00000000000 --- a/frameworks/C++/ulib/src/rquery.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/rupdate.usp b/frameworks/C++/ulib/src/rupdate.usp deleted file mode 100644 index de4a0e85549..00000000000 --- a/frameworks/C++/ulib/src/rupdate.usp +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/update.usp b/frameworks/C++/ulib/src/update.usp deleted file mode 100644 index fc24a960a0c..00000000000 --- a/frameworks/C++/ulib/src/update.usp +++ /dev/null @@ -1,99 +0,0 @@ - - - - diff --git a/frameworks/C++/ulib/src/world.h b/frameworks/C++/ulib/src/world.h deleted file mode 100644 index a458e375a34..00000000000 --- a/frameworks/C++/ulib/src/world.h +++ /dev/null @@ -1,368 +0,0 @@ -// world.h - -#ifndef WORLD_H -#define WORLD_H 1 - -#include -#include -#include -#include -#include - -#ifdef U_STATIC_ORM_DRIVER_PGSQL -# include -# include -#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 diff --git a/frameworks/C++/ulib/src/worldNoSql.h b/frameworks/C++/ulib/src/worldNoSql.h deleted file mode 100644 index 58c4df17f54..00000000000 --- a/frameworks/C++/ulib/src/worldNoSql.h +++ /dev/null @@ -1,270 +0,0 @@ -// worldNoSql.h - -#ifndef WORLD_NO_SQL_H -#define WORLD_NO_SQL_H 1 - -#include "world.h" - -#include -#include - -#ifdef USE_MONGODB -# include -#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, rc, UREDISClient); - - 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 diff --git a/frameworks/C++/ulib/ulib-json.dockerfile b/frameworks/C++/ulib/ulib-json.dockerfile deleted file mode 100644 index b7ed9f51c3b..00000000000 --- a/frameworks/C++/ulib/ulib-json.dockerfile +++ /dev/null @@ -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 diff --git a/frameworks/C++/ulib/ulib-json_fit.dockerfile b/frameworks/C++/ulib/ulib-json_fit.dockerfile deleted file mode 100644 index 9d4e97e204f..00000000000 --- a/frameworks/C++/ulib/ulib-json_fit.dockerfile +++ /dev/null @@ -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 diff --git a/frameworks/C++/ulib/ulib-mongodb.dockerfile b/frameworks/C++/ulib/ulib-mongodb.dockerfile deleted file mode 100644 index 7c9e6d9d40a..00000000000 --- a/frameworks/C++/ulib/ulib-mongodb.dockerfile +++ /dev/null @@ -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 diff --git a/frameworks/C++/ulib/ulib-mysql.dockerfile b/frameworks/C++/ulib/ulib-mysql.dockerfile deleted file mode 100644 index b14a0aadb00..00000000000 --- a/frameworks/C++/ulib/ulib-mysql.dockerfile +++ /dev/null @@ -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 diff --git a/frameworks/C++/ulib/ulib-plaintext_fit.dockerfile b/frameworks/C++/ulib/ulib-plaintext_fit.dockerfile deleted file mode 100644 index 68394f88119..00000000000 --- a/frameworks/C++/ulib/ulib-plaintext_fit.dockerfile +++ /dev/null @@ -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 diff --git a/frameworks/C++/ulib/ulib-postgres.dockerfile b/frameworks/C++/ulib/ulib-postgres.dockerfile deleted file mode 100644 index 02fedb51354..00000000000 --- a/frameworks/C++/ulib/ulib-postgres.dockerfile +++ /dev/null @@ -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 diff --git a/frameworks/C++/ulib/ulib-postgres_fit.dockerfile b/frameworks/C++/ulib/ulib-postgres_fit.dockerfile deleted file mode 100644 index 9266d9baa3a..00000000000 --- a/frameworks/C++/ulib/ulib-postgres_fit.dockerfile +++ /dev/null @@ -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 diff --git a/frameworks/C++/ulib/ulib.dockerfile b/frameworks/C++/ulib/ulib.dockerfile deleted file mode 100644 index d9630d12886..00000000000 --- a/frameworks/C++/ulib/ulib.dockerfile +++ /dev/null @@ -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
idmessage