mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
update tt docs. #2771
This commit is contained in:
@@ -168,7 +168,7 @@ public class TimeTunnelCommand extends EnhancerCommand {
|
||||
}
|
||||
|
||||
@Option(shortName = "n", longName = "limits")
|
||||
@Description("Threshold of execution times")
|
||||
@Description("Threshold of execution times, default value 100")
|
||||
public void setNumberOfLimit(int numberOfLimit) {
|
||||
this.numberOfLimit = numberOfLimit;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
|
||||
于是乎,TimeTunnel 命令就诞生了。
|
||||
|
||||
## 注意事项
|
||||
|
||||
* tt 命令的实现是:把函数的入参/返回值等,保存到一个`Map<Integer, TimeFragment>`里,默认的大小是 100。
|
||||
* tt 相关功能在使用完之后,需要手动释放内存,否则长时间可能导致OOM。退出 arthas 不会自动清除 tt 的缓存 map。
|
||||
|
||||
## 使用参考
|
||||
|
||||
### 启动 Demo
|
||||
@@ -238,3 +243,16 @@ Affect(class count: 1 , method count: 1) cost in 56 ms, listenerId: 1
|
||||
2. **引用的对象**
|
||||
|
||||
需要强调的是,`tt` 命令是将当前环境的对象引用保存起来,但仅仅也只能保存一个引用而已。如果方法内部对入参进行了变更,或者返回的对象经过了后续的处理,那么在 `tt` 查看的时候将无法看到当时最准确的值。这也是为什么 `watch` 命令存在的意义。
|
||||
|
||||
|
||||
### 通过索引删除指定的 tt 记录
|
||||
|
||||
```
|
||||
tt -d 1001
|
||||
```
|
||||
|
||||
### 清除所有的 tt 记录
|
||||
|
||||
```
|
||||
tt --delete-all
|
||||
```
|
||||
@@ -10,6 +10,11 @@ In such difficulties, `tt` comes into play.
|
||||
|
||||
With the help of `tt` (_TimeTunnel_), you can check the contexts of the methods at different times in execution history.
|
||||
|
||||
## Precautions
|
||||
|
||||
* 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.
|
||||
* 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.
|
||||
|
||||
## Usage
|
||||
|
||||
### Start Demo
|
||||
@@ -210,3 +215,15 @@ F.Y.I
|
||||
2. params may be modified
|
||||
|
||||
Arthas save params into an array, they are object references. The Objects may be modified by other code.
|
||||
|
||||
### Delete the specified tt record by index
|
||||
|
||||
```
|
||||
tt -d 1001
|
||||
```
|
||||
|
||||
### Clear all tt records
|
||||
|
||||
```
|
||||
tt --delete-all
|
||||
```
|
||||
Reference in New Issue
Block a user