From 65b5fcdb2e74caeeae63a47f0674357ff4816efa Mon Sep 17 00:00:00 2001 From: HU Date: Mon, 1 Aug 2022 10:15:44 +0800 Subject: [PATCH] fix #1973 (#1863) Co-authored-by: XiguoHu --- src/bvar/detail/sampler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bvar/detail/sampler.cpp b/src/bvar/detail/sampler.cpp index 3a14b375da..9887539f15 100644 --- a/src/bvar/detail/sampler.cpp +++ b/src/bvar/detail/sampler.cpp @@ -17,6 +17,7 @@ // Date: Tue Jul 28 18:14:40 CST 2015 +#include #include "butil/time.h" #include "butil/memory/singleton_on_pthread_once.h" #include "bvar/reducer.h" @@ -127,7 +128,11 @@ static PassiveStatus* s_cumulated_time_bvar = NULL; static bvar::PerSecond >* s_sampling_thread_usage_bvar = NULL; #endif +DEFINE_int32(bvar_sampler_thread_start_delay_us, 10000, "bvar sampler thread start delay us"); + void SamplerCollector::run() { + ::usleep(FLAGS_bvar_sampler_thread_start_delay_us); + #ifndef UNIT_TEST // NOTE: // * Following vars can't be created on thread's stack since this thread