Skip to content

Commit cb5d59f

Browse files
committed
update tt docs. alibaba#2771
1 parent 07414df commit cb5d59f

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void setRegEx(boolean regEx) {
168168
}
169169

170170
@Option(shortName = "n", longName = "limits")
171-
@Description("Threshold of execution times")
171+
@Description("Threshold of execution times, default value 100")
172172
public void setNumberOfLimit(int numberOfLimit) {
173173
this.numberOfLimit = numberOfLimit;
174174
}

site/docs/doc/tt.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313
于是乎,TimeTunnel 命令就诞生了。
1414

15+
## 注意事项
16+
17+
* tt 命令的实现是:把函数的入参/返回值等,保存到一个`Map<Integer, TimeFragment>`里,默认的大小是 100。
18+
* tt 相关功能在使用完之后,需要手动释放内存,否则长时间可能导致OOM。退出 arthas 不会自动清除 tt 的缓存 map。
19+
1520
## 使用参考
1621

1722
### 启动 Demo
@@ -238,3 +243,16 @@ Affect(class count: 1 , method count: 1) cost in 56 ms, listenerId: 1
238243
2. **引用的对象**
239244

240245
需要强调的是,`tt` 命令是将当前环境的对象引用保存起来,但仅仅也只能保存一个引用而已。如果方法内部对入参进行了变更,或者返回的对象经过了后续的处理,那么在 `tt` 查看的时候将无法看到当时最准确的值。这也是为什么 `watch` 命令存在的意义。
246+
247+
248+
### 通过索引删除指定的 tt 记录
249+
250+
```
251+
tt -d 1001
252+
```
253+
254+
### 清除所有的 tt 记录
255+
256+
```
257+
tt --delete-all
258+
```

site/docs/en/doc/tt.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ In such difficulties, `tt` comes into play.
1010

1111
With the help of `tt` (_TimeTunnel_), you can check the contexts of the methods at different times in execution history.
1212

13+
## Precautions
14+
15+
* The implementation of the tt command is to save the input parameters/return values of the function into a `Map<Integer, TimeFragment>`. The default size is 100.
16+
* After using tt related functions, you need to manually release the memory, otherwise OOM may occur for a long time. Exiting arthas will not automatically clear tt's cache map.
17+
1318
## Usage
1419

1520
### Start Demo
@@ -210,3 +215,15 @@ F.Y.I
210215
2. params may be modified
211216

212217
Arthas save params into an array, they are object references. The Objects may be modified by other code.
218+
219+
### Delete the specified tt record by index
220+
221+
```
222+
tt -d 1001
223+
```
224+
225+
### Clear all tt records
226+
227+
```
228+
tt --delete-all
229+
```

0 commit comments

Comments
 (0)