blob: aae231c74bc02324ab3beae6d53e67d1d5a436f2 [file] [log] [blame]
package org.cloudera.htrace.impl;
import org.cloudera.htrace.Sampler;
import org.cloudera.htrace.Trace;
/**
* A Sampler that returns true if and only if tracing is on the current thread.
*/
public class TrueIfTracingSampler implements Sampler<Object> {
public static final TrueIfTracingSampler INSTANCE = new TrueIfTracingSampler();
private TrueIfTracingSampler() {
}
@Override
public boolean next(Object info) {
return Trace.isTracing();
}
}