add docs for basic commands (#1804)

pull/1807/head
Fu 4 years ago committed by GitHub
parent aa94a3b36c
commit 57259ec3ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,7 @@
cls
===
清空当前屏幕区域。
> 非终端模式下使用cls指令会提示"Command 'cls' is only support tty session."。

@ -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快捷键列表及自定义快捷键
* [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)

@ -0,0 +1,7 @@
cls
===
clear current console.
> if not in tty mode,it will warn "Command 'cls' is only support tty session.".

@ -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 <value>] [-n <value>]
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 <value> The interval (in ms) between two executions, default is 5000 ms.
-n, --number-of-execution <value> The number of times this command will be executed.
```

@ -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
```

@ -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.

@ -0,0 +1,21 @@
session
===
examines the current session,show the current binded processId and the sessionId.
> if exits tunnel serverit will also show agentId、tunnelServerUrl、connected status.
>
> if exits statUrlit will also show statUrl.
### Usage
```bash
$ session
Name Value
--------------------------------------------------
JAVA_PID 14584
SESSION_ID c2073d3b-443a-4a9b-9249-0c5d24a5756c
```

@ -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.

@ -0,0 +1,12 @@
version
===
prints out Arthas's version.
### Usage
```bash
$ version
3.5.1
```

@ -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 <value>] [-n <value>]
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 <value> The interval (in ms) between two executions, default is 5000 ms.
-n, --number-of-execution <value> The number of times this command will be executed.
```

@ -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
```

@ -0,0 +1,7 @@
quit
===
退出当前 Arthas 客户端,其他 Arthas 客户端不受影响。等同于**exit**、**logout**、**q**三个指令。
> 只是退出当前Arthas客户端Arthas的服务器端并没有关闭所做的修改也不会被重置。

@ -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
```

@ -0,0 +1,7 @@
Stop
===
关闭 Arthas 服务端,所有 Arthas 客户端全部退出。
> 关闭Arthas服务器之前会重置掉所有做过的增强类。但是用redefine重加载的类内容不会被重置。

@ -0,0 +1,12 @@
version
===
输出当前目标 Java 进程所加载的 Arthas 版本号
### 使用参考
```
$ version
3.5.1
```
Loading…
Cancel
Save