From 57259ec3ede95be588cd4851be7319cf864ae91b Mon Sep 17 00:00:00 2001 From: Fu Date: Thu, 27 May 2021 17:26:46 +0800 Subject: [PATCH] add docs for basic commands (#1804) --- site/src/site/sphinx/cls.md | 7 +++ site/src/site/sphinx/commands.md | 18 +++---- site/src/site/sphinx/en/cls.md | 7 +++ site/src/site/sphinx/en/help.md | 87 ++++++++++++++++++++++++++++++ site/src/site/sphinx/en/history.md | 31 +++++++++++ site/src/site/sphinx/en/quit.md | 7 +++ site/src/site/sphinx/en/session.md | 21 ++++++++ site/src/site/sphinx/en/stop.md | 7 +++ site/src/site/sphinx/en/version.md | 12 +++++ site/src/site/sphinx/help.md | 87 ++++++++++++++++++++++++++++++ site/src/site/sphinx/history.md | 31 +++++++++++ site/src/site/sphinx/quit.md | 7 +++ site/src/site/sphinx/session.md | 22 ++++++++ site/src/site/sphinx/stop.md | 7 +++ site/src/site/sphinx/version.md | 12 +++++ 15 files changed, 354 insertions(+), 9 deletions(-) create mode 100644 site/src/site/sphinx/cls.md create mode 100644 site/src/site/sphinx/en/cls.md create mode 100644 site/src/site/sphinx/en/help.md create mode 100644 site/src/site/sphinx/en/history.md create mode 100644 site/src/site/sphinx/en/quit.md create mode 100644 site/src/site/sphinx/en/session.md create mode 100644 site/src/site/sphinx/en/stop.md create mode 100644 site/src/site/sphinx/en/version.md create mode 100644 site/src/site/sphinx/help.md create mode 100644 site/src/site/sphinx/history.md create mode 100644 site/src/site/sphinx/quit.md create mode 100644 site/src/site/sphinx/session.md create mode 100644 site/src/site/sphinx/stop.md create mode 100644 site/src/site/sphinx/version.md diff --git a/site/src/site/sphinx/cls.md b/site/src/site/sphinx/cls.md new file mode 100644 index 000000000..136f4092b --- /dev/null +++ b/site/src/site/sphinx/cls.md @@ -0,0 +1,7 @@ +cls +=== + +清空当前屏幕区域。 + +> 非终端模式下使用cls指令,会提示"Command 'cls' is only support tty session."。 + diff --git a/site/src/site/sphinx/commands.md b/site/src/site/sphinx/commands.md index c51bcb949..132af9199 100644 --- a/site/src/site/sphinx/commands.md +++ b/site/src/site/sphinx/commands.md @@ -45,12 +45,12 @@ ### Arthas 基础命令 -* help——查看命令帮助信息 -* cls——清空当前屏幕区域 -* session——查看当前会话的信息 -* [reset](reset.md)——重置增强类,将被 Arthas 增强过的类全部还原,Arthas 服务端关闭时会重置所有增强过的类 -* version——输出当前目标 Java 进程所加载的 Arthas 版本号 -* history——打印命令历史 -* quit——退出当前 Arthas 客户端,其他 Arthas 客户端不受影响 -* stop——关闭 Arthas 服务端,所有 Arthas 客户端全部退出 -* [keymap](keymap.md)——Arthas快捷键列表及自定义快捷键 \ No newline at end of file +* [help](help.md) +* [cls](cls.md) +* [session](session.md) +* [reset](reset.md) +* [version](version.md) +* [history](history.md) +* [quit](quit.md) +* [stop](stop.md) +* [keymap](keymap.md) \ No newline at end of file diff --git a/site/src/site/sphinx/en/cls.md b/site/src/site/sphinx/en/cls.md new file mode 100644 index 000000000..575d0fb12 --- /dev/null +++ b/site/src/site/sphinx/en/cls.md @@ -0,0 +1,7 @@ +cls +=== + +clear current console. + +> if not in tty mode,it will warn "Command 'cls' is only support tty session.". + diff --git a/site/src/site/sphinx/en/help.md b/site/src/site/sphinx/en/help.md new file mode 100644 index 000000000..bc0b48d6e --- /dev/null +++ b/site/src/site/sphinx/en/help.md @@ -0,0 +1,87 @@ +help +=== + +show help message, the command can show all the commands that current Arthas server supports,or you can use the command to show the detail usage of another command. + +> [help command] equals [command -help],both is to show the detail usage of one command. + +### Options + +| Name | Specification | +| ------: | :-------------------------------------------------------- | +| | show all the commands that current Arthas server supports | +| [name:] | show the detail usage of one command | + +### Usage + +```bash +$ help + NAME DESCRIPTION + help Display Arthas Help + auth Authenticates the current session + keymap Display all the available keymap for the specified connection. + sc Search all the classes loaded by JVM + sm Search the method of classes loaded by JVM + classloader Show classloader info + jad Decompile class + getstatic Show the static field of a class + monitor Monitor method execution statistics, e.g. total/success/failure count, average rt, fail rate, etc. + stack Display the stack trace for the specified class and method + thread Display thread info, thread stack + trace Trace the execution time of specified method invocation. + watch Display the input/output parameter, return object, and thrown exception of specified method invocation + tt Time Tunnel + jvm Display the target JVM information + perfcounter Display the perf counter information. + ognl Execute ognl expression. + mc Memory compiler, compiles java files into bytecode and class files in memory. + redefine Redefine classes. @see Instrumentation#redefineClasses(ClassDefinition...) + retransform Retransform classes. @see Instrumentation#retransformClasses(Class...) + dashboard Overview of target jvm's thread, memory, gc, vm, tomcat info. + dump Dump class byte array from JVM + heapdump Heap dump + options View and change various Arthas options + cls Clear the screen + reset Reset all the enhanced classes + version Display Arthas version + session Display current session information + sysprop Display, and change the system properties. + sysenv Display the system env. + vmoption Display, and update the vm diagnostic options. + logger Print logger info, and update the logger level + history Display command history + cat Concatenate and print files + base64 Encode and decode using Base64 representation + echo write arguments to the standard output + pwd Return working directory name + mbean Display the mbean information + grep grep command for pipes. + tee tee command for pipes. + profiler Async Profiler. https://github.com/jvm-profiling-tools/async-profiler + stop Stop/Shutdown Arthas server and exit the console. + + +``` + +```bash + $ help dashboard + USAGE: + dashboard [-h] [-i ] [-n ] + + SUMMARY: + Overview of target jvm's thread, memory, gc, vm, tomcat info. + + EXAMPLES: + dashboard + dashboard -n 10 + dashboard -i 2000 + + WIKI: + https://arthas.aliyun.com/doc/dashboard + + OPTIONS: + -h, --help this help + -i, --interval The interval (in ms) between two executions, default is 5000 ms. + -n, --number-of-execution The number of times this command will be executed. +``` + diff --git a/site/src/site/sphinx/en/history.md b/site/src/site/sphinx/en/history.md new file mode 100644 index 000000000..18a48eabe --- /dev/null +++ b/site/src/site/sphinx/en/history.md @@ -0,0 +1,31 @@ +history +=== + +view command history. + +> history of commands will persisted in a file named history, so the history command can show all the history commands of current Arthas server ,but not only history in current session. + +### Options + +| Name | Specification | +| ---: | :----------------------------- | +| [c:] | clear all the history commands | +| [n:] | view the nearest 5 commands | + +### 使用参考 + +```bash +#view the nearest 3 commands +$ history 3 + 269 thread + 270 cls + 271 history 3 +``` + +```bash + #clear all the history commands + $ history -c + $ history 3 + 1 history 3 +``` + diff --git a/site/src/site/sphinx/en/quit.md b/site/src/site/sphinx/en/quit.md new file mode 100644 index 000000000..2deaec083 --- /dev/null +++ b/site/src/site/sphinx/en/quit.md @@ -0,0 +1,7 @@ +quit +=== + +exit the current Arthas client without affecting other clients. equals **exit**、**logout**、**q** command. + +> just exit Arthas client,it means Arthas server is not closed,so the changes you do will not be reseted. + diff --git a/site/src/site/sphinx/en/session.md b/site/src/site/sphinx/en/session.md new file mode 100644 index 000000000..3597c76b2 --- /dev/null +++ b/site/src/site/sphinx/en/session.md @@ -0,0 +1,21 @@ +session +=== + +examines the current session,show the current binded processId and the sessionId. + +> if exits tunnel server,it will also show agentId、tunnelServerUrl、connected status. +> +> if exits statUrl,it will also show statUrl. + + + +### Usage + +```bash +$ session + Name Value +-------------------------------------------------- + JAVA_PID 14584 + SESSION_ID c2073d3b-443a-4a9b-9249-0c5d24a5756c +``` + diff --git a/site/src/site/sphinx/en/stop.md b/site/src/site/sphinx/en/stop.md new file mode 100644 index 000000000..84b3f71cc --- /dev/null +++ b/site/src/site/sphinx/en/stop.md @@ -0,0 +1,7 @@ +Stop +=== + +terminates the Arthas server, all the Arthas clients connecting to this server will be disconnected. + +> the class redefined by redefine command will not be reset. + diff --git a/site/src/site/sphinx/en/version.md b/site/src/site/sphinx/en/version.md new file mode 100644 index 000000000..6619b897d --- /dev/null +++ b/site/src/site/sphinx/en/version.md @@ -0,0 +1,12 @@ +version +=== + +prints out Arthas's version. + +### Usage + +```bash +$ version + 3.5.1 +``` + diff --git a/site/src/site/sphinx/help.md b/site/src/site/sphinx/help.md new file mode 100644 index 000000000..e20034a10 --- /dev/null +++ b/site/src/site/sphinx/help.md @@ -0,0 +1,87 @@ +help +=== + +查看命令帮助信息,可以查看当前arthas版本支持的指令,或者查看具体指令的使用说明。 + +> [help 指令]的等同于[指令 -help],都是查看具体指令的使用说明。 + +### 参数说明 + +| 参数名称 | 参数说明 | +| -------: | :--------------------------------------- | +| 不接参数 | 查询当前arthas版本支持的指令以及指令描述 | +| [name:] | 查询具体指令的使用说明 | + +### 使用参考 + +``` +$ help + NAME DESCRIPTION + help Display Arthas Help + auth Authenticates the current session + keymap Display all the available keymap for the specified connection. + sc Search all the classes loaded by JVM + sm Search the method of classes loaded by JVM + classloader Show classloader info + jad Decompile class + getstatic Show the static field of a class + monitor Monitor method execution statistics, e.g. total/success/failure count, average rt, fail rate, etc. + stack Display the stack trace for the specified class and method + thread Display thread info, thread stack + trace Trace the execution time of specified method invocation. + watch Display the input/output parameter, return object, and thrown exception of specified method invocation + tt Time Tunnel + jvm Display the target JVM information + perfcounter Display the perf counter information. + ognl Execute ognl expression. + mc Memory compiler, compiles java files into bytecode and class files in memory. + redefine Redefine classes. @see Instrumentation#redefineClasses(ClassDefinition...) + retransform Retransform classes. @see Instrumentation#retransformClasses(Class...) + dashboard Overview of target jvm's thread, memory, gc, vm, tomcat info. + dump Dump class byte array from JVM + heapdump Heap dump + options View and change various Arthas options + cls Clear the screen + reset Reset all the enhanced classes + version Display Arthas version + session Display current session information + sysprop Display, and change the system properties. + sysenv Display the system env. + vmoption Display, and update the vm diagnostic options. + logger Print logger info, and update the logger level + history Display command history + cat Concatenate and print files + base64 Encode and decode using Base64 representation + echo write arguments to the standard output + pwd Return working directory name + mbean Display the mbean information + grep grep command for pipes. + tee tee command for pipes. + profiler Async Profiler. https://github.com/jvm-profiling-tools/async-profiler + stop Stop/Shutdown Arthas server and exit the console. + + +``` + +``` + $ help dashboard + USAGE: + dashboard [-h] [-i ] [-n ] + + SUMMARY: + Overview of target jvm's thread, memory, gc, vm, tomcat info. + + EXAMPLES: + dashboard + dashboard -n 10 + dashboard -i 2000 + + WIKI: + https://arthas.aliyun.com/doc/dashboard + + OPTIONS: + -h, --help this help + -i, --interval The interval (in ms) between two executions, default is 5000 ms. + -n, --number-of-execution The number of times this command will be executed. +``` + diff --git a/site/src/site/sphinx/history.md b/site/src/site/sphinx/history.md new file mode 100644 index 000000000..b555b4e96 --- /dev/null +++ b/site/src/site/sphinx/history.md @@ -0,0 +1,31 @@ +history +=== + +打印命令历史。 + +> 历史指令会通过一个名叫history的文件持久化,所以history指令可以查看当前arthas服务器的所有历史命令,而不仅只是当前次会话使用过的命令。 + +### 参数说明 + +| 参数名称 | 参数说明 | +| -------: | :-------------------- | +| [c:] | 清空历史指令 | +| [n:] | 显示最近执行的n条指令 | + +### 使用参考 + +``` +#查看最近执行的3条指令 +$ history 3 + 269 thread + 270 cls + 271 history 3 +``` + +``` + #清空指令 + $ history -c + $ history 3 + 1 history 3 +``` + diff --git a/site/src/site/sphinx/quit.md b/site/src/site/sphinx/quit.md new file mode 100644 index 000000000..10b887d91 --- /dev/null +++ b/site/src/site/sphinx/quit.md @@ -0,0 +1,7 @@ +quit +=== + +退出当前 Arthas 客户端,其他 Arthas 客户端不受影响。等同于**exit**、**logout**、**q**三个指令。 + +> 只是退出当前Arthas客户端,Arthas的服务器端并没有关闭,所做的修改也不会被重置。 + diff --git a/site/src/site/sphinx/session.md b/site/src/site/sphinx/session.md new file mode 100644 index 000000000..957faae5c --- /dev/null +++ b/site/src/site/sphinx/session.md @@ -0,0 +1,22 @@ +session +=== + +查看当前会话的信息,显示当前绑定的pid以及会话id。 + +> 如果配置了tunnel server,会追加打印 代理id、tunnel服务器的url以及连接状态。 +> +> 如果使用了staturl做统计,会追加显示statUrl地址。 + + + +### 使用参考 + +``` +$ session + Name Value +-------------------------------------------------- + JAVA_PID 14584 + SESSION_ID c2073d3b-443a-4a9b-9249-0c5d24a5756c + +``` + diff --git a/site/src/site/sphinx/stop.md b/site/src/site/sphinx/stop.md new file mode 100644 index 000000000..488d5f34e --- /dev/null +++ b/site/src/site/sphinx/stop.md @@ -0,0 +1,7 @@ +Stop +=== + +关闭 Arthas 服务端,所有 Arthas 客户端全部退出。 + +> 关闭Arthas服务器之前,会重置掉所有做过的增强类。但是用redefine重加载的类内容不会被重置。 + diff --git a/site/src/site/sphinx/version.md b/site/src/site/sphinx/version.md new file mode 100644 index 000000000..293fa6c6e --- /dev/null +++ b/site/src/site/sphinx/version.md @@ -0,0 +1,12 @@ +version +=== + +输出当前目标 Java 进程所加载的 Arthas 版本号 + +### 使用参考 + +``` +$ version + 3.5.1 +``` +