update doc

pull/483/head
hengyunabc
parent 243caec76f
commit 938adbb661

@ -86,4 +86,14 @@ Affect(class-cnt:1 , method-cnt:1) cost in 41 ms.
- 是不是很眼熟,没错,在 JProfiler 等收费软件中你曾经见识类似的功能,这里你将可以通过命令就能打印出指定调用路径。 友情提醒下,`trace` 在执行的过程中本身是会有一定的性能开销,在统计的报告中并未像 JProfiler 一样预先减去其自身的统计开销。所以这统计出来有些许的不准,渲染路径上调用的类、方法越多,性能偏差越大。但还是能让你看清一些事情的。
- [12.033735ms] 的含义,`12.033735` 的含义是:当前节点在当前步骤的耗时,单位为毫秒
- [0,0,0ms,11]xxx:yyy() [throws Exception],对该方法中相同的方法调用进行了合并,`0,0,0ms,11` 表示方法调用耗时,`min,max,total,count``throws Exception` 表明该方法调用中存在异常返回
- 这里存在一个统计不准确的问题,就是所有方法耗时加起来可能会小于该监测方法的总耗时,这个是由于 Arthas 本身的逻辑会有一定的耗时
- 这里存在一个统计不准确的问题,就是所有方法耗时加起来可能会小于该监测方法的总耗时,这个是由于 Arthas 本身的逻辑会有一定的耗时
#### trace多个类或者多个函数
trace命令只会trace匹配到的函数里的子调用并不会向下trace多层。因为trace是代价比较贵的多层trace可能会导致最终要trace的类和函数非常多。
可以用正则表匹配路径上的多个类和函数一定程度上达到多层trace的效果。
```bash
trace -E com.test.ClassA|org.test.ClassB method1|method2|method3
```

@ -119,7 +119,7 @@ ts=2018-12-03 19:29:54; [cost=4.277392ms] result=@ArrayList[
* 这里输出结果中,第一次输出的是方法调用前的观察表达式的结果,第二次输出的是方法返回后的表达式的结果
* 结果的顺序和命令中 `-s -b` 的顺序没有关系,只与事件本身的先后顺序有关
* 结果的输出顺序和事件发生的先后顺序一致,和命令中 `-s -b` 的顺序无关
#### 调整`-x`的值,观察具体的方法参数值
@ -231,4 +231,4 @@ Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 67 ms.
ts=2018-12-03 20:04:34; [cost=131.303498ms] result=@Integer[8]
ts=2018-12-03 20:04:35; [cost=0.961441ms] result=@Integer[8]
```
```

@ -86,3 +86,13 @@ Affect(class-cnt:1 , method-cnt:1) cost in 41 ms.
* "[min=0.005428ms,max=0.094064ms,total=0.105228ms,count=3] demo:call()" means aggregating all same method calls into one single line. The minimum time cost is `0.005428` ms, the maximum time cost is `0.094064` ms, and the total time cost for all method calls (`3` times in total) to "demo:call()" is `0.105228ms`. If "throws Exception" appears in this line, it means some exceptions have been thrown from this method calls.
* The total time cost may not equal to the sum of the time costs each sub method call takes, this is because Arthas instrumented code takes time too.
#### trace multiple classes or multiple methods
The trace command will only trace the subcalls in the method to the trace, and will not trace down multiple layers. Because traces are expensive, multi-layer traces can lead to a lot of classes and methods that ultimately have to be traced.
You can use the regular expression to match multiple classes and methods on the path to achieve a multi-layer trace effect to some extent.
```bash
Trace -E com.test.ClassA|org.test.ClassB method1|method2|method3
```

File diff suppressed because one or more lines are too long

@ -117,6 +117,7 @@
<li class="toctree-l4"><a class="reference internal" href="#trace-method">trace method</a></li>
<li class="toctree-l4"><a class="reference internal" href="#ignore-jdk-method">Ignore jdk method</a></li>
<li class="toctree-l4"><a class="reference internal" href="#filtering-by-cost">Filtering by cost</a></li>
<li class="toctree-l4"><a class="reference internal" href="#trace-multiple-classes-or-multiple-methods">trace multiple classes or multiple methods</a></li>
</ul>
</li>
</ul>
@ -311,6 +312,14 @@ Affect(class-cnt:1 , method-cnt:1) cost in 41 ms.
<li>The total time cost may not equal to the sum of the time costs each sub method call takes, this is because Arthas instrumented code takes time too.</li>
</ul>
</div>
<div class="section" id="trace-multiple-classes-or-multiple-methods">
<span id="trace-multiple-classes-or-multiple-methods"></span><h3>trace multiple classes or multiple methods<a class="headerlink" href="#trace-multiple-classes-or-multiple-methods" title="Permalink to this headline"></a></h3>
<p>The trace command will only trace the subcalls in the method to the trace, and will not trace down multiple layers. Because traces are expensive, multi-layer traces can lead to a lot of classes and methods that ultimately have to be traced.</p>
<p>You can use the regular expression to match multiple classes and methods on the path to achieve a multi-layer trace effect to some extent.</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">Trace -E com.test.ClassA|org.test.ClassB method1|method2|method3
</pre></div>
</div>
</div>
</div>
</div>

File diff suppressed because one or more lines are too long

@ -118,6 +118,7 @@
<li class="toctree-l4"><a class="reference internal" href="#trace">trace函数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#jdk">过滤掉jdk的函数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#">据调用耗时过滤</a></li>
<li class="toctree-l4"><a class="reference internal" href="#trace">trace多个类或者多个函数</a></li>
</ul>
</li>
</ul>
@ -313,6 +314,14 @@ Affect(class-cnt:1 , method-cnt:1) cost in 41 ms.
<li>这里存在一个统计不准确的问题,就是所有方法耗时加起来可能会小于该监测方法的总耗时,这个是由于 Arthas 本身的逻辑会有一定的耗时</li>
</ul>
</div>
<div class="section" id="trace">
<span id="id6"></span><h3>trace多个类或者多个函数<a class="headerlink" href="#trace" title="永久链接至标题"></a></h3>
<p>trace命令只会trace匹配到的函数里的子调用并不会向下trace多层。因为trace是代价比较贵的多层trace可能会导致最终要trace的类和函数非常多。</p>
<p>可以用正则表匹配路径上的多个类和函数一定程度上达到多层trace的效果。</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">trace -E com.test.ClassA|org.test.ClassB method1|method2|method3
</pre></div>
</div>
</div>
</div>
</div>

@ -359,7 +359,7 @@ ts=2018-12-03 19:29:54; [cost=4.277392ms] result=@ArrayList[
<ul class="simple">
<li>参数里<tt class="docutils literal">-n 2</tt>,表示只执行两次</li>
<li>这里输出结果中,第一次输出的是方法调用前的观察表达式的结果,第二次输出的是方法返回后的表达式的结果</li>
<li>结果的顺序和命令中 <tt class="docutils literal">-s -b</tt> 的顺序没有关系,只与事件本身的先后顺序有</li>
<li>结果的输出顺序和事件发生的先后顺序一致,和命令中 <tt class="docutils literal">-s -b</tt> 的顺序</li>
</ul>
</div>
<div class="section" id="x">

Loading…
Cancel
Save