org.apache.htrace.core.Tracer.getCurrentSpan()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中org.apache.htrace.core.Tracer.getCurrentSpan()方法的一些代码示例,展示了Tracer.getCurrentSpan()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tracer.getCurrentSpan()方法的具体详情如下:
包路径:org.apache.htrace.core.Tracer
类名称:Tracer
方法名:getCurrentSpan

Tracer.getCurrentSpan介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

/**
 * Wrapper method to add key-value pair to TraceInfo of actual span
 */
public static void addKVAnnotation(String key, String value){
 Span span = Tracer.getCurrentSpan();
 if (span != null) {
  span.addKVAnnotation(key, value);
 }
}

代码示例来源:origin: apache/hbase

/**
 * Wrapper method to add timeline annotiation to current span with given message
 */
public static void addTimelineAnnotation(String msg) {
 Span span = Tracer.getCurrentSpan();
 if (span != null) {
  span.addTimelineAnnotation(msg);
 }
}

代码示例来源:origin: apache/hbase

/**
 * Default base class constructor.
 */
public EventHandler(Server server, EventType eventType) {
 this.parent = Tracer.getCurrentSpan();
 this.server = server;
 this.eventType = eventType;
 seqid = seqids.incrementAndGet();
 if (server != null) {
  this.waitingTimeForEvents = server.getConfiguration().
    getInt("hbase.master.event.waiting.time", 1000);
 }
}

代码示例来源:origin: apache/hbase

protected Call(int id, final Descriptors.MethodDescriptor md, Message param,
  final CellScanner cells, final Message responseDefaultType, int timeout, int priority,
  RpcCallback<Call> callback, MetricsConnection.CallStats callStats) {
 this.param = param;
 this.md = md;
 this.cells = cells;
 this.callStats = callStats;
 this.callStats.setStartTime(EnvironmentEdgeManager.currentTime());
 this.responseDefaultType = responseDefaultType;
 this.id = id;
 this.timeout = timeout;
 this.priority = priority;
 this.callback = callback;
 this.span = Tracer.getCurrentSpan();
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

LOG.debug("Connecting to "+server);
Span span = Tracer.getCurrentSpan();
if (span != null) {
 span.addTimelineAnnotation("IPC client connecting to " + server);
 span = Tracer.getCurrentSpan();
 if (span != null) {
  span.addTimelineAnnotation("IPC client connected to " + server);

代码示例来源:origin: apache/hbase

TraceUtil.addSampler(loopSampler);
for (int i = 0; i < numIterations; ++i) {
 assert Tracer.getCurrentSpan() == threadScope.getSpan() : "Span leak detected.";
 try (TraceScope loopScope = TraceUtil.createTrace("runLoopIter" + i)) {
  long now = System.nanoTime();

代码示例来源:origin: org.apache.hadoop/hadoop-common

Span span = Tracer.getCurrentSpan();
if (span != null) {
 result.setTraceInfo(RPCTraceInfoProto.newBuilder()

代码示例来源:origin: org.apache.hbase/hbase-client

protected Call(int id, final Descriptors.MethodDescriptor md, Message param,
  final CellScanner cells, final Message responseDefaultType, int timeout, int priority,
  RpcCallback<Call> callback, MetricsConnection.CallStats callStats) {
 this.param = param;
 this.md = md;
 this.cells = cells;
 this.callStats = callStats;
 this.callStats.setStartTime(EnvironmentEdgeManager.currentTime());
 this.responseDefaultType = responseDefaultType;
 this.id = id;
 this.timeout = timeout;
 this.priority = priority;
 this.callback = callback;
 this.span = Tracer.getCurrentSpan();
}

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

Span span = Tracer.getCurrentSpan();
if (span != null) {
 span.addKVAnnotation("maxWriteToDiskMs",

代码示例来源:origin: org.apache.hbase/hbase-common

/**
 * Wrapper method to add key-value pair to TraceInfo of actual span
 */
public static void addKVAnnotation(String key, String value){
 Span span = Tracer.getCurrentSpan();
 if (span != null) {
  span.addKVAnnotation(key, value);
 }
}

代码示例来源:origin: org.apache.hbase/hbase-common

/**
 * Wrapper method to add timeline annotiation to current span with given message
 */
public static void addTimelineAnnotation(String msg) {
 Span span = Tracer.getCurrentSpan();
 if (span != null) {
  span.addTimelineAnnotation(msg);
 }
}

代码示例来源:origin: com.aliyun.hbase/alihbase-common

/**
 * Wrapper method to add timeline annotiation to current span with given message
 */
public static void addTimelineAnnotation(String msg) {
 Span span = Tracer.getCurrentSpan();
 if (span != null) {
  span.addTimelineAnnotation(msg);
 }
}

代码示例来源:origin: com.aliyun.hbase/alihbase-common

/**
 * Wrapper method to add key-value pair to TraceInfo of actual span
 */
public static void addKVAnnotation(String key, String value){
 Span span = Tracer.getCurrentSpan();
 if (span != null) {
  span.addKVAnnotation(key, value);
 }
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

protected Call(int id, final Descriptors.MethodDescriptor md, Message param,
  final CellScanner cells, final Message responseDefaultType, int timeout, int priority,
  RpcCallback<Call> callback, MetricsConnection.CallStats callStats) {
 this.param = param;
 this.md = md;
 this.cells = cells;
 this.callStats = callStats;
 this.callStats.setStartTime(EnvironmentEdgeManager.currentTime());
 this.responseDefaultType = responseDefaultType;
 this.id = id;
 this.timeout = timeout;
 this.priority = priority;
 this.callback = callback;
 this.span = Tracer.getCurrentSpan();
}

代码示例来源:origin: apache/incubator-htrace

@Override
 public SpanId call() throws Exception {
  return Tracer.getCurrentSpan().getParents()[0];
 }
}, "child");

代码示例来源:origin: apache/incubator-htrace

@Override
 public void run() {
  description.set(Tracer.getCurrentSpan().getDescription());
 }
}).get(WAIT_TIME_SECONDS, TimeUnit.SECONDS);

代码示例来源:origin: apache/incubator-htrace

@Override
 public String call() throws Exception {
  return Tracer.getCurrentSpan().getDescription();
 }
}).get(WAIT_TIME_SECONDS, TimeUnit.SECONDS);

代码示例来源:origin: apache/incubator-htrace

@Override
 public String call() throws InterruptedException {
  startLatch.countDown();
  // Prevent any task from exiting until every task has started
  assertTrue(continueLatch.await(WAIT_TIME_SECONDS, TimeUnit.SECONDS));
  // Annotate on the presumed child trace
  Tracer.getCurrentSpan().addTimelineAnnotation(
    Thread.currentThread().getName());
  return Tracer.getCurrentSpan().getDescription();
 }
};

代码示例来源:origin: apache/incubator-htrace

public void pretendRpcSend() {
 Span span = tracer.getCurrentSpan();
 pretendRpcReceiveWithTraceInfo(span.getSpanId());
}

代码示例来源:origin: io.hops/hadoop-common

Span span = Tracer.getCurrentSpan();
if (span != null) {
 result.setTraceInfo(RPCTraceInfoProto.newBuilder()

相关文章