mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-12 22:41:26 +00:00
update doc
This commit is contained in:
1 parent
ac10e3bf71
commit
89fa8a4c84
39 files changed
+91
-91
No files matched your search
@@ -8,7 +8,7 @@ Asynchronous jobs in arthas, using commands related to linux jobs.[linux man job
|
||||
|
||||
For example, execute the trace command in the background:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
trace Test t &
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ trace Test t &
|
||||
If you want to list all background jobs, you can execute the `jobs` command and the results are as follows:
|
||||
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ jobs
|
||||
[10]*
|
||||
Stopped watch com.taobao.container.Test test "params[0].{? #this.name == null }" -x 2
|
||||
@@ -54,7 +54,7 @@ When the job is executing in the foreground, such as directly calling the comman
|
||||
|
||||
The job output can be redirect to the specified file by `>` or `>>`, and can be used together with `&` to implement the asynchronous job of the arthas command. such as:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ trace Test t >> test.out &
|
||||
```
|
||||
|
||||
@@ -63,7 +63,7 @@ The trace command will be executed in the background and the output will be redi
|
||||
|
||||
When connecting to a remote arthas server, you may not be able to view the files of the remote machine. Arthas also supports automatic redirection to the local cache file. Examples are as follows:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ trace Test t >> &
|
||||
job id : 2
|
||||
cache location : /Users/gehui/logs/arthas-cache/28198/2
|
||||
|
||||
@@ -28,12 +28,12 @@ Attention:
|
||||
|
||||
Using `-b` to turn on script mode, and `-f` to run it and you can also *redirect* the output as:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
./as.sh -b -f /var/tmp/test.as 56328 > test.out
|
||||
```
|
||||
|
||||
#### Step-3: Check the outputs
|
||||
|
||||
```sh
|
||||
```bash
|
||||
cat test.out
|
||||
```
|
||||
@@ -19,7 +19,7 @@ It can be a great help for `ResourceNotFoundException` when you can use command
|
||||
|
||||
* Categorised by class loader
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ classloader
|
||||
name numberOfInstances loadedCountTotal
|
||||
com.taobao.pandora.service.loader.ModuleClassLoader 29 11659
|
||||
@@ -38,7 +38,7 @@ Affect(row-cnt:11) cost in 66 ms.
|
||||
|
||||
* Categorized by class loader instance
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ classloader -l
|
||||
name loadedCount hash parent
|
||||
BootstrapClassLoader 3711 null null
|
||||
|
||||
+13
-13
@@ -5,32 +5,32 @@ Arthas Documentation
|
||||
|
||||

|
||||
|
||||
`Arthas` is an Java Diagnostic tool open sourced by Alibaba.
|
||||
`Arthas` is a Java Diagnostic tool open sourced by Alibaba.
|
||||
|
||||
Arthas can help developer trouble-shooting production issues for Java applications without modifying your code or restating your server.
|
||||
Arthas help developers in trouble-shooting production issues for Java applications without modifying code or restarting servers.
|
||||
|
||||
### Background
|
||||
|
||||
In production system, sometimes the networks is unreachable from local development environment. If you encounter some issues in production system, it is impossible to use IDE to debug the application remotely. More importantly, debugging in production is unacceptable, because it will suspend all the threads, which leads to business unavailability.
|
||||
Often times, the production system network is inaccessible from local development environment. If issues are encountered in production systems, it is impossible to use IDE to debug the application remotely. More importantly, debugging in production environment is unacceptable, as it will suspend all the threads, which leads to blocking of business services.
|
||||
|
||||
Some may think of reproducing the same issue on the test/staging environment, however, some tricky issue either can hardly be reproduced on a different environment, or even disappeared once restarted.
|
||||
Developers could always try to reproduce the same issue on the test/staging environment. However, this is tricky as some issues cannot be be reproduced easily on a different environment, or even disappear once restarted.
|
||||
|
||||
Thinking of adding some logs to your code? You have to go through test, staging, and then on to production. Time is money! That is a lot inefficient! Besides, the issue may not be reproducible once restart your JVM, as described above.
|
||||
And if you're thinking of adding some logs to your code to help trouble-shoot the issue, you will have to go through the following lifecycle; test, staging, and then to production. Time is money! This approach is inefficient! Besides, the issue may not be reproducible once the JVM is restarted, as described above.
|
||||
|
||||
Arthas is born to solve these issues. You can trouble-shoot your production issue on-the-fly. No JVM restart, no additional code changes. Arthas works as an observer, which will never suspend your existing threads.
|
||||
Arthas was built to solve these issues. A developer can trouble-shoot your production issues on-the-fly. No JVM restart, no additional code changes. Arthas works as an observer, which will never suspend your existing threads.
|
||||
|
||||
### Key features
|
||||
|
||||
* Check whether a class is loaded? And whether is class loaded from? (Useful for trouble-shooting jar file conflicts)
|
||||
* Check whether a class is loaded? Or where the class is loaded from? (Useful for trouble-shooting jar file conflicts)
|
||||
* Decompile a class to ensure the code is running as expected.
|
||||
* View classloader statistics, e.g. how may classloaders are there? how many class is loaded per classloader? What is the classloader hierarchy? Is there possible classloader leaks?
|
||||
* View classloader statistics, e.g. the number of classloaders, the number of classes loaded per classloader, the classloader hierarchy, possible classloader leaks, etc.
|
||||
* View the method invocation details, e.g. method parameter, return object, thrown exception, and etc.
|
||||
* Check the stack trace of specified method invocation. This is useful when you would like to know who is calling your method?
|
||||
* Check the stack trace of specified method invocation. This is useful when a developers wants to know the caller of the said method.
|
||||
* Trace the method invocation to find slow sub-invocations.
|
||||
* Monitor method invcation statistics, e.g. qps, rt, success rate and etc.
|
||||
* Monitoring your system metrics, thread states and cpu usage, gc statistics, and etc.
|
||||
* Support command line interactive mode, with auto completed feature enabled.
|
||||
* Support telnet and websocket, which enables both local and remote diagnostics with command line and browsers.
|
||||
* Monitor method invocation statistics, e.g. qps, rt, success rate and etc.
|
||||
* Monitor system metrics, thread states and cpu usage, gc statistics, and etc.
|
||||
* Supports command line interactive mode, with auto-complete feature enabled.
|
||||
* Supports telnet and websocket, which enables both local and remote diagnostics with command line and browsers.
|
||||
|
||||
|
||||
Contents
|
||||
|
||||
@@ -122,7 +122,7 @@ Affect(row-cnt:1) cost in 190 ms.
|
||||
|
||||
De-compile the specified method:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ jad com.taobao.container.web.arthas.rest.MetricsController directMetrics
|
||||
|
||||
ClassLoader:
|
||||
|
||||
@@ -5,7 +5,7 @@ Log command outputs for later analysis, turned off by default.
|
||||
|
||||
To turn it on, using [options](options.md) as:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ options save-result true
|
||||
NAME BEFORE-VALUE AFTER-VALUE
|
||||
----------------------------------------
|
||||
@@ -23,7 +23,7 @@ F.Y.I
|
||||
:notes: :notes:
|
||||
With the latest Arthas, you can log the outputs asynchronously in the background:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ trace Test t >> &
|
||||
job id : 2
|
||||
cache location : /Users/zhuyong/logs/arthas-cache/28198/2
|
||||
|
||||
@@ -61,7 +61,7 @@ org.apache.catalina.connector.Connector->getMaxCookieCount
|
||||
|
||||
```
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ sm org.apache.catalina.connector.Connector -d
|
||||
declaring-class org.apache.catalina.connector.Connector
|
||||
constructor-name <init>
|
||||
|
||||
@@ -7,7 +7,7 @@ Start Arthas
|
||||
./as.sh
|
||||
```
|
||||
|
||||
```sh
|
||||
```bash
|
||||
➜ bin git:(develop) ✗ ./as.sh
|
||||
Found existing java process, please choose one and hit RETURN.
|
||||
[1]: 3088 org.jetbrains.idea.maven.server.RemoteMavenServer
|
||||
|
||||
@@ -100,7 +100,7 @@ $ thread 1
|
||||
|
||||
Using `-b`, we can effectively locate the threads holding locks blocking other threads resulting in a frozen system.
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ thread -b
|
||||
"http-bio-8080-exec-4" Id=27 TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
@@ -144,7 +144,7 @@ $ thread -b
|
||||
|
||||
#### thread -i specify the collecting interval
|
||||
|
||||
```sh
|
||||
```bash
|
||||
$ thread -n 3 -i 1000
|
||||
"as-command-execute-daemon" Id=4759 cpuUsage=23% RUNNABLE
|
||||
at sun.management.ThreadImpl.dumpThreads0(Native Method)
|
||||
|
||||
Reference in new issue
Block a user