From bade70cf3b7b55c61879b2773910606e2fa1b76c Mon Sep 17 00:00:00 2001 From: Yang Liming Date: Tue, 30 Sep 2025 14:19:58 +0800 Subject: [PATCH] add flag for brpc timer buckets count --- 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 8d61b85735..bd1f4870c1 100644 --- a/src/bthread/timer_thread.cpp +++ b/src/bthread/timer_thread.cpp @@ -19,6 +19,7 @@ #include // heap functions +#include #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);