public boolean shouldSample(String service, int sample, int duration) {
        SamplingPolicy samplingPolicy = this.samplingPolicySettings.get().get(service);
        if (samplingPolicy == null) {
            return shouldSampleByDefault(sample, duration);
        }
        return shouldSampleService(samplingPolicy, sample, duration);
    }
Determine whether need to be sampled

@param service  service's name
@param sample   sample rate of trace segment
@param duration duration of trace segment
@return
oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/TraceSamplingPolicyWatcher.java