update doc

pull/483/head
hengyunabc 6 years ago
parent 2610db8bbf
commit ae2b1c470f

@ -54,7 +54,7 @@ Arthas provides `pipe` to process the result returned from commands further, e.g
## async in background
[async](async.md) can be handy when a problem is hardly to reproduce in the production enviornment, e.g. one `watch` condition may happen only once in one single day.
[async](async.md) can be handy when a problem is hardly to reproduce in the production environment, e.g. one `watch` condition may happen only once in one single day.
* job control - use `>` to redirect result into the log file, use `&` to put the job to the background. Job keeps running even if the session is disconnected (the session lifecycle is 1 day by default)
* jobs - list all jobs

@ -1,4 +1,4 @@
Critical Fields in Expressions
Fundamental Fields in Expressions
==============================
There is a very fundamental class `Advice` for the expressions used in filtering, tracing or monitoring and other aspects in commands.
@ -16,29 +16,29 @@ public class Advice {
private final boolean isBefore;
private final boolean isThrow;
private final boolean isReturn;
...
// getter/setter
}
```
Description for the variables in the class `Advice`:
|Name|Specification|
|---:|:---|
|loader|class loader of the class|
|clazz|the reference of the class|
|method|the reflective reference of the method|
|target|the instance of the class|
|params|the parameters of the method, which is an array (when there is no argument in the method, it will be an empty array)|
|returnObj|the return value of the method - only when `isReturn==true`, it's a valid result but if the return value is `void` then it will be a `null`|
|throwExp|the exceptions thrown by the method invoking - only when `isThrow==true`, it's a valid thrown exception|
|isBefore|assistant checking flag used in [`before-watching` point](watch.md) and at this very moment: `isBefore==true`, `isThrow==false` and `isReturn==false` since it's before we invoke the method|
|isThrow|assistant checking flag: whether the current method invoking ends with exceptions|
|isReturn|assistant checking flag: whether the method invoking exits normally without exceptions|
F.Y.I
1. all the *fields* mentioned in the table above can be used directly in the `expressions`;
2. if the expressions are [invalid OGNL](https://en.wikipedia.org/wiki/OGNL), the command will be cancelled automatically with hints to correct the expressions;
3. [typical use cases](https://github.com/alibaba/arthas/issues/71);
4. [OGNL official usage guide](https://commons.apache.org/proper/commons-ognl/language-guide.html).
|loader|the class loader for the current called class|
|clazz|the reference to the current called class|
|method|the reference to the current called method|
|target|the instance of the current called class|
|params|the parameters for the current call, which is an array (when there's no parameter, it will be an empty array)|
|returnObj|the return value from the current call - only available when the method call returns normally (`isReturn==true`), and `null` is for `void` return value|
|throwExp|the exceptions thrown from the current call - only available when the method call throws exception (`isThrow==true`)|
|isBefore|flag to indicate the method is about to execute. `isBefore==true` but `isThrow==false` and `isReturn==false` since it's no way to know how the method call will end|
|isThrow|flag to indicate the method call ends with exception thrown|
|isReturn|flag to indicate the method call ends normally without exception thrown|
All variables listed above can be used directly in the [OGNL expression](https://commons.apache.org/proper/commons-ognl/language-guide.html). The command will not execute and exit if there's illegal OGNL grammar or unexpected variable in the expression.
* [typical use cases](https://github.com/alibaba/arthas/issues/71);
* [OGNL language guide](https://commons.apache.org/proper/commons-ognl/language-guide.html).

@ -1,7 +1,7 @@
Arthas Async Jobs
===
Asynchronous jobs in arthas, using commands related to linux jobs.[linux man jobs](http://man7.org/linux/man-pages/man1/jobs.1p.html)。
Asynchronous jobs in arthas. The idea is borrowed from [linux jobs](http://man7.org/linux/man-pages/man1/jobs.1p.html).
## 1. Use & to run the command in the background
@ -12,6 +12,8 @@ For example, execute the trace command in the background:
trace Test t &
```
By doing this, the current command is put to the background to run, you can continue to execute other commands in the console.
## 2. List background jobs
If you want to list all background jobs, you can execute the `jobs` command and the results are as follows:
@ -27,41 +29,38 @@ $ jobs
session : 3648e874-5e69-473f-9eed-7f89660b079b (current)
```
You can see that there is currently a background job executing.
You can see that there is currently a background job executing:
* job id is 10, `*` indicates that this job is created by the current session.
* status is `Stopped`
* execution count is the number of executions, which have been executed 19 times since the start.
* timeout date: After this time, the job will automatically timeout and exit.
* timeout date: timeout timestamp, when the time exceeds this timestamp, the job will be automatically timeout and exit.
## 3. Suspend and Cannel job
## 3. Suspend and cancel job
When the job is executing in the foreground, such as directly calling the command `trace Test t` or calling the background job command `trace Test t &`, the job is transferred to the foreground through the `fg` command. At this point, the console cannot continue to execute the command, but can receive and process the following keyboard events:
When the job is executing in the foreground, for example, directly executing the command `trace Test t`, or executing the background job command `trace Test t &`, then putting the job back to the forground via `fg` command, the console cannot continue to execute other command, but can receive and process the following keyboard events:
* ctrl + z: Suspend the job, the job status will change to `Stopped`, and the job can be restarted by `bg <job-id>` or `fg <job-id>`
* ctrl + c: Stop the job
* ctrl + d: According to linux semantics should be the exit terminal, currently arthas ignore this input.
* ctrl + d: According to linux semantics this should lead to exit the terminal, right now Arthas has not implemented this yet, therefore simply ignore this keystroke.
## 4. fg/bg, Bring a background job to the foreground/Restart a stopped background job
## 4. fg/bg, switch the job from the foreground to the background, and vise verse
* When the job is executed in the background or suspended (`ctrl + z` to suspend job), executing `fg <job-id>` will transfer the corresponding job to the foreground to continue execution.
* When the job is suspended (`ctrl + z` to suspend job), executing `bg <job-id>` will continue the corresponding job in the background.
* A job created by a non-current session can only be executed by the current session fg to the foreground.
* When a job is executed in the background or in suspended status (use `ctrl + z` to suspend job), `fg <job-id>` can transfer the job to the foreground to continue to run.
* When a job is in suspended status (use `ctrl + z` to suspend job), `bg <job-id>` can put the job to the background to continue to run.
* A job created by other session can only be put to the foreground to run by using `fg` in the current session.
## 5. Redirect the job output
## 5. Redirect the output
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:
The job output can be redirect to the specified file by `>` or `>>`, and can be used together with `&`. By doing this, you can achieve running commands asynchronously, for example:
```bash
$ trace Test t >> test.out &
```
The trace command will be executed in the background and the output will be redirect to `~/logs/arthas-cache/test.out`. You can continue to execute other commands in the console.
The trace command will be running in the background and the output will be redirect to `~/logs/arthas-cache/test.out`. You can continue to execute other commands in the console, at the same time, you can also examine the execution result from the output file.
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:
When connect to a remote Arthas server, you may not be able to view the output file on the remote machine. In this case, Arthas also supports automatically redirecting the output to the local cache file. Examples are as follows:
```bash
$ trace Test t >> &
@ -69,9 +68,7 @@ job id : 2
cache location : /Users/gehui/logs/arthas-cache/28198/2
```
You can see that does not specify the redirect file after `>>`, arthas will automatically redirect the job output to the `~/logs/arthas-cache`.
In the above example, pid is `28198` and job id is `2`.
If output path is not given, Arthas will automatically redirect the output to the local cache. Job id and cache location will be shown on the console. Cache location is a directory where the output files are put. For one given job, the path of its output file contains PID and job id in order to avoid potential conflict with other jobs. In the above example, pid is `28198` and job id is `2`.
## 6. Stop job
@ -79,5 +76,5 @@ If you want to stop background job, just `kill <job-id>`.
## 7. Others
* Support up to 8 commands at the same time redirect the output to the log file.
* Do not open too many background asynchronous commands at the same time to avoid affecting the performance of the target JVM.
* Support up to 8 commands at the same time to redirect the output to the log files.
* Do not open too many background jobs at the same time to avoid negative performance effect to the target JVM.

@ -3,10 +3,10 @@ Manual Installation
### Download
Latest `bin.zip `: [![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://search.maven.org/classic/#search%7Cga%7C1%7Cg%3A%22com.taobao.arthas%22%20AND%20a%3A%22arthas-packaging%22)
**Latest `bin.zip`**: [![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://search.maven.org/classic/#search%7Cga%7C1%7Cg%3A%22com.taobao.arthas%22%20AND%20a%3A%22arthas-packaging%22)
If the downloading is rather clumsy, try to download from the [repository in AliYun](https://maven.aliyun.com/); the downloading URL template is (remember to fill up the version `3.x.x` template to your needs)
If the download is slow, try to download from the [repository in AliYun](https://maven.aliyun.com/); the downloading URL template is (remember to fill up the version `3.x.x` template to your needs)
`https://maven.aliyun.com/repository/public/com/taobao/arthas/arthas-packaging/3.x.x/arthas-packaging-3.x.x-bin.zip`
### Unzip

