This is an automated email from the ASF dual-hosted git repository. wusheng pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git
The following commit(s) were added to refs/heads/master by this push: new daceca2 add doc for TraceCrossThread (#1067) daceca2 is described below commit daceca28eef61ba08f99e18b1ba23789b9f62db2 Author: carlvine500 <carlvine...@163.com> AuthorDate: Fri Apr 13 08:57:06 2018 +0800 add doc for TraceCrossThread (#1067) * add doc for TraceCrossThread --- docs/README.md | 1 + docs/README_ZH.md | 3 +- .../Application-toolkit-trace-cross-thread-CN.md | 38 ++++++++++++++++++++++ docs/en/Application-toolkit-trace-cross-thread.md | 36 ++++++++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 0500127..7996d32 100644 --- a/docs/README.md +++ b/docs/README.md @@ -21,6 +21,7 @@ * [log4j2](en/Application-toolkit-log4j-2.x.md) * [logback](en/Application-toolkit-logback-1.x.md) * [Trace](en/Application-toolkit-trace.md) + * [Propagate Context across Thread](en/Application-toolkit-trace-cross-thread.md) * Testing * [Plugin Test](https://github.com/SkywalkingTest/agent-integration-test-report) * [Java Agent Performance Test](https://skywalkingtest.github.io/Agent-Benchmarks/) diff --git a/docs/README_ZH.md b/docs/README_ZH.md index f8c0969..52522cb 100644 --- a/docs/README_ZH.md +++ b/docs/README_ZH.md @@ -21,6 +21,7 @@ * [log4j2组件](cn/Application-toolkit-log4j-2.x-CN.md) * [logback组件](cn/Application-toolkit-logback-1.x-CN.md) * [Trace](cn/Application-toolkit-trace-CN.md) + * [调用链跨线程传递](cn/Application-toolkit-trace-cross-thread-CN.md) * 测试用例 * [插件测试](https://github.com/SkywalkingTest/agent-integration-test-report) * [Java 探针性能测试](https://skywalkingtest.github.io/Agent-Benchmarks/README_zh.html) @@ -38,4 +39,4 @@ * FAQ * [Trace查询有数据,但是没有拓扑图和JVM数据?](cn/FAQ/Why-have-traces-no-others-CN.md) * [加载探针,Console被GRPC日志刷屏](cn/FAQ/Too-many-gRPC-logs-CN.md) - * [Kafka消息消费端链路断裂](cn/FAQ/Kafka-plugin-CN.md) \ No newline at end of file + * [Kafka消息消费端链路断裂](cn/FAQ/Kafka-plugin-CN.md) diff --git a/docs/cn/Application-toolkit-trace-cross-thread-CN.md b/docs/cn/Application-toolkit-trace-cross-thread-CN.md new file mode 100644 index 0000000..513c3d8 --- /dev/null +++ b/docs/cn/Application-toolkit-trace-cross-thread-CN.md @@ -0,0 +1,38 @@ +# 跨线程追踪 +* 使用 maven 和 gradle 依赖相应的工具包 +```xml + <dependency> + <groupId>org.apache.skywalking</groupId> + <artifactId>apm-toolkit-trace</artifactId> + <version>${skywalking.version}</version> + </dependency> +``` + +* 使用方式一. +```java + @TraceCrossThread + public static class MyCallable<String> implements Callable<String> { + @Override + public String call() throws Exception { + return null; + } + } +... + ExecutorService executorService = Executors.newFixedThreadPool(1); + executorService.submit(new MyCallable()); +``` +* 使用方式二. +```java + ExecutorService executorService = Executors.newFixedThreadPool(1); + executorService.submit(CallableWrapper.of(new Callable<String>() { + @Override public String call() throws Exception { + return null; + } + })); +``` +_示例代码,仅供参考_ + + + + + diff --git a/docs/en/Application-toolkit-trace-cross-thread.md b/docs/en/Application-toolkit-trace-cross-thread.md new file mode 100644 index 0000000..308cb83 --- /dev/null +++ b/docs/en/Application-toolkit-trace-cross-thread.md @@ -0,0 +1,36 @@ +# trace cross thread +* Dependency the toolkit, such as using maven or gradle +```xml + <dependency> + <groupId>org.apache.skywalking</groupId> + <artifactId>apm-toolkit-trace</artifactId> + <version>${skywalking.version}</version> + </dependency> +``` + +* usage 1. +```java + @TraceCrossThread + public static class MyCallable<String> implements Callable<String> { + @Override + public String call() throws Exception { + return null; + } + } +... + ExecutorService executorService = Executors.newFixedThreadPool(1); + executorService.submit(new MyCallable()); +``` +* usage 2. +```java + ExecutorService executorService = Executors.newFixedThreadPool(1); + executorService.submit(CallableWrapper.of(new Callable<String>() { + @Override public String call() throws Exception { + return null; + } + })); +``` +_Sample codes only_ + + + -- To stop receiving notification emails like this one, please contact wush...@apache.org.