diff --git a/pages.zh/common/arthas-trace.md b/pages.zh/common/arthas-trace.md new file mode 100644 index 0000000000..41f8031437 --- /dev/null +++ b/pages.zh/common/arthas-trace.md @@ -0,0 +1,21 @@ +# arthas-trace + +> 方法内部调用路径,并输出方法路径上的每个节点上耗时。 +> 另见 `arthas`, `arthas-watch`. +> 更多信息:. + +- 追踪方法调用链: + +`trace {{class-pattern}} {{method-pattern}}` + +- 追踪方法调用链,仅显示大于 10 毫秒的调用: + +`trace {{class-pattern}} {{method-pattern}} '#cost > {{10}}'` + +- 追踪多个类和方法的调用: + +`trace -E {{class-pattern1|class-patter2}} {{method-pattern1|method-pattern2|method-pattern3}}` + +- 仅显示大于 10 毫秒的调用链,观测 10 次: + +`trace {{class-pattern}} {{method-pattern}} '#cost > {{10}}' -n 5` diff --git a/pages.zh/common/arthas-watch.md b/pages.zh/common/arthas-watch.md new file mode 100644 index 0000000000..09ddef6e5d --- /dev/null +++ b/pages.zh/common/arthas-watch.md @@ -0,0 +1,17 @@ +# arthas-watch + +> 函数执行数据观测。 +> 另见 `arthas`, `arthas-trace`. +> 更多信息:. + +- 在方法调用后观察,显示第一个参数和返回值,展开嵌套对象的 4 层: + +`watch {{class-pattern}} {{method-pattern}} {{'{ params[0],returnObj }'}} -x 4` + +- 在方法调用后观测,当第一个参数的值是 5 时,显示第二个参数和返回值,展开嵌套对象的 4 层: + +`watch {{class-pattern}} {{method-pattern}} {{'{ params[1],returnObj }'}} {{'"5".equals(params[0])'}} -x 4` + +- 在方法返回和异常后观测,显示第二个参数的 count 属性: + +`watch {{class-pattern}} {{method-pattern}} {{'{ params[1].count }'}} -e -s` diff --git a/pages.zh/common/arthas.md b/pages.zh/common/arthas.md new file mode 100644 index 0000000000..694340bd6e --- /dev/null +++ b/pages.zh/common/arthas.md @@ -0,0 +1,21 @@ +# arthas + +> Java 应用诊断利器。 +> 另见 `arthas-watch`, `arthas-trace`. +> 更多信息:. + +- 启动 arthas: + +`java -jar {{路径/到/arthas-boot.jar}}` + +- 重连 arthas (默认 3658 端口): + +`telnet localhost {{端口号}}` + +- 退出当前 arthas 客户端的连接,但不停止 arthas 服务: + +`exit|quit|logout|q` + +- 停止 arthas 服务,断开所有 arthas 客户端的连接: + +`stop` diff --git a/pages/common/arthas-trace.md b/pages/common/arthas-trace.md new file mode 100644 index 0000000000..828f80a1cc --- /dev/null +++ b/pages/common/arthas-trace.md @@ -0,0 +1,21 @@ +# arthas-trace + +> Trace method invoke chain, and output the time cost for each node in the path. +> See also: `arthas`, `arthas-watch`. +> More information: . + +- Trace method invoke chain: + +`trace {{class-pattern}} {{method-pattern}}` + +- Trace method invoke chains and only display invoke information longer than 10 ms: + +`trace {{class-pattern}} {{method-pattern}} '#cost > {{10}}'` + +- Trace the invoke chain of multiple classes or multiple methods: + +`trace -E {{class-pattern1|class-patter2}} {{method-pattern1|method-pattern2|method-pattern3}}` + +- Track method invoke chains, only display invoke information that exceeds 10 ms, and exit after 5 times: + +`trace {{class-pattern}} {{method-pattern}} '#cost > {{10}}' -n 5` diff --git a/pages/common/arthas-watch.md b/pages/common/arthas-watch.md new file mode 100644 index 0000000000..7ddf2c9447 --- /dev/null +++ b/pages/common/arthas-watch.md @@ -0,0 +1,17 @@ +# arthas-watch + +> Method invoke data observation. +> See also: `arthas`, `arthas-trace`. +> More information: . + +- Observe the first parameter and return value of method, and expand the nested attributes of the object to 4 levels: + +`watch {{class-pattern}} {{method-pattern}} {{'{ params[0],returnObj }'}} -x 4` + +- When the value of the first parameter of the method is 5, the second parameter and return value are output, and the object is expanded 4 layers: + +`watch {{class-pattern}} {{method-pattern}} {{'{ params[1],returnObj }'}} {{'"5".equals(params[0])'}} -x 4` + +- When the method returns or an exception occurs, observe the count property of the second parameter: + +`watch {{class-pattern}} {{method-pattern}} {{'{ params[1].count }'}} -e -s` diff --git a/pages/common/arthas.md b/pages/common/arthas.md new file mode 100644 index 0000000000..a8cfc99964 --- /dev/null +++ b/pages/common/arthas.md @@ -0,0 +1,21 @@ +# arthas + +> Java diagnostic tool. +> See also: `arthas-watch`, `arthas-trace`. +> More information: . + +- Start Arthas: + +`java -jar {{path/to/arthas-boot.jar}}` + +- Reconnect Arthas (default port used by Arthas is 3658): + +`telnet localhost {{port_number}}` + +- Exit the current Arthas client without affecting other clients. equals `exit`、`logout`、`q` command: + +`exit|quit|logout|q` + +- Terminate the Arthas server, all the Arthas clients connecting to this server will be disconnected: + +`stop`