@ -95,7 +95,7 @@ public class Demo {
### Windows
Open the *DOS* console, under the unzipped arthas folder execture `as.bat <pid>`
Open the *DOS* console, under the unzipped arthas folder execute `as.bat <pid>`
## 3. Check the Dashboard

@ -38,7 +38,7 @@ v2017-09-11
v2017-05-11
----
* [improvement] [`tt`](tt.md) investigating/recording level one to avoid too much performance overhea
* [improvement] [`tt`](tt.md) investigating/recording level one to avoid too much performance overhead
* [bug] fix Chinese characters can not be presented issue
v2017-05-12

@ -139,7 +139,7 @@ $ thread -b
- java.util.concurrent.ThreadPoolExecutor$Worker@31a6493e
```
> Attention: only `synchronized` blocked threads can be located for now, `JUL` not supported yet.
Attention: only `synchronized` blocked threads can be located for now, while `java.util.concurrent.Lock` not supported yet.
#### thread -i specify the collecting interval

@ -249,7 +249,7 @@
</div>
<div class="section" id="async-in-background">
<span id="async-in-background"></span><h2>async in background<a class="headerlink" href="#async-in-background" title="Permalink to this headline"></a></h2>
<p><a class="reference internal" href="async.html"><span class="doc">async</span></a> can be handy when a problem is hardly to reproduce in the production enviornment, e.g. one <code class="docutils literal notranslate"><span class="pre">watch</span></code> condition may happen only once in one single day.</p>
<p><a class="reference internal" href="async.html"><span class="doc">async</span></a> can be handy when a problem is hardly to reproduce in the production environment, e.g. one <code class="docutils literal notranslate"><span class="pre">watch</span></code> condition may happen only once in one single day.</p>
<ul class="simple">
<li>job control - use <code class="docutils literal notranslate"><span class="pre">&gt;</span></code> to redirect result into the log file, use <code class="docutils literal notranslate"><span class="pre">&amp;</span></code> to put the job to the background. Job keeps running even if the session is disconnected (the session lifecycle is 1 day by default)</li>
<li>jobs - list all jobs</li>

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Critical Fields in Expressions &mdash; Arthas 3.0.5-SNAPSHOT documentation</title>
<title>Fundamental Fields in Expressions &mdash; Arthas 3.0.5-SNAPSHOT documentation</title>
@ -176,7 +176,7 @@
<li><a href="watch.html">watch</a> &raquo;</li>
<li>Critical Fields in Expressions</li>
<li>Fundamental Fields in Expressions</li>
<li class="wy-breadcrumbs-aside">
@ -197,8 +197,8 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="critical-fields-in-expressions">
<span id="critical-fields-in-expressions"></span><h1>Critical Fields in Expressions<a class="headerlink" href="#critical-fields-in-expressions" title="Permalink to this headline"></a></h1>
<div class="section" id="fundamental-fields-in-expressions">
<span id="fundamental-fields-in-expressions"></span><h1>Fundamental Fields in Expressions<a class="headerlink" href="#fundamental-fields-in-expressions" title="Permalink to this headline"></a></h1>
<p>There is a very fundamental class <code class="docutils literal notranslate"><span class="pre">Advice</span></code> for the expressions used in filtering, tracing or monitoring and other aspects in commands.</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="kd">public</span> <span class="kd">class</span> <span class="nc">Advice</span> <span class="o">{</span>
@ -212,11 +212,12 @@
<span class="kd">private</span> <span class="kd">final</span> <span class="kt">boolean</span> <span class="n">isBefore</span><span class="o">;</span>
<span class="kd">private</span> <span class="kd">final</span> <span class="kt">boolean</span> <span class="n">isThrow</span><span class="o">;</span>
<span class="kd">private</span> <span class="kd">final</span> <span class="kt">boolean</span> <span class="n">isReturn</span><span class="o">;</span>
<span class="o">...</span>
<span class="c1">// getter/setter </span>
<span class="o">}</span>
</pre></div>
</div>
<p>Description for the variables in the class <code class="docutils literal notranslate"><span class="pre">Advice</span></code>:</p>
<table border="1" class="docutils">
<thead>
<tr>
@ -227,52 +228,50 @@
<tbody>
<tr>
<td align="right">loader</td>
<td align="left">class loader of the class</td>
<td align="left">the class loader for the current called class</td>
</tr>
<tr>
<td align="right">clazz</td>
<td align="left">the reference of the class</td>
<td align="left">the reference to the current called class</td>
</tr>
<tr>
<td align="right">method</td>
<td align="left">the reflective reference of the method</td>
<td align="left">the reference to the current called method</td>
</tr>
<tr>
<td align="right">target</td>
<td align="left">the instance of the class</td>
<td align="left">the instance of the current called class</td>
</tr>
<tr>
<td align="right">params</td>
<td align="left">the parameters of the method, which is an array (when there is no argument in the method, it will be an empty array)</td>
<td align="left">the parameters for the current call, which is an array (when there's no parameter, it will be an empty array)</td>
</tr>
<tr>
<td align="right">returnObj</td>
<td align="left">the return value of the method - only when <code>isReturn==true</code>, it's a valid result but if the return value is <code>void</code> then it will be a <code>null</code></td>
<td align="left">the return value from the current call - only available when the method call returns normally (<code>isReturn==true</code>), and <code>null</code> is for <code>void</code> return value</td>
</tr>
<tr>
<td align="right">throwExp</td>
<td align="left">the exceptions thrown by the method invoking - only when <code>isThrow==true</code>, it's a valid thrown exception</td>
<td align="left">the exceptions thrown from the current call - only available when the method call throws exception (<code>isThrow==true</code>)</td>
</tr>
<tr>
<td align="right">isBefore</td>
<td align="left">assistant checking flag used in <a href="watch.md"><code>before-watching</code> point</a> and at this very moment: <code>isBefore==true</code>, <code>isThrow==false</code> and <code>isReturn==false</code> since it's before we invoke the method</td>
<td align="left">flag to indicate the method is about to execute. <code>isBefore==true</code> but <code>isThrow==false</code> and <code>isReturn==false</code> since it's no way to know how the method call will end</td>
</tr>
<tr>
<td align="right">isThrow</td>
<td align="left">assistant checking flag: whether the current method invoking ends with exceptions</td>
<td align="left">flag to indicate the method call ends with exception thrown</td>
</tr>
<tr>
<td align="right">isReturn</td>
<td align="left">assistant checking flag: whether the method invoking exits normally without exceptions</td>
<td align="left">flag to indicate the method call ends normally without exception thrown</td>
</tr>
</tbody>
</table><p>F.Y.I</p>
<ol class="simple">
<li>all the <em>fields</em> mentioned in the table above can be used directly in the <code class="docutils literal notranslate"><span class="pre">expressions</span></code>;</li>
<li>if the expressions are <a class="reference external" href="https://en.wikipedia.org/wiki/OGNL">invalid OGNL</a>, the command will be cancelled automatically with hints to correct the expressions;</li>
</table><p>All variables listed above can be used directly in the <a class="reference external" href="https://commons.apache.org/proper/commons-ognl/language-guide.html">OGNL expression</a>. The command will not execute and exit if theres illegal OGNL grammar or unexpected variable in the expression.</p>
<ul class="simple">
<li><a class="reference external" href="https://github.com/alibaba/arthas/issues/71">typical use cases</a>;</li>
<li><a class="reference external" href="https://commons.apache.org/proper/commons-ognl/language-guide.html">OGNL official usage guide</a>.</li>
</ol>
<li><a class="reference external" href="https://commons.apache.org/proper/commons-ognl/language-guide.html">OGNL language guide</a>.</li>
</ul>
</div>

@ -104,9 +104,9 @@
<li class="toctree-l3 current"><a class="current reference internal" href="#">Async support</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#use-to-run-the-command-in-the-background">1. Use &amp; to run the command in the background</a></li>
<li class="toctree-l4"><a class="reference internal" href="#list-background-jobs">2. List background jobs</a></li>
<li class="toctree-l4"><a class="reference internal" href="#suspend-and-cannel-job">3. Suspend and Cannel job</a></li>
<li class="toctree-l4"><a class="reference internal" href="#fg-bg-bring-a-background-job-to-the-foreground-restart-a-stopped-background-job">4. fg/bg, Bring a background job to the foreground/Restart a stopped background job</a></li>
<li class="toctree-l4"><a class="reference internal" href="#redirect-the-job-output">5. Redirect the job output</a></li>
<li class="toctree-l4"><a class="reference internal" href="#suspend-and-cancel-job">3. Suspend and cancel job</a></li>
<li class="toctree-l4"><a class="reference internal" href="#fg-bg-switch-the-job-from-the-foreground-to-the-background-and-vise-verse">4. fg/bg, switch the job from the foreground to the background, and vise verse</a></li>
<li class="toctree-l4"><a class="reference internal" href="#redirect-the-output">5. Redirect the output</a></li>
<li class="toctree-l4"><a class="reference internal" href="#stop-job">6. Stop job</a></li>
<li class="toctree-l4"><a class="reference internal" href="#others">7. Others</a></li>
</ul>
@ -194,13 +194,14 @@
<div class="section" id="arthas-async-jobs">
<span id="arthas-async-jobs"></span><h1>Arthas Async Jobs<a class="headerlink" href="#arthas-async-jobs" title="Permalink to this headline"></a></h1>
<p>Asynchronous jobs in arthas, using commands related to linux jobs.<a class="reference external" href="http://man7.org/linux/man-pages/man1/jobs.1p.html">linux man jobs</a></p>
<p>Asynchronous jobs in arthas. The idea is borrowed from <a class="reference external" href="http://man7.org/linux/man-pages/man1/jobs.1p.html">linux jobs</a>.</p>
<div class="section" id="use-to-run-the-command-in-the-background">
<span id="use-to-run-the-command-in-the-background"></span><h2>1. Use &amp; to run the command in the background<a class="headerlink" href="#use-to-run-the-command-in-the-background" title="Permalink to this headline"></a></h2>
<p>For example, execute the trace command in the background:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>trace Test t <span class="p">&amp;</span>
</pre></div>
</div>
<p>By doing this, the current command is put to the background to run, you can continue to execute other commands in the console.</p>
</div>
<div class="section" id="list-background-jobs">
<span id="list-background-jobs"></span><h2>2. List background jobs<a class="headerlink" href="#list-background-jobs" title="Permalink to this headline"></a></h2>
@ -214,46 +215,45 @@
session : 3648e874-5e69-473f-9eed-7f89660b079b <span class="o">(</span>current<span class="o">)</span>
</pre></div>
</div>
<p>You can see that there is currently a background job executing.</p>
<p>You can see that there is currently a background job executing:</p>
<ul class="simple">
<li>job id is 10, <code class="docutils literal notranslate"><span class="pre">*</span></code> indicates that this job is created by the current session.</li>
<li>status is <code class="docutils literal notranslate"><span class="pre">Stopped</span></code></li>
<li>execution count is the number of executions, which have been executed 19 times since the start.</li>
<li>timeout date: After this time, the job will automatically timeout and exit.</li>
<li>timeout date: timeout timestamp, when the time exceeds this timestamp, the job will be automatically timeout and exit.</li>
</ul>
</div>
<div class="section" id="suspend-and-cannel-job">
<span id="suspend-and-cannel-job"></span><h2>3. Suspend and Cannel job<a class="headerlink" href="#suspend-and-cannel-job" title="Permalink to this headline"></a></h2>
<p>When the job is executing in the foreground, such as directly calling the command <code class="docutils literal notranslate"><span class="pre">trace</span> <span class="pre">Test</span> <span class="pre">t</span></code> or calling the background job command <code class="docutils literal notranslate"><span class="pre">trace</span> <span class="pre">Test</span> <span class="pre">t</span> <span class="pre">&amp;</span></code>, the job is transferred to the foreground through the <code class="docutils literal notranslate"><span class="pre">fg</span></code> command. At this point, the console cannot continue to execute the command, but can receive and process the following keyboard events:</p>
<div class="section" id="suspend-and-cancel-job">
<span id="suspend-and-cancel-job"></span><h2>3. Suspend and cancel job<a class="headerlink" href="#suspend-and-cancel-job" title="Permalink to this headline"></a></h2>
<p>When the job is executing in the foreground, for example, directly executing the command <code class="docutils literal notranslate"><span class="pre">trace</span> <span class="pre">Test</span> <span class="pre">t</span></code>, or executing the background job command <code class="docutils literal notranslate"><span class="pre">trace</span> <span class="pre">Test</span> <span class="pre">t</span> <span class="pre">&amp;</span></code>, then putting the job back to the forground via <code class="docutils literal notranslate"><span class="pre">fg</span></code> command, the console cannot continue to execute other command, but can receive and process the following keyboard events:</p>
<ul class="simple">
<li>ctrl + z: Suspend the job, the job status will change to <code class="docutils literal notranslate"><span class="pre">Stopped</span></code>, and the job can be restarted by <code class="docutils literal notranslate"><span class="pre">bg</span> <span class="pre">&lt;job-id&gt;</span></code> or <code class="docutils literal notranslate"><span class="pre">fg</span> <span class="pre">&lt;job-id&gt;</span></code></li>
<li>ctrl + c: Stop the job</li>
<li>ctrl + d: According to linux semantics should be the exit terminal, currently arthas ignore this input.</li>
<li>ctrl + d: According to linux semantics this should lead to exit the terminal, right now Arthas has not implemented this yet, therefore simply ignore this keystroke.</li>
</ul>
</div>
<div class="section" id="fg-bg-bring-a-background-job-to-the-foreground-restart-a-stopped-background-job">
<span id="fg-bg-bring-a-background-job-to-the-foreground-restart-a-stopped-background-job"></span><h2>4. fg/bg, Bring a background job to the foreground/Restart a stopped background job<a class="headerlink" href="#fg-bg-bring-a-background-job-to-the-foreground-restart-a-stopped-background-job" title="Permalink to this headline"></a></h2>
<div class="section" id="fg-bg-switch-the-job-from-the-foreground-to-the-background-and-vise-verse">
<span id="fg-bg-switch-the-job-from-the-foreground-to-the-background-and-vise-verse"></span><h2>4. fg/bg, switch the job from the foreground to the background, and vise verse<a class="headerlink" href="#fg-bg-switch-the-job-from-the-foreground-to-the-background-and-vise-verse" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>When the job is executed in the background or suspended (<code class="docutils literal notranslate"><span class="pre">ctrl</span> <span class="pre">+</span> <span class="pre">z</span></code> to suspend job), executing <code class="docutils literal notranslate"><span class="pre">fg</span> <span class="pre">&lt;job-id&gt;</span></code> will transfer the corresponding job to the foreground to continue execution.</li>
<li>When the job is suspended (<code class="docutils literal notranslate"><span class="pre">ctrl</span> <span class="pre">+</span> <span class="pre">z</span></code> to suspend job), executing <code class="docutils literal notranslate"><span class="pre">bg</span> <span class="pre">&lt;job-id&gt;</span></code> will continue the corresponding job in the background.</li>
<li>A job created by a non-current session can only be executed by the current session fg to the foreground.</li>
<li>When a job is executed in the background or in suspended status (use <code class="docutils literal notranslate"><span class="pre">ctrl</span> <span class="pre">+</span> <span class="pre">z</span></code> to suspend job), <code class="docutils literal notranslate"><span class="pre">fg</span> <span class="pre">&lt;job-id&gt;</span></code> can transfer the job to the foreground to continue to run.</li>
<li>When a job is in suspended status (use <code class="docutils literal notranslate"><span class="pre">ctrl</span> <span class="pre">+</span> <span class="pre">z</span></code> to suspend job), <code class="docutils literal notranslate"><span class="pre">bg</span> <span class="pre">&lt;job-id&gt;</span></code> can put the job to the background to continue to run.</li>
<li>A job created by other session can only be put to the foreground to run by using <code class="docutils literal notranslate"><span class="pre">fg</span></code> in the current session.</li>
</ul>
</div>
<div class="section" id="redirect-the-job-output">
<span id="redirect-the-job-output"></span><h2>5. Redirect the job output<a class="headerlink" href="#redirect-the-job-output" title="Permalink to this headline"></a></h2>
<p>The job output can be redirect to the specified file by <code class="docutils literal notranslate"><span class="pre">&gt;</span></code> or <code class="docutils literal notranslate"><span class="pre">&gt;&gt;</span></code>, and can be used together with <code class="docutils literal notranslate"><span class="pre">&amp;</span></code> to implement the asynchronous job of the arthas command. such as:</p>
<div class="section" id="redirect-the-output">
<span id="redirect-the-output"></span><h2>5. Redirect the output<a class="headerlink" href="#redirect-the-output" title="Permalink to this headline"></a></h2>
<p>The job output can be redirect to the specified file by <code class="docutils literal notranslate"><span class="pre">&gt;</span></code> or <code class="docutils literal notranslate"><span class="pre">&gt;&gt;</span></code>, and can be used together with <code class="docutils literal notranslate"><span class="pre">&amp;</span></code>. By doing this, you can achieve running commands asynchronously, for example:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ trace Test t &gt;&gt; test.out <span class="p">&amp;</span>
</pre></div>
</div>
<p>The trace command will be executed in the background and the output will be redirect to <code class="docutils literal notranslate"><span class="pre">~/logs/arthas-cache/test.out</span></code>. You can continue to execute other commands in the console.</p>
<p>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:</p>
<p>The trace command will be running in the background and the output will be redirect to <code class="docutils literal notranslate"><span class="pre">~/logs/arthas-cache/test.out</span></code>. You can continue to execute other commands in the console, at the same time, you can also examine the execution result from the output file.</p>
<p>When connect to a remote Arthas server, you may not be able to view the output file on the remote machine. In this case, Arthas also supports automatically redirecting the output to the local cache file. Examples are as follows:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ trace Test t &gt;&gt; <span class="p">&amp;</span>
job id : <span class="m">2</span>
cache location : /Users/gehui/logs/arthas-cache/28198/2
</pre></div>
</div>
<p>You can see that does not specify the redirect file after <code class="docutils literal notranslate"><span class="pre">&gt;&gt;</span></code>, arthas will automatically redirect the job output to the <code class="docutils literal notranslate"><span class="pre">~/logs/arthas-cache</span></code>.</p>
<p>In the above example, pid is <code class="docutils literal notranslate"><span class="pre">28198</span></code> and job id is <code class="docutils literal notranslate"><span class="pre">2</span></code>.</p>
<p>If output path is not given, Arthas will automatically redirect the output to the local cache. Job id and cache location will be shown on the console. Cache location is a directory where the output files are put. For one given job, the path of its output file contains PID and job id in order to avoid potential conflict with other jobs. In the above example, pid is <code class="docutils literal notranslate"><span class="pre">28198</span></code> and job id is <code class="docutils literal notranslate"><span class="pre">2</span></code>.</p>
</div>
<div class="section" id="stop-job">
<span id="stop-job"></span><h2>6. Stop job<a class="headerlink" href="#stop-job" title="Permalink to this headline"></a></h2>
@ -262,8 +262,8 @@ cache location : /Users/gehui/logs/arthas-cache/28198/2
<div class="section" id="others">
<span id="others"></span><h2>7. Others<a class="headerlink" href="#others" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>Support up to 8 commands at the same time redirect the output to the log file.</li>
<li>Do not open too many background asynchronous commands at the same time to avoid affecting the performance of the target JVM.</li>
<li>Support up to 8 commands at the same time to redirect the output to the log files.</li>
<li>Do not open too many background jobs at the same time to avoid negative performance effect to the target JVM.</li>
</ul>
</div>
</div>

@ -166,8 +166,8 @@
<span id="manual-installation"></span><h1>Manual Installation<a class="headerlink" href="#manual-installation" title="Permalink to this headline"></a></h1>
<div class="section" id="download">
<span id="download"></span><h2>Download<a class="headerlink" href="#download" title="Permalink to this headline"></a></h2>
<p>Latest <code class="docutils literal notranslate"><span class="pre">bin.zip</span></code>: <a class="reference external" href="http://search.maven.org/classic/#search%7Cga%7C1%7Cg%3A%22com.taobao.arthas%22%20AND%20a%3A%22arthas-packaging%22"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>If the downloading is rather clumsy, try to download from the <a class="reference external" href="https://maven.aliyun.com/">repository in AliYun</a>; the downloading URL template is (remember to fill up the version <code class="docutils literal notranslate"><span class="pre">3.x.x</span></code> template to your needs)</p>
<p><strong>Latest <code class="docutils literal notranslate"><span class="pre">bin.zip</span></code></strong>: <a class="reference external" href="http://search.maven.org/classic/#search%7Cga%7C1%7Cg%3A%22com.taobao.arthas%22%20AND%20a%3A%22arthas-packaging%22"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>If the download is slow, try to download from the <a class="reference external" href="https://maven.aliyun.com/">repository in AliYun</a>; the downloading URL template is (remember to fill up the version <code class="docutils literal notranslate"><span class="pre">3.x.x</span></code> template to your needs)</p>
<p><code class="docutils literal notranslate"><span class="pre">https://maven.aliyun.com/repository/public/com/taobao/arthas/arthas-packaging/3.x.x/arthas-packaging-3.x.x-bin.zip</span></code></p>
</div>
<div class="section" id="unzip">

Binary file not shown.

@ -266,7 +266,7 @@ $
</div>
<div class="section" id="windows">
<span id="windows"></span><h3>Windows<a class="headerlink" href="#windows" title="Permalink to this headline"></a></h3>
<p>Open the <em>DOS</em> console, under the unzipped arthas folder execture <code class="docutils literal notranslate"><span class="pre">as.bat</span> <span class="pre">&lt;pid&gt;</span></code></p>
<p>Open the <em>DOS</em> console, under the unzipped arthas folder execute <code class="docutils literal notranslate"><span class="pre">as.bat</span> <span class="pre">&lt;pid&gt;</span></code></p>
</div>
</div>
<div class="section" id="check-the-dashboard">

@ -220,7 +220,7 @@
<div class="section" id="v2017-05-11">
<span id="v2017-05-11"></span><h2>v2017-05-11<a class="headerlink" href="#v2017-05-11" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>[improvement] <a class="reference external" href="tt.md"><code class="docutils literal notranslate"><span class="pre">tt</span></code></a> investigating/recording level one to avoid too much performance overhea</li>
<li>[improvement] <a class="reference external" href="tt.md"><code class="docutils literal notranslate"><span class="pre">tt</span></code></a> investigating/recording level one to avoid too much performance overhead</li>
<li>[bug] fix Chinese characters can not be presented issue</li>
</ul>
</div>

File diff suppressed because one or more lines are too long

@ -346,8 +346,7 @@ ID NAME GROUP PRIORITY STA
- java.util.concurrent.ThreadPoolExecutor<span class="nv">$Worker</span>@31a6493e
</pre></div>
</div>
<blockquote>
<div>Attention: only <code class="docutils literal notranslate"><span class="pre">synchronized</span></code> blocked threads can be located for now, <code class="docutils literal notranslate"><span class="pre">JUL</span></code> not supported yet.</div></blockquote>
<p>Attention: only <code class="docutils literal notranslate"><span class="pre">synchronized</span></code> blocked threads can be located for now, while <code class="docutils literal notranslate"><span class="pre">java.util.concurrent.Lock</span></code> not supported yet.</p>
</div>
<div class="section" id="thread-i-specify-the-collecting-interval">
<span id="thread-i-specify-the-collecting-interval"></span><h3>thread -i specify the collecting interval<a class="headerlink" href="#thread-i-specify-the-collecting-interval" title="Permalink to this headline"></a></h3>

@ -32,7 +32,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="stack" href="stack.html" />
<link rel="prev" title="Critical Fields in Expressions" href="advice-class.html" />
<link rel="prev" title="Fundamental Fields in Expressions" href="advice-class.html" />
<script src="_static/center_page.js"></script>
@ -338,7 +338,7 @@ trace com.alibaba.sample.petstore.web.store.module.screen.ItemList execute <span
<a href="stack.html" class="btn btn-neutral float-right" title="stack" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="advice-class.html" class="btn btn-neutral" title="Critical Fields in Expressions" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
<a href="advice-class.html" class="btn btn-neutral" title="Fundamental Fields in Expressions" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>

@ -31,7 +31,7 @@
<link rel="stylesheet" href="_static/overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Critical Fields in Expressions" href="advice-class.html" />
<link rel="next" title="Fundamental Fields in Expressions" href="advice-class.html" />
<link rel="prev" title="monitor" href="monitor.html" />
<script src="_static/center_page.js"></script>
@ -548,7 +548,7 @@ ts=2017-10-31 18:46:17;result=@$Proxy131[
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="advice-class.html" class="btn btn-neutral float-right" title="Critical Fields in Expressions" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="advice-class.html" class="btn btn-neutral float-right" title="Fundamental Fields in Expressions" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="monitor.html" class="btn btn-neutral" title="monitor" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>

Loading…
Cancel
Save