zifeihan commented on a change in pull request #6232:
URL: https://github.com/apache/skywalking/pull/6232#discussion_r560210602
##########
File path:
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/sampling/SamplingService.java
##########
@@ -106,12 +103,32 @@ public boolean trySampling(String operationName) {
* sampled, the trace beginning at local, has less chance to be sampled.
*/
public void forceSampled() {
- if (on) {
+ if (samplingRateWatcher.getSamplingRate() > 0) {
samplingFactorHolder.incrementAndGet();
}
}
private void resetSamplingFactor() {
samplingFactorHolder = new AtomicInteger(0);
}
+
+ /**
+ * reset ScheduledFuture to support samplingRate changed.
+ */
+ void resetScheduledFuture() {
+ if (scheduledFuture != null) {
+ scheduledFuture.cancel(true);
+ }
Review comment:
fixed.
----------------------------------------------------------------
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]