Browse Source

[Update Paozhu] Update built-in variables (#9746)

* Paozhu update

* Update orm file

* [Paozhu] update orm file

* update paozhu

* update paozhu
Huang ziquan 4 months ago
parent
commit
a0ebdee082

+ 4 - 0
frameworks/C++/paozhu/paozhu_benchmark/common/cost_define.h

@@ -9,8 +9,12 @@
 #define CONST_HTTP_BODY_POST_SIZE 33554432
 #define CONST_HTTP_JSON_POST_SIZE 2097152
 
+#define CONST_HTTP2_SlEEP_MIN_TIME 1100000
+
 #define CONST_ORM_CLEAR_TIME 7200
 #define CONST_ORM_CLEAR_NUMBER 1024
 #define CONST_ORM_QUERY_CONNECT_TIMEOUT 30
+#define CONST_ORM_QUERY_LOG_TIME 30
 
+#define COOKIE_SESSION_NAME "PHPSESSID"
 #endif

+ 8 - 3
frameworks/C++/paozhu/paozhu_benchmark/controller/src/techempower.cpp

@@ -6,6 +6,7 @@
 #include <chrono>
 #include "httppeer.h"
 #include "techempower.h"
+#include "request.h"
 #include "techempower_json.h"
 #include "datetime.h"
 #include "func.h"
@@ -43,6 +44,7 @@ asio::awaitable<std::string> techempowerdb(std::shared_ptr<httppeer> peer)
     myworld.where("id", rd_num);
     myworld.limit(1);
     co_await myworld.async_fetch_one();
+
     peer->output = myworld.data_tojson();
     co_return "";
 }
@@ -64,6 +66,7 @@ asio::awaitable<std::string> techempowerqueries(std::shared_ptr<httppeer> peer)
     }
     auto myworld = orm::World();
     myworld.record.reserve(get_num);
+    myworld.lock_conn();
     for (unsigned int i = 0; i < get_num; i++)
     {
         myworld.wheresql.clear();
@@ -71,7 +74,7 @@ asio::awaitable<std::string> techempowerqueries(std::shared_ptr<httppeer> peer)
         myworld.where("id", rd_num);
         co_await myworld.async_fetch_append();
     }
-
+    myworld.unlock_conn();
     peer->output = myworld.to_json();
     co_return "";
 }
@@ -91,7 +94,7 @@ asio::awaitable<std::string> techempowerfortunes(std::shared_ptr<httppeer> peer)
     std::sort(myfortune.record.begin(), myfortune.record.end(), [](const auto &lhs, const auto &rhs)
               { return lhs.message < rhs.message; });
     peer->val["list"].set_array();
-    OBJ_ARRAY item;
+    obj_val item;
     for (unsigned int i = 0; i < myfortune.record.size(); i++)
     {
         item["id"]      = myfortune.record[i].id;
@@ -126,6 +129,7 @@ asio::awaitable<std::string> techempowerupdates(std::shared_ptr<httppeer> peer)
     auto myworld = orm::World();
     myworld.record.clear();
     myworld.record.reserve(get_num);
+    myworld.lock_conn();
     for (unsigned int i = 0; i < get_num; i++)
     {
         myworld.wheresql.clear();
@@ -139,6 +143,7 @@ asio::awaitable<std::string> techempowerupdates(std::shared_ptr<httppeer> peer)
             co_await myworld.async_update("randomnumber");
         }
     }
+    myworld.unlock_conn();
     peer->output = myworld.to_json();
     co_return "";
 }
@@ -247,4 +252,4 @@ asio::awaitable<std::string> techempowercached_db(std::shared_ptr<httppeer> peer
     co_return "";
 }
 
-}// namespace http
+}// namespace http

File diff suppressed because it is too large
+ 165 - 188
frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortune_mysql.h


+ 1 - 1
frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortunebase.h

@@ -2,7 +2,7 @@
 #define ORM_DEFAULT_FORTUNEBASEMATA_H
 /*
 *This file is auto create from cli
-*本文件为自动生成 Thu, 13 Mar 2025 08:50:20 GMT
+*本文件为自动生成 Wed, 26 Mar 2025 14:12:09 GMT
 ***/
 #include <iostream>
 #include <cstdio>

File diff suppressed because it is too large
+ 165 - 188
frameworks/C++/paozhu/paozhu_benchmark/orm/include/world_mysql.h


+ 1 - 1
frameworks/C++/paozhu/paozhu_benchmark/orm/include/worldbase.h

@@ -2,7 +2,7 @@
 #define ORM_DEFAULT_WORLDBASEMATA_H
 /*
 *This file is auto create from cli
-*本文件为自动生成 Thu, 13 Mar 2025 08:50:20 GMT
+*本文件为自动生成 Wed, 26 Mar 2025 14:12:09 GMT
 ***/
 #include <iostream>
 #include <cstdio>

+ 1 - 1
frameworks/C++/paozhu/paozhu_benchmark/view/techempower/fortunes.html

@@ -1,5 +1,5 @@
 <!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr><%c
     for(auto &a:obj["list"].as_array()){
-%><tr><td><%c echo<<a.second["id"].to_string(); %></td><td><%c echo<<a.second["message"].to_string(); %></td></tr><%c
+%><tr><td><%c echo<<a["id"].to_string(); %></td><td><%c echo<<a["message"].to_string(); %></td></tr><%c
     }
 %></table></body></html>

+ 1 - 1
frameworks/C++/paozhu/paozhu_benchmark/viewsrc/include/regviewmethod.hpp

@@ -17,7 +17,7 @@ namespace http
 {
   void _initview_method_regto(VIEW_REG  &_viewmetholdreg)
   {
-            	 //create time: Mon, 30 Dec 2024 15:45:45 GMT
+            	 //create time: Thu, 27 Mar 2025 01:00:54 GMT
 
 	_viewmetholdreg.emplace("techempower/fortunes",http::view::techempower::fortunes);
 

+ 1 - 1
frameworks/C++/paozhu/paozhu_benchmark/viewsrc/include/viewsrc.h

@@ -16,7 +16,7 @@ namespace view {
 
 namespace techempower{ 
 
-	std::string fortunes(const struct view_param &vinfo,http::OBJ_VALUE &obj);
+	std::string fortunes(const struct view_param &vinfo,http::obj_val &obj);
 }
 
 

+ 3 - 3
frameworks/C++/paozhu/paozhu_benchmark/viewsrc/view/techempower/fortunes.cpp

@@ -21,7 +21,7 @@ namespace http {
 
 namespace view {
 	namespace techempower{
- 		 std::string fortunes([[maybe_unused]] const struct view_param &vinfo,[[maybe_unused]] http::OBJ_VALUE &obj)
+ 		 std::string fortunes([[maybe_unused]] const struct view_param &vinfo,[[maybe_unused]] http::obj_val &obj)
 			{
  
                      std::ostringstream echo;
@@ -32,9 +32,9 @@ namespace view {
     for(auto &a:obj["list"].as_array()){
 
  			 echo<<"<tr><td>";
- echo<<a.second["id"].to_string(); 
+ echo<<a["id"].to_string(); 
  			 echo<<"</td><td>";
- echo<<a.second["message"].to_string(); 
+ echo<<a["message"].to_string(); 
  			 echo<<"</td></tr>";
 
     }

Some files were not shown because too many files changed in this diff