You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "antkiller996 (via GitHub)" <gi...@apache.org> on 2023/12/01 05:30:02 UTC

Re: [I] 为什么代码方式关闭不了bvar sampling线程? (brpc)

antkiller996 commented on issue #2244:
URL: https://github.com/apache/brpc/issues/2244#issuecomment-1835488939

   > > ![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");`
   
   我使用的是1.6.0版本,还是关闭不了。


-- 
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-unsubscribe@brpc.apache.org

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


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