honganan opened a new issue #6836:
URL: https://github.com/apache/skywalking/issues/6836


   I have some questions about the agent sampling logic when I'm reading the 
code of `SamplingService.java` today:
   
   1. I don't see the effect of `forceSampled()` method. It just increase the 
`samplingFactorHolder`, but the vacancy space it left can not be used by 
current request. The only effect it seems just making the sampling result count 
decrease 1 in current period, And the current request still need to compete for 
sampling in high concurrency scenario, it seems not so helpful for current 
request's sampling.
   2. The `trySampling` method use CAS, In extreme situation, It may result in 
some requests be ignored but sum of  the sampled requests even less than the 
threshold set by `SAMPLE_N_PER_3_SECS` in this period. Will it?


-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to