This is an automated email from the ASF dual-hosted git repository.
guangmingchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 0959e5d6 Add flag for brpc timer buckets count (#3112)
0959e5d6 is described below
commit 0959e5d639de8095975d5ca0de80ae65fdba630c
Author: Yang,Liming <[email protected]>
AuthorDate: Sun Oct 5 13:34:54 2025 +0800
Add flag for brpc timer buckets count (#3112)
---
src/bthread/timer_thread.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/bthread/timer_thread.cpp b/src/bthread/timer_thread.cpp
index 8d61b857..bd1f4870 100644
--- a/src/bthread/timer_thread.cpp
+++ b/src/bthread/timer_thread.cpp
@@ -19,6 +19,7 @@
#include <queue> // heap functions
+#include <gflags/gflags.h>
#include "butil/scoped_lock.h"
#include "butil/logging.h"
#include "butil/third_party/murmurhash3/murmurhash3.h" // fmix64
@@ -31,6 +32,8 @@
namespace bthread {
+DEFINE_uint32(brpc_timer_num_buckets, 13, "brpc timer num buckets");
+
// Defined in task_control.cpp
void run_worker_startfn();
@@ -469,6 +472,7 @@ static void init_global_timer_thread() {
}
TimerThreadOptions options;
options.bvar_prefix = "bthread_timer";
+ options.num_buckets = FLAGS_brpc_timer_num_buckets;
const int rc = g_timer_thread->start(&options);
if (rc != 0) {
LOG(FATAL) << "Fail to start timer_thread, " << berror(rc);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]