update doc

This commit is contained in:
hengyunabc committed 2020-09-03 14:38:44 +08:00
1 parent 26b92f34e7
commit 3b0eb23ed0
125 files changed
+486 -243

No files matched your search

+58 -1
View File
@@ -5,7 +5,7 @@ monitor
> Monitor method invocation.
Monitor invocation for the method matched with `class-pattern` and `method-pattern`.
Monitor invocation for the method matched with `class-pattern` and `method-pattern` and filter by `condition-expression`.
`monitor` is not a command returning immediately.
@@ -34,8 +34,10 @@ Parameter `[c:]` stands for cycles of statistics. Its value is an integer value
|---:|:---|
|*class-pattern*|pattern for the class name|
|*method-pattern*|pattern for the method name|
|*condition-expression*|condition expression for filtering method calls|
|`[E]`|turn on regex matching while the default is wildcard matching|
|`[c:]`|cycle of statistics, the default value: `120`s|
|`[b]`|evaluate the condition-expression before method invoke|
### Usage
@@ -67,3 +69,58 @@ Affect(class-cnt:1 , method-cnt:1) cost in 94 ms.
-----------------------------------------------------------------------------------------------
2018-12-03 19:07:03 demo.MathGame primeFactors 2 2 0 3182.72 0.00%
```
#### Evaluate condition-express to filter method (after method call)
```bash
monitor -c 5 demo.MathGame primeFactors "params[0] <= 2"
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 19 ms, listenerId: 5
timestamp class method total success fail avg-rt(ms) fail-rate
-----------------------------------------------------------------------------------------------
2020-09-02 09:42:36 demo.MathGame primeFactors 5 3 2 0.09 40.00%
timestamp class method total success fail avg-rt(ms) fail-rate
----------------------------------------------------------------------------------------------
2020-09-02 09:42:41 demo.MathGame primeFactors 5 2 3 0.11 60.00%
timestamp class method total success fail avg-rt(ms) fail-rate
----------------------------------------------------------------------------------------------
2020-09-02 09:42:46 demo.MathGame primeFactors 5 1 4 0.06 80.00%
timestamp class method total success fail avg-rt(ms) fail-rate
----------------------------------------------------------------------------------------------
2020-09-02 09:42:51 demo.MathGame primeFactors 5 1 4 0.12 80.00%
timestamp class method total success fail avg-rt(ms) fail-rate
----------------------------------------------------------------------------------------------
2020-09-02 09:42:56 demo.MathGame primeFactors 5 3 2 0.15 40.00%
```
#### Evaluate condition-express to filter method (before method call)
```bash
monitor -b -c 5 com.test.testes.MathGame primeFactors "params[0] <= 2"
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 21 ms, listenerId: 4
timestamp class method total success fail avg-rt(ms) fail-rate
----------------------------------------------------------------------------------------------
2020-09-02 09:41:57 demo.MathGame primeFactors 1 0 1 0.10 100.00%
timestamp class method total success fail avg-rt(ms) fail-rate
----------------------------------------------------------------------------------------------
2020-09-02 09:42:02 demo.MathGame primeFactors 3 0 3 0.06 100.00%
timestamp class method total success fail avg-rt(ms) fail-rate
----------------------------------------------------------------------------------------------
2020-09-02 09:42:07 demo.MathGame primeFactors 2 0 2 0.06 100.00%
timestamp class method total success fail avg-rt(ms) fail-rate
----------------------------------------------------------------------------------------------
2020-09-02 09:42:12 demo.MathGame primeFactors 1 0 1 0.05 100.00%
timestamp class method total success fail avg-rt(ms) fail-rate
----------------------------------------------------------------------------------------------
2020-09-02 09:42:17 demo.MathGame primeFactors 2 0 2 0.10 100.00%
```