Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getSampler(serviceName) {
if (isFunction(this.settings.sampler))
return this.settings.sampler;
if (this.settings.sampler.type == "RateLimiting")
return new Jaeger.RateLimitingSampler(this.settings.sampler.options.maxTracesPerSecond, this.settings.sampler.options.initBalance);
if (this.settings.sampler.type == "Probabilistic")
return new Jaeger.ProbabilisticSampler(this.settings.sampler.options.samplingRate);
if (this.settings.sampler.type == "GuaranteedThroughput")
return new GuaranteedThroughputSampler(this.settings.sampler.options.lowerBound, this.settings.sampler.options.samplingRate);
if (this.settings.sampler.type == "RemoteControlled")
return new RemoteControlledSampler(serviceName, this.settings.sampler.options);
return new Jaeger.ConstSampler(this.settings.sampler.options && this.settings.sampler.options.decision != null ? this.settings.sampler.options.decision : 1);
},