Typo fix and description improvements

This commit is contained in:
Huxing Zhang authored and GitHub committed 2018-09-22 16:20:19 +08:00
commit 819d45a7ef
4 files changed
+45 -49

No files matched your search

+21 -24
View File
@@ -3,40 +3,40 @@ Advanced Usage
## Basic ## Basic
- help - help - show help info
- cls - clear out the current screen - cls - clear out the current screen
- session - check details of the current session - session - check details of the current session
- [reset](reset.md) - reset all empowered classes - [reset](reset.md) - reset all injected/enhanced classes
- version - print the version of the Arthas attaching to the current target process - version - print the version of the Arthas attaching to the current target process
- quit/exit - exit the current Arthas client without affecting other clients - quit/exit - exit the current Arthas client without affecting other clients
- shutdown - terminate the Arthas server and all clients - shutdown - terminate the Arthas server and all clients
## JVM-related ## JVM
* [dashboard](dashboard.md) - real-time dashboard for the current system * [dashboard](dashboard.md) - real-time dashboard for the current system
* [thread](thread.md) - thread profile * [thread](thread.md) - thread profile
* [jvm](jvm.md) - JVM profile * [jvm](jvm.md) - JVM profile
* [sysprop](sysprop.md) - check or modify JVM system properties * [sysprop](sysprop.md) - check or modify JVM system properties
* **New!** [getstatic](getstatic.md) - check the static properties of some class * **New!** [getstatic](getstatic.md) :clap: - check the static properties of classes
## class/classloader - related ## class/classloader
* [sc](sc.md) - methods' profile of the classes loaded by JVM * [sc](sc.md) - check profiles of the classes loaded by JVM
* [sm](sm.md) - methods' profile of the loaded classes * [sm](sm.md) - check methods' profile
* [dump](dump.md) - dump out the byte code of the loaded class to specified location * [dump](dump.md) - dump out the byte code of the loaded classes to specified location
* [redefine](redefine.md) - load external `*.class` files and re-define the JVM * [redefine](redefine.md) - load external `*.class` files and re-define the JVM-loaded classes
* [jad](jad.md) - de-compile the specified loaded classes * [jad](jad.md) - de-compile the specified loaded classes
* [classloader](classloader.md) - check the inheritance structure, urls, class loading info of class cloader; using classloader to getResource * [classloader](classloader.md) - check the inheritance structure, urls, class loading info of class cloader; using classloader to get the url of the resource e.g. `java/lang/String.class`
## monitor/watch/trace - related ## monitor/watch/trace - related
> **Attention**: commands here are taking advantage of `byte code injection`, which means we are using [AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) to monitor and analyze the classes. So when using it for online troubleshooting, you'd better *explicitly specifically* specify the classes and also remember to remove the injected code by `shutdown` or `reset` (for specific classes). > **Attention**: commands here are taking advantage of `byte code injection`, which means we are using [AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) to monitor and analyze the classes. So when using it for online troubleshooting, you'd better *explicitly specifically* specify the classes and also remember to remove the injected code by `shutdown` or `reset`.
* [monitor](monitor.md) * [monitor](monitor.md) - monitor the `class-pattern` & `method-pattern` matched methods' invoking traces
* [watch](watch.md) * [watch](watch.md) - watch/monitor methods in data aspect including `return values`, `exceptions` and `parameters`
* [trace](trace.md) - track the call stack trace and collect the time cost for each method call * [trace](trace.md) - track the method calling trace along with the time cost for each call
* [stack](stack.md) - print the call stack trace of the current method * [stack](stack.md) - print the call stack trace of the current method in a persistent way
* [tt](tt.md) - record the arguments and returned value for the methods, history included * [tt](tt.md) - record the arguments and returned value for the methods, history included
## options ## options
@@ -48,13 +48,15 @@ Advanced Usage
`pipe` is supported in Arthas, e.g. `sm org.apache.log4j.Logger | grep <init>` `pipe` is supported in Arthas, e.g. `sm org.apache.log4j.Logger | grep <init>`
* grep Commands supported in `pipe`:
* grep - filtering
* plaintext - remove the color * plaintext - remove the color
* wc * wc - line counting
## async in background ## async in background
[async](async.md) will be a great help, when the `incident` seldom occurs and you are `[watch](watch.md)`ing it. [async](async.md) will be a great help, when the `incident` seldom occurs and you are [`watch`](watch.md)ing it.
* jobs - list all jobs * jobs - list all jobs
@@ -63,14 +65,9 @@ Advanced Usage
* bg - put the paused job to the background * bg - put the paused job to the background
* tips - a) use `>` to redirect the output; b) use `&` to put the job to the background; c) disconnecting the session will not influence the job (the default life is 1 day) * tips - a) use `>` to redirect the output; b) use `&` to put the job to the background; c) disconnecting the session will not influence the job (the default life is 1 day)
## Web Console
Using websocket to connect Arthas
* [Web Console](web-console.md)
## Others ## Others
* [Web Console](web-console.md) - using websocket to connect Arthas
* [log the output](save-log.md) * [log the output](save-log.md)
* [batch](batch-support.md) * [batch](batch-support.md)
* [how to use ognl](https://github.com/alibaba/arthas/issues/11) * [how to use ognl](https://github.com/alibaba/arthas/issues/11)
+9 -9
View File
@@ -3,20 +3,20 @@ options
> Global options > Global options
| Name | Default Value | Description | |&nbsp;&nbsp;&nbsp;Name&nbsp;&nbsp;&nbsp;| Default Value | Description |
| ------------------ | ----- | ---------------------------------------- | | ------------------------- | ----- | ---------------------------------------- |
| unsafe | false | Enable support for system-level class enhancement; JVM might crash, if you turn on this switch (please use with great caution!) | | unsafe | false | Enable system-level class enhancement; JVM might crash, if you turn it on (use with great caution :exclamation:) |
| dump | false | Enable support for dumping enhanced class to external file,if turned on,class file will be dumped to`/${application dir}/arthas-class-dump/`,please see console for specific location | | dump | false | Enable support for dumping enhanced class to external file; if turned on, class file will be dumped to`/${application dir}/arthas-class-dump/`,please check console output for specific location |
| batch-re-transform | true | re-transform matched classes in batch | | batch-re-transform | true | re-transform matched classes in batch |
| json-format | false | Enable output in JSON format | | json-format | false | Enable output in JSON format |
| disable-sub-class | false | Disabling child class matching,by default child class will be matched during matching target class,if you wish exact matching,you can turn this off | | disable-sub-class | false | Disabling child class matching: by default child class will be matched while matching target class; if you wish exact matching, you should turn it off |
| debug-for-asm | false | Print ASM related debug message | | debug-for-asm | false | Print ASM-related debug message |
| save-result | false | Enable saving logs for task results,when turn to true, all command results will be saved to `/home/admin/logs/arthas/arthas.log` | | save-result | false | Enable saving logs for task results: when true, all command results will be saved to `/home/admin/logs/arthas/arthas.log` |
| job-timeout | 1d | Default time-out time for back-stage tasks,if exceed this time,task will be stopped;i.e. 1d, 2h, 3m, 25s,representing day、hour、minute、second | | job-timeout | 1d | Default timeout for background jobs: jobs will be stopped once timed out (i.e. 1d, 2h, 3m, 25s)|
### Usage ### Usage
For example,if you wish to save logs for command results, you can use following command: Saving logs for command outputs, you can:
``` ```
$ options save-result true $ options save-result true
+4 -5
View File
@@ -56,8 +56,7 @@ public class Demo {
sudo -u admin -EH ./as.sh sudo -u admin -EH ./as.sh
``` ```
2. For more details of the booting script, please refer to [starting arthas](start-arthas.md). 2. For more details of the booting script, please refer to [Start Arthas](start-arthas.md).
3. If you cannot *attach* the target process, please check the logs under `~/logs/arthas` for troubleshooting. 3. If you cannot *attach* the target process, please check the logs under `~/logs/arthas` for troubleshooting.
4. Selecting the target process as: 4. Selecting the target process as:
@@ -90,8 +89,8 @@ public class Demo {
version: 3.0.1-RC-SNAPSHOT version: 3.0.1-RC-SNAPSHOT
pid: 13560 pid: 13560
timestamp: 1536656867894 timestamp: 1536656867894
'`'`'`'`'`'`'`'`'`
' $
``` ```
### Windows ### Windows
@@ -152,7 +151,7 @@ ts=2018-09-10 17:53:14;result=@Integer[624]
ts=2018-09-10 17:53:15;result=@Integer[625] ts=2018-09-10 17:53:15;result=@Integer[625]
``` ```
[more advanced functions](advanced-use.md) [more advanced usages](advanced-use.md)
## 5. Exit Arthas ## 5. Exit Arthas
+11 -11
View File
@@ -1,38 +1,38 @@
watch watch
===== =====
Monitor the methods in data aspect including `return value`, `exceptions` and `parameters`. Monitor methods in data aspect including `return values`, `exceptions` and `parameters`.
With the help of [OGNL](https://en.wikipedia.org/wiki/OGNL), you can easily check the details of the variables. With the help of [OGNL](https://en.wikipedia.org/wiki/OGNL), you can easily check the details of variables.
### Parameters & Options ### Parameters & Options
There are four different usage scenarios for `watch` command, which makes it the most complicated command in Arthas. There are four different scenarios for `watch` command, which makes it a rather complicated command in Arthas.
|Name|Specification| |Name|Specification|
|---:|:---| |---:|:---|
|*class-pattern*|pattern for the class name| |*class-pattern*|pattern for the class name|
|*method-pattern*|pattern for the method name| |*method-pattern*|pattern for the method name|
|*express*|expression to monitor| |*express*|expression to monitor|
|*condition-express*|condition expression| |*condition-express*|condition expression to filter|
|[b]|before invoking| |[b]|before method being invoked|
|[e]|encountering exceptions| |[e]|encountering exceptions|
|[s]|returned normally| |[s]|returned normally|
|[f]|returned normally and abnormally| |[f]|returned normally and abnormally|
|[E]|turn on regx matching while the default is wildcards matching| |[E]|turn on regex matching while the default is wildcards matching|
|[x:]|the depth to print the specified property with default value: 1| |[x:]|the depth to print the specified property with default value: 1|
F.Y.I F.Y.I
1. any valid OGNL expression as `"{params,returnObj}"` supported 1. any valid OGNL expression as `"{params,returnObj}"` supported
2. there are four *watching* points: `-b`, `-e`, `-s` and `-f` (the first three are off in default while `-f` on); 2. there are four *watching* points: `-b`, `-e`, `-s` and `-f` (the first three are off in default while `-f` on);
3. at the *watching* point, Arthas will use the `expression` to calculate the values and print them out; 3. at the *watching* point, Arthas will use the *expression* to evaluate the variables and print them out;
4. `in-parameters` and `out-parameters` are different since they can be modified; `params` stands for `in-parameters` in `-b`while `out-parameters` in other *watching* points; 4. `in-parameters` and `out-parameters` are different since they can be modified within the invoked methods; `params` stands for `in-parameters` in `-b`while `out-parameters` in other *watching* points;
5. there is no `return value` and `exceptions` when using `-b`. 5. there is no `return values` and `exceptions` when using `-b`.
Advanced: Advanced:
* [Critical fields in expression](advice-class.md) * [Critical fields in *expression*](advice-class.md)
* [Special usage](https://github.com/alibaba/arthas/issues/71) * [Special usages](https://github.com/alibaba/arthas/issues/71)
* [OGNL official guide](https://commons.apache.org/proper/commons-ognl/language-guide.html) * [OGNL official guide](https://commons.apache.org/proper/commons-ognl/language-guide.html)
### Usage ### Usage