From 82ce053f67b78b03d89641a2ee53b7825c2b2fa9 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Thu, 25 Jan 2024 10:20:09 +0800 Subject: Bugfix: rapidjson序列化时导致单核CPU使用率100% MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- src/tsg_send_log.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c1b56f2..d8a3237 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ SI/* .vscode/* -build/ +build*/ cmake-build-* *.si4project diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index bac824d..62bb7e2 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -1186,7 +1186,7 @@ struct TLD_handle_t *TLD_create(int thread_id) int TLD_convert_json(struct TLD_handle_t *_handle, char *buff, unsigned int buff_len) { - StringBuffer sb(0, 2048); + StringBuffer sb(0, g_tsg_log_instance->rapidjson_chunk_capacity); Writer writer(sb); _handle->document->Accept(writer); @@ -2192,7 +2192,7 @@ int send_log_by_type(struct tsg_log_instance_t *_instance, struct TLD_handle_t * ); } - StringBuffer sb(0, 2048); + StringBuffer sb(0, _instance->rapidjson_chunk_capacity); Writer writer(sb); _handle->document->Accept(writer); -- cgit v1.2.3