本文整理了Java中org.apache.htrace.core.Tracer.getTracerPool()
方法的一些代码示例,展示了Tracer.getTracerPool()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tracer.getTracerPool()
方法的具体详情如下:
包路径:org.apache.htrace.core.Tracer
类名称:Tracer
方法名:getTracerPool
暂无
代码示例来源:origin: apache/hbase
/**
* Wrapper method to remove receiver from actual tracerpool
* @return true if removed, false if doesn't exist
*/
public static boolean removeReceiver(SpanReceiver rcvr) {
return (tracer == null) ? false : tracer.getTracerPool().removeReceiver(rcvr);
}
代码示例来源:origin: apache/hbase
/**
* Wrapper method to add receiver to actual tracerpool
* @return true if successfull, false if it was already added
*/
public static boolean addReceiver(SpanReceiver rcvr) {
return (tracer == null) ? false : tracer.getTracerPool().addReceiver(rcvr);
}
代码示例来源:origin: org.apache.hbase/hbase-common
/**
* Wrapper method to add receiver to actual tracerpool
* @return true if successfull, false if it was already added
*/
public static boolean addReceiver(SpanReceiver rcvr) {
return (tracer == null) ? false : tracer.getTracerPool().addReceiver(rcvr);
}
代码示例来源:origin: org.apache.hbase/hbase-common
/**
* Wrapper method to remove receiver from actual tracerpool
* @return true if removed, false if doesn't exist
*/
public static boolean removeReceiver(SpanReceiver rcvr) {
return (tracer == null) ? false : tracer.getTracerPool().removeReceiver(rcvr);
}
代码示例来源:origin: com.aliyun.hbase/alihbase-common
/**
* Wrapper method to remove receiver from actual tracerpool
* @return true if removed, false if doesn't exist
*/
public static boolean removeReceiver(SpanReceiver rcvr) {
return (tracer == null) ? false : tracer.getTracerPool().removeReceiver(rcvr);
}
代码示例来源:origin: com.aliyun.hbase/alihbase-common
/**
* Wrapper method to add receiver to actual tracerpool
* @return true if successfull, false if it was already added
*/
public static boolean addReceiver(SpanReceiver rcvr) {
return (tracer == null) ? false : tracer.getTracerPool().addReceiver(rcvr);
}
代码示例来源:origin: apache/incubator-htrace
private List<SpanReceiver> createSpanReceivers(String classes) {
Tracer tracer = new Tracer.Builder().
name("MyTracer").
tracerPool(new TracerPool("createSpanReceivers")).
conf(HTraceConfiguration.fromKeyValuePairs(
"span.receiver.classes", classes)).
build();
SpanReceiver[] receivers = tracer.getTracerPool().getReceivers();
tracer.close();
LinkedList<SpanReceiver> receiverList = new LinkedList<SpanReceiver>();
for (SpanReceiver item: receivers) {
receiverList.add(item);
}
return receiverList;
}
代码示例来源:origin: apache/incubator-htrace
POJOSpanReceiver receiver =
new POJOSpanReceiver(HTraceConfiguration.EMPTY);
tracer.getTracerPool().addReceiver(receiver);
TraceCreator traceCreator = new TraceCreator(tracer);
traceCreator.createSampleRpcTrace();
代码示例来源:origin: apache/incubator-htrace
@Test
public void TestTracerCreateAndClose() throws Exception {
Tracer tracer = new Tracer.Builder().
name("TestSimpleScope").
tracerPool(new TracerPool("TestTracerCreateAndClose")).
conf(HTraceConfiguration.fromKeyValuePairs(
"sampler.classes", "AlwaysSampler")).
build();
POJOSpanReceiver receiver =
new POJOSpanReceiver(HTraceConfiguration.EMPTY);
tracer.getTracerPool().addReceiver(receiver);
tracer.close();
Assert.assertTrue(receiver.getSpans().isEmpty());
}
代码示例来源:origin: apache/incubator-htrace
@Test
public void TestSimpleScope() throws Exception {
Tracer tracer = new Tracer.Builder().
name("TestSimpleScope").
tracerPool(new TracerPool("TestSimpleScope")).
conf(HTraceConfiguration.fromKeyValuePairs(
"sampler.classes", "AlwaysSampler")).
build();
POJOSpanReceiver receiver =
new POJOSpanReceiver(HTraceConfiguration.EMPTY);
tracer.getTracerPool().addReceiver(receiver);
TraceScope scope = tracer.newScope("Foo");
scope.close();
tracer.close();
Assert.assertEquals(1, receiver.getSpans().size());
Span span = receiver.getSpans().iterator().next();
Assert.assertEquals(0, span.getParents().length);
}
代码示例来源:origin: apache/incubator-htrace
POJOSpanReceiver receiver =
new POJOSpanReceiver(HTraceConfiguration.EMPTY);
tracer.getTracerPool().addReceiver(receiver);
final ScopeHolder scopeHolder = new ScopeHolder();
Thread th = new Thread(new Runnable() {
内容来源于网络,如有侵权,请联系作者删除!