leaf-potato commented on issue #2244:
URL: https://github.com/apache/brpc/issues/2244#issuecomment-1817802398

   > 
![image](https://user-images.githubusercontent.com/126752534/281655776-a7eafedf-b1fc-4575-9e10-2f3db7ed2b00.png)
   > 
   > 这个Flags使用是在main函数之前的,所以在main函数之后任何对其操作貌似都不会关闭统计线程。
   
   
注释想表法:`SamplerCollector`单例在main函数之前构造的&启动了线程,所以flag实现不能放在`SamplerCollector`类中,因为不会生效。所以才放到了`Sampler::schedule`函数这儿控制。
   
   另外在`echo_c++`例子中使用下面两种方式看着都可以正确关闭:
   1. `bvar::detail::FLAGS_bvar_enable_sampling = false;`
   2. `google::SetCommandLineOption("bvar_enable_sampling", "false");`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to