From a7856ffdc17fb0d3a49b80a1207f949cf7c80470 Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Thu, 23 Jul 2020 15:28:59 +0800 Subject: [PATCH] =?UTF-8?q?Arthas=20dashboard=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E6=95=99=E7=A8=8B=20(#1326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add dashboard command scenario. #847 Signed-off-by: hollowman6 * fix link typo Signed-off-by: hollowman6 * merge 'dashboard.md' and 'dashboard-usage.md' Signed-off-by: hollowman6 --- site/src/site/sphinx/dashboard.md | 2 + site/src/site/sphinx/en/dashboard.md | 2 + .../command-dashboard-cn/arthas-boot.md | 16 +++++++ .../command-dashboard-cn/arthas-demo.md | 10 +++++ .../command-dashboard-cn/dashboard.md | 44 +++++++++++++++++++ .../katacoda/command-dashboard-cn/finish.md | 10 +++++ .../katacoda/command-dashboard-cn/index.json | 37 ++++++++++++++++ .../katacoda/command-dashboard-cn/intro.md | 11 +++++ .../notes-on-column-headers.md | 22 ++++++++++ .../command-dashboard-en/arthas-boot.md | 15 +++++++ .../command-dashboard-en/arthas-demo.md | 11 +++++ .../command-dashboard-en/dashboard.md | 44 +++++++++++++++++++ .../katacoda/command-dashboard-en/finish.md | 6 +++ .../katacoda/command-dashboard-en/index.json | 37 ++++++++++++++++ .../katacoda/command-dashboard-en/intro.md | 11 +++++ .../notes-on-column-headers.md | 22 ++++++++++ 16 files changed, 300 insertions(+) create mode 100644 tutorials/katacoda/command-dashboard-cn/arthas-boot.md create mode 100644 tutorials/katacoda/command-dashboard-cn/arthas-demo.md create mode 100644 tutorials/katacoda/command-dashboard-cn/dashboard.md create mode 100644 tutorials/katacoda/command-dashboard-cn/finish.md create mode 100644 tutorials/katacoda/command-dashboard-cn/index.json create mode 100644 tutorials/katacoda/command-dashboard-cn/intro.md create mode 100644 tutorials/katacoda/command-dashboard-cn/notes-on-column-headers.md create mode 100644 tutorials/katacoda/command-dashboard-en/arthas-boot.md create mode 100644 tutorials/katacoda/command-dashboard-en/arthas-demo.md create mode 100644 tutorials/katacoda/command-dashboard-en/dashboard.md create mode 100644 tutorials/katacoda/command-dashboard-en/finish.md create mode 100644 tutorials/katacoda/command-dashboard-en/index.json create mode 100644 tutorials/katacoda/command-dashboard-en/intro.md create mode 100644 tutorials/katacoda/command-dashboard-en/notes-on-column-headers.md diff --git a/site/src/site/sphinx/dashboard.md b/site/src/site/sphinx/dashboard.md index 8458c1065..350478b4c 100644 --- a/site/src/site/sphinx/dashboard.md +++ b/site/src/site/sphinx/dashboard.md @@ -1,6 +1,8 @@ dashboard === +[`dashboard`在线教程](https://alibaba.github.io/arthas/arthas-tutorials?language=cn&id=command-dashboard) + > 当前系统的实时数据面板,按 ctrl+c 退出。 当运行在Ali-tomcat时,会显示当前tomcat的实时信息,如HTTP请求的qps, rt, 错误数, 线程池信息等等。 diff --git a/site/src/site/sphinx/en/dashboard.md b/site/src/site/sphinx/en/dashboard.md index 951d6f1c2..2c8703cfa 100644 --- a/site/src/site/sphinx/en/dashboard.md +++ b/site/src/site/sphinx/en/dashboard.md @@ -1,6 +1,8 @@ dashboard ========= +[`dashboard` online tutorial](https://alibaba.github.io/arthas/arthas-tutorials?language=en&id=command-dashboard) + > This is the real time statistics dashboard for the current system, press `Ctrl+C` to exit. When running in Apache Tomcat Alibaba edition, the dashboard will also present the real time statistics of the tomcat, including [QPS](https://en.wikipedia.org/wiki/Queries_per_second), RT, error counts, and thread pool, etc. diff --git a/tutorials/katacoda/command-dashboard-cn/arthas-boot.md b/tutorials/katacoda/command-dashboard-cn/arthas-boot.md new file mode 100644 index 000000000..d53c8ff8a --- /dev/null +++ b/tutorials/katacoda/command-dashboard-cn/arthas-boot.md @@ -0,0 +1,16 @@ + + + + +在新的`Terminal 2`里,下载`arthas-boot.jar`,再用`java -jar`命令启动: + +`wget https://alibaba.github.io/arthas/arthas-boot.jar +java -jar arthas-boot.jar --target-ip 0.0.0.0`{{execute T2}} + +`arthas-boot`是`Arthas`的启动程序,它启动后,会列出所有的Java进程,用户可以选择需要诊断的目标进程。 + +选择第一个进程,输入 `1`{{execute T2}} ,再`Enter/回车`: + +Attach成功之后,会打印Arthas LOGO。输入 `help`{{execute T2}} 可以获取到更多的帮助信息。 + +![Arthas Boot](/arthas/scenarios/common-resources/assets/arthas-boot.png) diff --git a/tutorials/katacoda/command-dashboard-cn/arthas-demo.md b/tutorials/katacoda/command-dashboard-cn/arthas-demo.md new file mode 100644 index 000000000..f1136e88e --- /dev/null +++ b/tutorials/katacoda/command-dashboard-cn/arthas-demo.md @@ -0,0 +1,10 @@ + + + + +下载`arthas-demo.jar`,再用`java -jar`命令启动: + +`wget https://alibaba.github.io/arthas/arthas-demo.jar +java -jar arthas-demo.jar`{{execute T1}} + +`arthas-demo`是一个很简单的程序,它随机生成整数,再执行因式分解,把结果打印出来。如果生成的随机数是负数,则会打印提示信息。 diff --git a/tutorials/katacoda/command-dashboard-cn/dashboard.md b/tutorials/katacoda/command-dashboard-cn/dashboard.md new file mode 100644 index 000000000..8a6d79f2c --- /dev/null +++ b/tutorials/katacoda/command-dashboard-cn/dashboard.md @@ -0,0 +1,44 @@ + +`dashboard`{{execute T2}} 命令可以查看当前系统的实时数据面板。 + +当运行在Ali-tomcat时,会显示当前tomcat的实时信息,如HTTP请求的qps, rt, 错误数, 线程池信息等等。 + + +```bash +$ dashboard +ID NAME GROUP PRIORITY STATE %CPU TIME INTERRUPTED DAEMON +889 RMI TCP Connection(15)-30.10.166. RMI Runtime 9 RUNNABLE 48 0:5 false true +1077 Timer-for-arthas-dashboard-0 system 9 RUNNABLE 24 0:0 false true +1074 as-selector-daemon system 9 RUNNABLE 12 0:0 false true +284 JMX server connection timeout 284 RMI Runtime 9 TIMED_WAITI 8 0:3 false true +16 Timer-1 main 5 TIMED_WAITI 5 0:9 false true +47 Pandora pandora-qos-reporter Pool main 5 TIMED_WAITI 0 0:0 false true +48 JmonitorClient-CheckThread Pool [ main 5 TIMED_WAITI 0 0:0 false true +49 JmonitorClient-HeartBeat Pool [Th main 5 TIMED_WAITI 0 0:0 false true +50 JmonitorClient-ReaderThread Pool main 5 TIMED_WAITI 0 0:0 false true +957 RMI TCP Connection(16)-30.10.166. RMI Runtime 9 RUNNABLE 0 0:2 false true +51 JmonitorClient-WriterThread Pool main 5 TIMED_WAITI 0 0:0 false true +52 ContainerBackgroundProcessor[Stan main 5 TIMED_WAITI 0 0:0 false true +53 http-bio-8080-Acceptor-0 main 5 RUNNABLE 0 0:2 false true +54 http-bio-8080-AsyncTimeout main 5 TIMED_WAITI 0 0:0 false true +11 GC Daemon system 2 TIMED_WAITI 0 0:0 false true +Memory used total max usage GC +heap 59M 223M 1820M 3.26% gc.ps_scavenge.count 118 +ps_eden_space 14M 114M 668M 2.11% gc.ps_scavenge.time(ms) 1890 +ps_survivor_space 6M 6M 6M 96.08% gc.ps_marksweep.count 5 +ps_old_gen 39M 103M 1365M 2.86% gc.ps_marksweep.time(ms) 1140 +nonheap 234M 240M 0M 97.46% +code_cache 46M 47M 240M 19.49% +metaspace 167M 172M 0M 97.36% +Runtime Tomcat +os.name Mac OS X connector http-bio-8080 +os.version 10.10.5 QPS 0.00 +java.version 1.8.0_60 RT(ms) 1.13 +java.home error/s 0.00 + received/s 0B +systemload.average 3.44 sent/s 0B +processors 4 threadpool http-bio-8080 +uptime 16020s busy 0 +``` + +输入 `Q`{{execute T2}} 或者 `Ctrl+C` 可以退出dashboard命令。 diff --git a/tutorials/katacoda/command-dashboard-cn/finish.md b/tutorials/katacoda/command-dashboard-cn/finish.md new file mode 100644 index 000000000..dabca4533 --- /dev/null +++ b/tutorials/katacoda/command-dashboard-cn/finish.md @@ -0,0 +1,10 @@ + +通过本教程基本掌握了Arthas dashboard的用法。更多高级特性,可以在下面的进阶指南里继续了解。 + +* [Arthas进阶](https://alibaba.github.io/arthas/arthas-tutorials?language=cn&id=arthas-advanced) +* [Arthas Github](https://github.com/alibaba/arthas) +* [Arthas 文档](https://alibaba.github.io/arthas/) + +欢迎关注公众号,获取Arthas项目的信息,源码分析,案例实践。 + +![Arthas公众号](/arthas/scenarios/common-resources/assets/qrcode_gongzhonghao.jpg) diff --git a/tutorials/katacoda/command-dashboard-cn/index.json b/tutorials/katacoda/command-dashboard-cn/index.json new file mode 100644 index 000000000..b8900160d --- /dev/null +++ b/tutorials/katacoda/command-dashboard-cn/index.json @@ -0,0 +1,37 @@ +{ + "title": "Arthas dashboard命令教程", + "description": "Arthas dashboard命令教程", + "details": { + "steps": [ + { + "title": "启动arthas-demo", + "text": "arthas-demo.md" + }, + { + "title": "启动arthas-boot", + "text": "arthas-boot.md" + }, + { + "title": "dashboard 命令", + "text": "dashboard.md" + }, + { + "title": "dashboard 数据说明", + "text": "notes-on-column-headers.md" + } + ], + "intro": { + "text": "intro.md" + }, + "finish": { + "text": "finish.md" + } + }, + "environment": { + "uilayout": "terminal" + }, + "backend": { + "imageid": "java", + "environmentsprotocol": "http" + } +} \ No newline at end of file diff --git a/tutorials/katacoda/command-dashboard-cn/intro.md b/tutorials/katacoda/command-dashboard-cn/intro.md new file mode 100644 index 000000000..23669532b --- /dev/null +++ b/tutorials/katacoda/command-dashboard-cn/intro.md @@ -0,0 +1,11 @@ + + + +![Arthas](https://alibaba.github.io/arthas/_images/arthas.png) + +`Arthas` 是Alibaba开源的Java诊断工具,深受开发者喜爱。在线排查问题,无需重启;动态跟踪Java代码;实时监控JVM状态。 + +`Arthas` 支持JDK 6+,支持Linux/Mac/Windows,采用命令行交互模式,同时提供丰富的 `Tab` 自动补全功能,进一步方便进行问题的定位和诊断。 + +* Github: https://github.com/alibaba/arthas +* 文档: https://alibaba.github.io/arthas/ \ No newline at end of file diff --git a/tutorials/katacoda/command-dashboard-cn/notes-on-column-headers.md b/tutorials/katacoda/command-dashboard-cn/notes-on-column-headers.md new file mode 100644 index 000000000..c82dcf70c --- /dev/null +++ b/tutorials/katacoda/command-dashboard-cn/notes-on-column-headers.md @@ -0,0 +1,22 @@ + +* *ID*: Java级别的线程ID,注意这个ID不能跟jstack中的nativeID一一对应 + +* *NAME*: 线程名 + +* *GROUP*: 线程组名 + +* *PRIORITY*: 线程优先级, 1~10之间的数字,越大表示优先级越高 + +* *STATE*: 线程的状态 + +* *CPU%*: 线程消耗的cpu占比,采样100ms,将所有线程在这100ms内的cpu使用量求和,再算出每个线程的cpu使用占比。 + +* *TIME*: 线程运行总时间,数据格式为`分:秒` + +* *INTERRUPTED*: 线程当前的中断位状态 + +* *DAEMON*: 是否是daemon线程 + +## 截图展示 + +![](https://alibaba.github.io/arthas/_images/dashboard.png) \ No newline at end of file diff --git a/tutorials/katacoda/command-dashboard-en/arthas-boot.md b/tutorials/katacoda/command-dashboard-en/arthas-boot.md new file mode 100644 index 000000000..36dac70d2 --- /dev/null +++ b/tutorials/katacoda/command-dashboard-en/arthas-boot.md @@ -0,0 +1,15 @@ + + + +In the new `Terminal 2`, download `arthas-boot.jar` and start with the `java -jar` command: + +`wget https://alibaba.github.io/arthas/arthas-boot.jar +java -jar arthas-boot.jar --target-ip 0.0.0.0`{{execute T2}} + +`arthas-boot` is the launcher for `Arthas`. It lists all the Java processes, and the user can select the target process to be diagnosed. + +Select the first process, type `1`{{execute T2}} ,then type `Enter`: + +After the Attach is successful, Arthas LOGO is printed. Enter `help`{{execute T2}} for more help. + +![Arthas Boot](/arthas/scenarios/common-resources/assets/arthas-boot.png) diff --git a/tutorials/katacoda/command-dashboard-en/arthas-demo.md b/tutorials/katacoda/command-dashboard-en/arthas-demo.md new file mode 100644 index 000000000..b15edea76 --- /dev/null +++ b/tutorials/katacoda/command-dashboard-en/arthas-demo.md @@ -0,0 +1,11 @@ + + + + +Download `arthas-demo.jar` and start with the `java -jar` command: + +`wget https://alibaba.github.io/arthas/arthas-demo.jar +java -jar arthas-demo.jar`{{execute T1}} + +`arthas-demo` is a very simple program that randomly generates integers, performs factorization, and prints the results. +If the generated random number is negative, a error message will be printed. \ No newline at end of file diff --git a/tutorials/katacoda/command-dashboard-en/dashboard.md b/tutorials/katacoda/command-dashboard-en/dashboard.md new file mode 100644 index 000000000..73514fdd7 --- /dev/null +++ b/tutorials/katacoda/command-dashboard-en/dashboard.md @@ -0,0 +1,44 @@ + +The `dashboard`{{execute T2}} command allows you to view the real-time data panel of the current system. + +When running in Apache Tomcat Alibaba edition, the dashboard will also present the real time statistics of the tomcat, including [QPS](https://en.wikipedia.org/wiki/Queries_per_second), RT, error counts, and thread pool, etc. + + +```bash +$ dashboard +ID NAME GROUP PRIORITY STATE %CPU TIME INTERRUPTED DAEMON +889 RMI TCP Connection(15)-30.10.166. RMI Runtime 9 RUNNABLE 48 0:5 false true +1077 Timer-for-arthas-dashboard-0 system 9 RUNNABLE 24 0:0 false true +1074 as-selector-daemon system 9 RUNNABLE 12 0:0 false true +284 JMX server connection timeout 284 RMI Runtime 9 TIMED_WAITI 8 0:3 false true +16 Timer-1 main 5 TIMED_WAITI 5 0:9 false true +47 Pandora pandora-qos-reporter Pool main 5 TIMED_WAITI 0 0:0 false true +48 JmonitorClient-CheckThread Pool [ main 5 TIMED_WAITI 0 0:0 false true +49 JmonitorClient-HeartBeat Pool [Th main 5 TIMED_WAITI 0 0:0 false true +50 JmonitorClient-ReaderThread Pool main 5 TIMED_WAITI 0 0:0 false true +957 RMI TCP Connection(16)-30.10.166. RMI Runtime 9 RUNNABLE 0 0:2 false true +51 JmonitorClient-WriterThread Pool main 5 TIMED_WAITI 0 0:0 false true +52 ContainerBackgroundProcessor[Stan main 5 TIMED_WAITI 0 0:0 false true +53 http-bio-8080-Acceptor-0 main 5 RUNNABLE 0 0:2 false true +54 http-bio-8080-AsyncTimeout main 5 TIMED_WAITI 0 0:0 false true +11 GC Daemon system 2 TIMED_WAITI 0 0:0 false true +Memory used total max usage GC +heap 59M 223M 1820M 3.26% gc.ps_scavenge.count 118 +ps_eden_space 14M 114M 668M 2.11% gc.ps_scavenge.time(ms) 1890 +ps_survivor_space 6M 6M 6M 96.08% gc.ps_marksweep.count 5 +ps_old_gen 39M 103M 1365M 2.86% gc.ps_marksweep.time(ms) 1140 +nonheap 234M 240M 0M 97.46% +code_cache 46M 47M 240M 19.49% +metaspace 167M 172M 0M 97.36% +Runtime Tomcat +os.name Mac OS X connector http-bio-8080 +os.version 10.10.5 QPS 0.00 +java.version 1.8.0_60 RT(ms) 1.13 +java.home error/s 0.00 + received/s 0B +systemload.average 3.44 sent/s 0B +processors 4 threadpool http-bio-8080 +uptime 16020s busy 0 +``` + +Enter `Q`{{execute T2}} or `Ctrl+C` to exit the dashboard command. diff --git a/tutorials/katacoda/command-dashboard-en/finish.md b/tutorials/katacoda/command-dashboard-en/finish.md new file mode 100644 index 000000000..6112feb15 --- /dev/null +++ b/tutorials/katacoda/command-dashboard-en/finish.md @@ -0,0 +1,6 @@ + +Through this tutorial, you can know how to use Arthas `dashboard`. More advanced features can be found in the Advanced Guide below. + +* [Arthas Advanced](https://alibaba.github.io/arthas/arthas-tutorials?language=en&id=arthas-advanced) +* [Arthas Github](https://github.com/alibaba/arthas) +* [Arthas Documentation](https://alibaba.github.io/arthas/en) diff --git a/tutorials/katacoda/command-dashboard-en/index.json b/tutorials/katacoda/command-dashboard-en/index.json new file mode 100644 index 000000000..3956211f0 --- /dev/null +++ b/tutorials/katacoda/command-dashboard-en/index.json @@ -0,0 +1,37 @@ +{ + "title": "Arthas dashboard", + "description": "Arthas dashboard", + "details": { + "steps": [ + { + "title": "Start arthas-demo", + "text": "arthas-demo.md" + }, + { + "title": "Start arthas-boot", + "text": "arthas-boot.md" + }, + { + "title": "dashboard command", + "text": "dashboard.md" + }, + { + "title": "Notes on column headers", + "text": "notes-on-column-headers.md" + } + ], + "intro": { + "text": "intro.md" + }, + "finish": { + "text": "finish.md" + } + }, + "environment": { + "uilayout": "terminal" + }, + "backend": { + "imageid": "java", + "environmentsprotocol": "http" + } +} \ No newline at end of file diff --git a/tutorials/katacoda/command-dashboard-en/intro.md b/tutorials/katacoda/command-dashboard-en/intro.md new file mode 100644 index 000000000..e45235726 --- /dev/null +++ b/tutorials/katacoda/command-dashboard-en/intro.md @@ -0,0 +1,11 @@ + + + +![Arthas](https://alibaba.github.io/arthas/_images/arthas.png) + +`Arthas` is a Java diagnostic tool open-sourced by Alibaba middleware team. Arthas helps developers in trouble-shooting issues in production environment for Java based applications without modifying code or restarting servers. + +`Arthas` supports JDK 6+, supports Linux/Mac/Windows. + +* Github: https://github.com/alibaba/arthas +* Documentation: https://alibaba.github.io/arthas/en \ No newline at end of file diff --git a/tutorials/katacoda/command-dashboard-en/notes-on-column-headers.md b/tutorials/katacoda/command-dashboard-en/notes-on-column-headers.md new file mode 100644 index 000000000..7b0bcf9c6 --- /dev/null +++ b/tutorials/katacoda/command-dashboard-en/notes-on-column-headers.md @@ -0,0 +1,22 @@ + +* *ID*: JVM thread ID, pls. note this ID is different from the nativeID in jstack + +* *NAME*: thread name + +* *GROUP*: thread group name + +* *PRIORITY*: thread priority, ranged from 1 to 10. The greater number, the higher priority + +* *STATE*: thread state + +* *CPU%*: the ratio of CPU usage for the thread, sampled every 100ms + +* *TIME*: total running time in minute:`second format` + +* *INTERRUPTED*: the thread interruption state + +* *DAEMON*: daemon thread or not + +## Screenshot + +![](https://alibaba.github.io/arthas/en/_images/dashboard.png)