mirror of https://github.com/alibaba/arthas.git
parent
c4c782e7e8
commit
6b5a8f0ec9
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
|
||||
|
||||
下载`arthas-demo.jar`,再用`java -jar`命令启动:
|
||||
|
||||
`wget https://alibaba.github.io/arthas/arthas-demo.jar
|
||||
java -jar arthas-demo.jar`{{execute T1}}
|
||||
|
||||
`arthas-demo`是一个很简单的程序,它随机生成整数,再执行因式分解,把结果打印出来。如果生成的随机数是负数,则会打印提示信息。
|
@ -0,0 +1,35 @@
|
||||
{
|
||||
"title": "Arthas monitor命令",
|
||||
"description": "Arthas monitor命令",
|
||||
"difficulty": "精通者",
|
||||
"time": "10-20 分钟",
|
||||
"details": {
|
||||
"steps": [
|
||||
{
|
||||
"title": "启动arthas demo",
|
||||
"text": "arthas-demo.md"
|
||||
},
|
||||
{
|
||||
"title": "启动arthas-boot",
|
||||
"text": "arthas-boot.md"
|
||||
},
|
||||
{
|
||||
"title": "monitor命令",
|
||||
"text": "monitor.md"
|
||||
}
|
||||
],
|
||||
"intro": {
|
||||
"text": "intro.md"
|
||||
},
|
||||
"finish": {
|
||||
"text": "finish.md"
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
"uilayout": "terminal"
|
||||
},
|
||||
"backend": {
|
||||
"imageid": "java",
|
||||
"environmentsprotocol": "http"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
|
||||
|
||||
Download `arthas-demo.jar` and start with the `java -jar` command:
|
||||
|
||||
`wget https://alibaba.github.io/arthas/arthas-demo.jar
|
||||
java -jar arthas-demo.jar`{{execute T1}}
|
||||
|
||||
`arthas-demo` is a very simple program that randomly generates integers, performs factorization, and prints the results.
|
||||
If the generated random number is negative, a error message will be printed.
|
@ -0,0 +1,8 @@
|
||||
|
||||
The `monitor Tutorial` demonstrates the usage of monitor. If you have more tips or questions, please feel free to ask in Issue.
|
||||
|
||||
* Issues: https://github.com/alibaba/arthas/issues
|
||||
* Documentation: https://alibaba.github.io/arthas
|
||||
|
||||
|
||||
If you are using Arthas, please let us know. Your use is very important to us: [View](https://github.com/alibaba/arthas/issues/111)
|
@ -0,0 +1,35 @@
|
||||
{
|
||||
"title": "Arthas monitor Command",
|
||||
"description": "Arthas monitor Command",
|
||||
"difficulty": "master",
|
||||
"time": "10-20 minutes",
|
||||
"details": {
|
||||
"steps": [
|
||||
{
|
||||
"title": "Arthas demo",
|
||||
"text": "arthas-demo.md"
|
||||
},
|
||||
{
|
||||
"title": "Start arthas-boot",
|
||||
"text": "arthas-boot.md"
|
||||
},
|
||||
{
|
||||
"title": "monitor Command",
|
||||
"text": "monitor.md"
|
||||
}
|
||||
],
|
||||
"intro": {
|
||||
"text": "intro.md"
|
||||
},
|
||||
"finish": {
|
||||
"text": "finish.md"
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
"uilayout": "terminal"
|
||||
},
|
||||
"backend": {
|
||||
"imageid": "java",
|
||||
"environmentsprotocol": "http"
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
monitor
|
||||
=======
|
||||
|
||||
> Monitor method invocation.
|
||||
|
||||
Monitor invocation for the method matched with `class-pattern` and `method-pattern`.
|
||||
|
||||
`monitor` is not a command returning immediately.
|
||||
|
||||
A command returning immediately is a command immediately returns with the result after the command is input, while a non-immediate returning command will keep outputting the information from the target JVM process until user presses `Ctrl+C`.
|
||||
|
||||
On Arthas's server side, the command is running as a background job, but the weaved code will not take further effect once the job is terminated, therefore, it will not impact the performance after the job quits. Furthermore, Arthas is designed to have no side effect to the business logic.
|
||||
|
||||
### Items to monitor
|
||||
|
||||
|Item|Specification|
|
||||
|---:|:---|
|
||||
|timestamp|timestamp|
|
||||
|class|Java class|
|
||||
|method|method (constructor and regular methods)|
|
||||
|total|calling times|
|
||||
|success|success count|
|
||||
|fail|failure count|
|
||||
|rt|average RT|
|
||||
|fail-rate|failure ratio|
|
||||
|
||||
### Parameters
|
||||
|
||||
Parameter `[c:]` stands for cycles of statistics. Its value is an integer value in seconds.
|
||||
|
||||
|Name|Specification|
|
||||
|---:|:---|
|
||||
|*class-pattern*|pattern for the class name|
|
||||
|*method-pattern*|pattern for the method name|
|
||||
|`[E]`|turn on regex matching while the default is wildcard matching|
|
||||
|`[c:]`|cycle of statistics, the default value: `120`s|
|
||||
|
||||
### Usage
|
||||
|
||||
`monitor -c 5 demo.MathGame primeFactors`{{execute T2}}
|
||||
|
||||
```bash
|
||||
$ monitor -c 5 demo.MathGame primeFactors
|
||||
Press Ctrl+C to abort.
|
||||
Affect(class-cnt:1 , method-cnt:1) cost in 94 ms.
|
||||
timestamp class method total success fail avg-rt(ms) fail-rate
|
||||
-----------------------------------------------------------------------------------------------
|
||||
2018-12-03 19:06:38 demo.MathGame primeFactors 5 1 4 1.15 80.00%
|
||||
|
||||
timestamp class method total success fail avg-rt(ms) fail-rate
|
||||
-----------------------------------------------------------------------------------------------
|
||||
2018-12-03 19:06:43 demo.MathGame primeFactors 5 3 2 42.29 40.00%
|
||||
|
||||
timestamp class method total success fail avg-rt(ms) fail-rate
|
||||
-----------------------------------------------------------------------------------------------
|
||||
2018-12-03 19:06:48 demo.MathGame primeFactors 5 3 2 67.92 40.00%
|
||||
|
||||
timestamp class method total success fail avg-rt(ms) fail-rate
|
||||
-----------------------------------------------------------------------------------------------
|
||||
2018-12-03 19:06:53 demo.MathGame primeFactors 5 2 3 0.25 60.00%
|
||||
|
||||
timestamp class method total success fail avg-rt(ms) fail-rate
|
||||
-----------------------------------------------------------------------------------------------
|
||||
2018-12-03 19:06:58 demo.MathGame primeFactors 1 1 0 0.45 0.00%
|
||||
|
||||
timestamp class method total success fail avg-rt(ms) fail-rate
|
||||
-----------------------------------------------------------------------------------------------
|
||||
2018-12-03 19:07:03 demo.MathGame primeFactors 2 2 0 3182.72 0.00%
|
||||
```
|
Loading…
Reference in New Issue