From 9d35b1a43670f1c6ce1d06d602e6116e1ffd8673 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Mon, 3 Dec 2018 23:03:17 +0800 Subject: [PATCH] update watch doc --- .../main/java/com/taobao/arthas/core/command/Constants.java | 5 ++++- site/src/site/sphinx/en/watch.md | 4 +++- site/src/site/sphinx/watch.md | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/taobao/arthas/core/command/Constants.java b/core/src/main/java/com/taobao/arthas/core/command/Constants.java index f52bffcd7..0c6c3deef 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/Constants.java +++ b/core/src/main/java/com/taobao/arthas/core/command/Constants.java @@ -2,6 +2,7 @@ package com.taobao.arthas.core.command; /** * @author ralf0131 2016-12-14 17:21. + * @author hengyunabc 2018-12-03 */ public interface Constants { @@ -12,7 +13,8 @@ public interface Constants { " target : the object\n" + " clazz : the object's class\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" + " throwExp : the throw exception of method\n" + " isReturn : the method ended by return\n" + @@ -26,6 +28,7 @@ public interface Constants { String WIKI_HOME = " https://alibaba.github.io/arthas/"; String EXPRESS_EXAMPLES = "Examples:\n" + + " params\n" + " params[0]\n" + " 'params[0]+params[1]'\n" + " returnObj\n" + diff --git a/site/src/site/sphinx/en/watch.md b/site/src/site/sphinx/en/watch.md index 47afc7420..0701165e0 100644 --- a/site/src/site/sphinx/en/watch.md +++ b/site/src/site/sphinx/en/watch.md @@ -37,6 +37,8 @@ Advanced: ### Usage +#### Start Demo + Start `arthas-demo` in [Quick Start](quick-start.md). #### 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. -``` +```bash $ watch demo.MathGame primeFactors 'target.illegalArgumentCount' Press Ctrl+C to abort. Affect(class-cnt:1 , method-cnt:1) cost in 67 ms. diff --git a/site/src/site/sphinx/watch.md b/site/src/site/sphinx/watch.md index 7682b7dfb..e52d1a444 100644 --- a/site/src/site/sphinx/watch.md +++ b/site/src/site/sphinx/watch.md @@ -38,6 +38,8 @@ watch 的参数比较多,主要是因为它能在 4 个不同的场景观察 ### 使用参考 +#### 启动 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`访问当前对象的某个属性 -``` +```bash $ watch demo.MathGame primeFactors 'target.illegalArgumentCount' Press Ctrl+C to abort. Affect(class-cnt:1 , method-cnt:1) cost in 67 ms.