brave.Tracing.close()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(171)

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

Tracing.close介绍

[英]Ensures this component can be garbage collected, by making it not #current()
[中]确保此组件可以被垃圾收集,方法是使其不为#current()

代码示例

代码示例来源:origin: openzipkin/brave

@Override protected void destroyInstance(Object instance) {
 ((Tracing) instance).close();
}

代码示例来源:origin: openzipkin/brave

/**
 * This closes the current instance of tracing, to prevent it from being accidentally visible to
 * other test classes which call {@link Tracing#current()}.
 */
@After public void close() throws Exception {
 Tracing current = Tracing.current();
 if (current != null) current.close();
}

代码示例来源:origin: openzipkin/brave

@TearDown(Level.Trial) public void close() {
 Tracing.current().close();
}

代码示例来源:origin: openzipkin/brave

@TearDown(Level.Trial) public void close() {
 Tracing.current().close();
}

代码示例来源:origin: openzipkin/brave

@TearDown(Level.Trial) public void close() {
 Tracing.current().close();
}

代码示例来源:origin: openzipkin/brave

@TearDown(Level.Trial) public void close() {
 Tracing.current().close();
}

代码示例来源:origin: openzipkin/brave

@TearDown(Level.Trial) public void close() throws Exception {
 if (server != null) server.stop();
 client.dispatcher().executorService().shutdown();
 if (Tracing.current() != null) Tracing.current().close();
}

代码示例来源:origin: line/armeria

@After
public void tearDown() {
  Tracing.current().close();
}

代码示例来源:origin: line/armeria

@After
public void tearDown() {
  Tracing.current().close();
}

代码示例来源:origin: line/armeria

@After
public void tearDown() {
  Tracing.current().close();
}

代码示例来源:origin: openzipkin/brave

@TearDown(Level.Trial) public void close() throws Exception {
 close(client);
 close(unsampledClient);
 close(tracedClient);
 server.stop();
 Tracing.current().close();
}

代码示例来源:origin: com.smoketurner.dropwizard/zipkin-core

@Override
 public void stop() throws Exception {
  tracing.close();
 }
});

代码示例来源:origin: io.zipkin.brave/brave-spring-beans

@Override protected void destroyInstance(Object instance) {
 ((Tracing) instance).close();
}

代码示例来源:origin: io.zipkin.brave/brave-instrumentation-http-tests

/**
 * This closes the current instance of tracing, to prevent it from being accidentally visible to
 * other test classes which call {@link Tracing#current()}.
 */
@After public void close() throws Exception {
 Tracing current = Tracing.current();
 if (current != null) current.close();
}

代码示例来源:origin: jaegertracing/spark-dependencies

@Test
public void testZipkinMultipleTraces() throws Exception {
 TreeGenerator<Tracing> treeGenerator = new TreeGenerator(TracersGenerator.generateZipkin(5, zipkinCollectorUrl));
 Map<String, Map<String, Long>> expectedDependencies = new LinkedHashMap<>();
 for (int i = 0; i < 20; i++) {
  Node<ZipkinWrapper> root = treeGenerator.generateTree(50, 3);
  DependencyLinkDerivator.serviceDependencies(root, expectedDependencies);
  Traversals.postOrder(root, (node, parent) -> node.getTracingWrapper().get().getSpan().finish());
  waitBetweenTraces();
  waitJaegerQueryContains(root.getServiceName(), root.getTracingWrapper().operationName());
 }
 treeGenerator.getTracers().forEach(tracer -> {
  tracer.getTracer().close();
  tracer.flushable().flush();
 });
 deriveDependencies();
 assertDependencies(expectedDependencies);
}

代码示例来源:origin: jaegertracing/spark-dependencies

@Test
public void testZipkinOneTrace() throws Exception {
 TreeGenerator<Tracing> treeGenerator = new TreeGenerator(TracersGenerator.generateZipkin(2, zipkinCollectorUrl));
 Node<ZipkinWrapper> root = treeGenerator.generateTree(50, 3);
 Traversals.postOrder(root, (node, parent) -> node.getTracingWrapper().get().getSpan().finish());
 waitBetweenTraces();
 treeGenerator.getTracers().forEach(tracer -> {
  tracer.getTracer().close();
  // tracer.close does not seem to flush all data
  tracer.flushable().flush();
 });
 waitJaegerQueryContains(root.getServiceName(), root.getTracingWrapper().operationName());
 deriveDependencies();
 assertDependencies(DependencyLinkDerivator.serviceDependencies(root));
}

代码示例来源:origin: jaegertracing/spark-dependencies

@Test
public void testZipkinOneTraceFixed6NodesTwoTracers() throws Exception {
 Tuple<Tracing, Flushable> rootTuple = TracersGenerator.createZipkin("root", zipkinCollectorUrl);
 Tuple<Tracing, Flushable> tracer2 = TracersGenerator.createZipkin("tracer2", zipkinCollectorUrl);
 Node<ZipkinWrapper> root = new Node<>(new ZipkinWrapper(rootTuple.getA(), "root"), null);
 Node<ZipkinWrapper> child11 = new Node<>(new ZipkinWrapper(tracer2.getA(), "tracer2"), root);
 new Node<>(new ZipkinWrapper(tracer2.getA(), "tracer2"), root);
 new Node<>(new ZipkinWrapper(tracer2.getA(), "tracer2"), root);
 new Node<>(new ZipkinWrapper(tracer2.getA(), "tracer2"), child11);
 new Node<>(new ZipkinWrapper(tracer2.getA(), "tracer2"), child11);
 Traversals.postOrder(root, (node, parent) -> node.getTracingWrapper().get().getSpan().finish());
 rootTuple.getA().close();
 tracer2.getA().close();
 waitBetweenTraces();
 waitJaegerQueryContains(root.getServiceName(), root.getTracingWrapper().operationName());
 deriveDependencies();
 assertDependencies(DependencyLinkDerivator.serviceDependencies(root));
}

相关文章