Skip to content

Commit 929d0d1

Browse files
authored
Merge pull request #45 from TechEmpower/master
aa
2 parents 1934cb5 + a0ebdee commit 929d0d1

File tree

184 files changed

+5544
-3482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+5544
-3482
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
# run-ci.py runs the diffing to see if github actions needs to test this framework. Ideally/eventually,
156156
# we'd like to try and do the diffing before github_actions_clean & setup.
157157
# This will run the tests exactly as you would in your own vm:
158-
docker network create tfb > /dev/null 2>&1 && docker run --network=tfb -e USER_ID=$(id -u) -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source=`pwd`,target=/FrameworkBenchmarks techempower/tfb --mode verify --test-dir $RUN_TESTS --results-environment Github-Actions;
158+
docker network create tfb > /dev/null 2>&1 && docker run --network=tfb -e USER_ID=$(id -u) -e CI=true -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source=`pwd`,target=/FrameworkBenchmarks techempower/tfb --mode verify --test-dir $RUN_TESTS --results-environment Github-Actions;
159159
dependabot:
160160
needs: verify
161161
runs-on: ubuntu-latest

frameworks/C++/paozhu/paozhu_benchmark/common/cost_define.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
#define CONST_HTTP_BODY_POST_SIZE 33554432
1010
#define CONST_HTTP_JSON_POST_SIZE 2097152
1111

12+
#define CONST_HTTP2_SlEEP_MIN_TIME 1100000
13+
1214
#define CONST_ORM_CLEAR_TIME 7200
1315
#define CONST_ORM_CLEAR_NUMBER 1024
1416
#define CONST_ORM_QUERY_CONNECT_TIMEOUT 30
17+
#define CONST_ORM_QUERY_LOG_TIME 30
1518

19+
#define COOKIE_SESSION_NAME "PHPSESSID"
1620
#endif

frameworks/C++/paozhu/paozhu_benchmark/controller/src/techempower.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <chrono>
77
#include "httppeer.h"
88
#include "techempower.h"
9+
#include "request.h"
910
#include "techempower_json.h"
1011
#include "datetime.h"
1112
#include "func.h"
@@ -43,6 +44,7 @@ asio::awaitable<std::string> techempowerdb(std::shared_ptr<httppeer> peer)
4344
myworld.where("id", rd_num);
4445
myworld.limit(1);
4546
co_await myworld.async_fetch_one();
47+
4648
peer->output = myworld.data_tojson();
4749
co_return "";
4850
}
@@ -64,14 +66,15 @@ asio::awaitable<std::string> techempowerqueries(std::shared_ptr<httppeer> peer)
6466
}
6567
auto myworld = orm::World();
6668
myworld.record.reserve(get_num);
69+
myworld.lock_conn();
6770
for (unsigned int i = 0; i < get_num; i++)
6871
{
6972
myworld.wheresql.clear();
7073
unsigned int rd_num = rand_range(1, 10000);
7174
myworld.where("id", rd_num);
7275
co_await myworld.async_fetch_append();
7376
}
74-
77+
myworld.unlock_conn();
7578
peer->output = myworld.to_json();
7679
co_return "";
7780
}
@@ -91,7 +94,7 @@ asio::awaitable<std::string> techempowerfortunes(std::shared_ptr<httppeer> peer)
9194
std::sort(myfortune.record.begin(), myfortune.record.end(), [](const auto &lhs, const auto &rhs)
9295
{ return lhs.message < rhs.message; });
9396
peer->val["list"].set_array();
94-
OBJ_ARRAY item;
97+
obj_val item;
9598
for (unsigned int i = 0; i < myfortune.record.size(); i++)
9699
{
97100
item["id"] = myfortune.record[i].id;
@@ -126,6 +129,7 @@ asio::awaitable<std::string> techempowerupdates(std::shared_ptr<httppeer> peer)
126129
auto myworld = orm::World();
127130
myworld.record.clear();
128131
myworld.record.reserve(get_num);
132+
myworld.lock_conn();
129133
for (unsigned int i = 0; i < get_num; i++)
130134
{
131135
myworld.wheresql.clear();
@@ -139,6 +143,7 @@ asio::awaitable<std::string> techempowerupdates(std::shared_ptr<httppeer> peer)
139143
co_await myworld.async_update("randomnumber");
140144
}
141145
}
146+
myworld.unlock_conn();
142147
peer->output = myworld.to_json();
143148
co_return "";
144149
}
@@ -247,4 +252,4 @@ asio::awaitable<std::string> techempowercached_db(std::shared_ptr<httppeer> peer
247252
co_return "";
248253
}
249254

250-
}// namespace http
255+
}// namespace http

0 commit comments

Comments
 (0)