public interface Sampler<T>
public boolean next(T info) {
if (info == null) {
return false;
} else if (info.getName().equals("get")) {
return Math.random() > 0.5;
} else if (info.getName().equals("put")) {
return Math.random() > 0.25;
} else {
return false;
}
}
This would trace 50% of all gets, 75% of all puts and would not trace any other requests.Copyright © 2015 The Apache Software Foundation. All Rights Reserved.