update watch doc

This commit is contained in:
hengyunabc committed 2018-12-03 23:03:17 +08:00
1 parent e4723bf8bf
commit 9d35b1a436
3 files changed
+10 -3

No files matched your search

@@ -2,6 +2,7 @@ package com.taobao.arthas.core.command;
/** /**
* @author ralf0131 2016-12-14 17:21. * @author ralf0131 2016-12-14 17:21.
* @author hengyunabc 2018-12-03
*/ */
public interface Constants { public interface Constants {
@@ -12,7 +13,8 @@ public interface Constants {
" target : the object\n" + " target : the object\n" +
" clazz : the object's class\n" + " clazz : the object's class\n" +
" method : the constructor or method\n" + " method : the constructor or method\n" +
" params[0..n] : the parameters of method\n" + " params : the parameters array of method\n" +
" params[0..n] : the element of parameters array\n" +
" returnObj : the returned object of method\n" + " returnObj : the returned object of method\n" +
" throwExp : the throw exception of method\n" + " throwExp : the throw exception of method\n" +
" isReturn : the method ended by return\n" + " isReturn : the method ended by return\n" +
@@ -26,6 +28,7 @@ public interface Constants {
String WIKI_HOME = " https://alibaba.github.io/arthas/"; String WIKI_HOME = " https://alibaba.github.io/arthas/";
String EXPRESS_EXAMPLES = "Examples:\n" + String EXPRESS_EXAMPLES = "Examples:\n" +
" params\n" +
" params[0]\n" + " params[0]\n" +
" 'params[0]+params[1]'\n" + " 'params[0]+params[1]'\n" +
" returnObj\n" + " returnObj\n" +
+3 -1
View File
@@ -37,6 +37,8 @@ Advanced:
### Usage ### Usage
#### Start Demo
Start `arthas-demo` in [Quick Start](quick-start.md). Start `arthas-demo` in [Quick Start](quick-start.md).
#### Check the `out parameters` and `return value` #### Check the `out parameters` and `return value`
@@ -223,7 +225,7 @@ ts=2018-12-03 19:41:52; [cost=0.477882ms] result=@MathGame[
* `target.field_name`: the field of the current object. * `target.field_name`: the field of the current object.
``` ```bash
$ watch demo.MathGame primeFactors 'target.illegalArgumentCount' $ watch demo.MathGame primeFactors 'target.illegalArgumentCount'
Press Ctrl+C to abort. Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 67 ms. Affect(class-cnt:1 , method-cnt:1) cost in 67 ms.
+3 -1
View File
@@ -38,6 +38,8 @@ watch 的参数比较多,主要是因为它能在 4 个不同的场景观察
### 使用参考 ### 使用参考
#### 启动 Demo
启动[快速入门](quick-start.md)里的`arthas-demo`。 启动[快速入门](quick-start.md)里的`arthas-demo`。
#### 观察方法出参和返回值 #### 观察方法出参和返回值
@@ -223,7 +225,7 @@ ts=2018-12-03 19:41:52; [cost=0.477882ms] result=@MathGame[
然后使用`target.field_name`访问当前对象的某个属性 然后使用`target.field_name`访问当前对象的某个属性
``` ```bash
$ watch demo.MathGame primeFactors 'target.illegalArgumentCount' $ watch demo.MathGame primeFactors 'target.illegalArgumentCount'
Press Ctrl+C to abort. Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 67 ms. Affect(class-cnt:1 , method-cnt:1) cost in 67 ms.