mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-30 07:32:57 +00:00
Typo fix and description improvements
This commit is contained in:
4 files changed
+46
-50
No files matched your search
@@ -3,40 +3,40 @@ Advanced Usage
|
||||
|
||||
## Basic
|
||||
|
||||
- help
|
||||
- help - show help info
|
||||
- cls - clear out the current screen
|
||||
- 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
|
||||
- quit/exit - exit the current Arthas client without affecting other clients
|
||||
- shutdown - terminate the Arthas server and all clients
|
||||
|
||||
## JVM-related
|
||||
## JVM
|
||||
|
||||
* [dashboard](dashboard.md) - real-time dashboard for the current system
|
||||
* [thread](thread.md) - thread profile
|
||||
* [jvm](jvm.md) - JVM profile
|
||||
* [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
|
||||
* [sm](sm.md) - methods' profile of the loaded classes
|
||||
* [dump](dump.md) - dump out the byte code of the loaded class to specified location
|
||||
* [redefine](redefine.md) - load external `*.class` files and re-define the JVM
|
||||
* [sc](sc.md) - check profiles of the classes loaded by JVM
|
||||
* [sm](sm.md) - check methods' profile
|
||||
* [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-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
|
||||
|
||||
> **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)
|
||||
* [watch](watch.md)
|
||||
* [trace](trace.md) - track the call stack trace and collect the time cost for each method call
|
||||
* [stack](stack.md) - print the call stack trace of the current method
|
||||
* [monitor](monitor.md) - monitor the `class-pattern` & `method-pattern` matched methods' invoking traces
|
||||
* [watch](watch.md) - watch/monitor methods in data aspect including `return values`, `exceptions` and `parameters`
|
||||
* [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 in a persistent way
|
||||
* [tt](tt.md) - record the arguments and returned value for the methods, history included
|
||||
|
||||
## options
|
||||
@@ -48,13 +48,15 @@ Advanced Usage
|
||||
|
||||
`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
|
||||
* wc
|
||||
* wc - line counting
|
||||
|
||||
## 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
|
||||
@@ -63,14 +65,9 @@ Advanced Usage
|
||||
* 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)
|
||||
|
||||
## Web Console
|
||||
|
||||
Using websocket to connect Arthas
|
||||
|
||||
* [Web Console](web-console.md)
|
||||
|
||||
## Others
|
||||
|
||||
* [Web Console](web-console.md) - using websocket to connect Arthas
|
||||
* [log the output](save-log.md)
|
||||
* [batch](batch-support.md)
|
||||
* [how to use ognl](https://github.com/alibaba/arthas/issues/11)
|
||||
|
||||
@@ -3,20 +3,20 @@ options
|
||||
|
||||
> Global options
|
||||
|
||||
| Name | 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!) |
|
||||
| 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 |
|
||||
| Name | Default Value | Description |
|
||||
| ------------------------- | ----- | ---------------------------------------- |
|
||||
| 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 check console output for specific location |
|
||||
| batch-re-transform | true | re-transform matched classes in batch |
|
||||
| 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 |
|
||||
| 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` |
|
||||
| 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 |
|
||||
| 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 |
|
||||
| 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 timeout for background jobs: jobs will be stopped once timed out (i.e. 1d, 2h, 3m, 25s)|
|
||||
|
||||
### 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
|
||||
|
||||
@@ -56,8 +56,7 @@ public class Demo {
|
||||
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.
|
||||
|
||||
4. Selecting the target process as:
|
||||
@@ -90,8 +89,8 @@ public class Demo {
|
||||
version: 3.0.1-RC-SNAPSHOT
|
||||
pid: 13560
|
||||
timestamp: 1536656867894
|
||||
'`'`'`'`'`'`'`'`'`
|
||||
'
|
||||
|
||||
$
|
||||
```
|
||||
|
||||
### 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]
|
||||
```
|
||||
|
||||
[more advanced functions](advanced-use.md)
|
||||
[more advanced usages](advanced-use.md)
|
||||
|
||||
## 5. Exit Arthas
|
||||
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
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
|
||||
|
||||
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|
|
||||
|---:|:---|
|
||||
|*class-pattern*|pattern for the class name|
|
||||
|*method-pattern*|pattern for the method name|
|
||||
|*express*|expression to monitor|
|
||||
|*condition-express*|condition expression|
|
||||
|[b]|before invoking|
|
||||
|*condition-express*|condition expression to filter|
|
||||
|[b]|before method being invoked|
|
||||
|[e]|encountering exceptions|
|
||||
|[s]|returned normally|
|
||||
|[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|
|
||||
|
||||
F.Y.I
|
||||
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);
|
||||
3. at the *watching* point, Arthas will use the `expression` to calculate the values 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;
|
||||
5. there is no `return value` and `exceptions` when using `-b`.
|
||||
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 within the invoked methods; `params` stands for `in-parameters` in `-b`while `out-parameters` in other *watching* points;
|
||||
5. there is no `return values` and `exceptions` when using `-b`.
|
||||
|
||||
|
||||
Advanced:
|
||||
* [Critical fields in expression](advice-class.md)
|
||||
* [Special usage](https://github.com/alibaba/arthas/issues/71)
|
||||
* [Critical fields in *expression*](advice-class.md)
|
||||
* [Special usages](https://github.com/alibaba/arthas/issues/71)
|
||||
* [OGNL official guide](https://commons.apache.org/proper/commons-ognl/language-guide.html)
|
||||
|
||||
### Usage
|
||||
@@ -57,7 +57,7 @@ A demo:
|
||||
return list.size();
|
||||
}
|
||||
```
|
||||
#### Check the `out-parameters`and `return value`
|
||||
#### Check the `out-parameters` and `return value`
|
||||
|
||||
```shell
|
||||
$ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "{params,returnObj}" -x 2
|
||||
|
||||
Reference in new issue
Block a user