[PR #1] Interface should not use the impl instead of the interface

This commit is contained in:
Guillaume Polaert 2017-05-03 10:01:33 +02:00
parent 7031ff1976
commit 4cc2b46295
3 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
package com.datadoghq.trace;
import com.datadoghq.trace.impl.DDSpan;
import io.opentracing.Span;
/**
* Main interface to sample a collection of traces.
@ -14,6 +14,6 @@ public interface Sampler {
* @param span the parent span with its context
* @return true when the trace/spans has to be reported/written
*/
boolean sample(DDSpan span);
boolean sample(Span span);
}

View File

@ -1,6 +1,7 @@
package com.datadoghq.trace.impl;
import com.datadoghq.trace.Sampler;
import io.opentracing.Span;
/**
* Sampler that always says yes...
@ -8,7 +9,7 @@ import com.datadoghq.trace.Sampler;
public class AllSampler implements Sampler {
@Override
public boolean sample(DDSpan span) {
public boolean sample(Span span) {
return true;
}

View File

@ -2,6 +2,7 @@ package com.datadoghq.trace.impl;
import com.datadoghq.trace.Sampler;
import io.opentracing.Span;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -41,7 +42,7 @@ public class RateSampler implements Sampler {
}
@Override
public boolean sample(DDSpan span) {
public boolean sample(Span span) {
boolean sample = Math.random() <= this.sampleRate;
logger.debug("{} - Span is sampled: {}", span, sample);
return sample;