mirror of https://github.com/alibaba/arthas.git
parent
4d918392e7
commit
c4c782e7e8
@ -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 getstatic命令",
|
||||||
|
"description": "Arthas getstatic命令",
|
||||||
|
"difficulty": "精通者",
|
||||||
|
"time": "10-20 分钟",
|
||||||
|
"details": {
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"title": "启动arthas demo",
|
||||||
|
"text": "arthas-demo.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "启动arthas-boot",
|
||||||
|
"text": "arthas-boot.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "getstatic命令",
|
||||||
|
"text": "getstatic.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 `getstatic Tutorial` demonstrates the usage of getstatic. 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,34 @@
|
|||||||
|
|
||||||
|
* It is recommended to use the [OGNL] (https://alibaba.github.io/arthas/arthas-tutorials?language=en&id=command-ognl) command, which will be more flexible.
|
||||||
|
|
||||||
|
Check the static fields of classes conveniently, the usage is `getstatic class_name field_name`.
|
||||||
|
|
||||||
|
`getstatic demo.MathGame random`{{execute T2}}
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ getstatic demo.MathGame random
|
||||||
|
field: random
|
||||||
|
@Random[
|
||||||
|
serialVersionUID=@Long[3905348978240129619],
|
||||||
|
seed=@AtomicLong[120955813885284],
|
||||||
|
multiplier=@Long[25214903917],
|
||||||
|
addend=@Long[11],
|
||||||
|
mask=@Long[281474976710655],
|
||||||
|
DOUBLE_UNIT=@Double[1.1102230246251565E-16],
|
||||||
|
BadBound=@String[bound must be positive],
|
||||||
|
BadRange=@String[bound must be greater than origin],
|
||||||
|
BadSize=@String[size must be non-negative],
|
||||||
|
seedUniquifier=@AtomicLong[-3282039941672302964],
|
||||||
|
nextNextGaussian=@Double[0.0],
|
||||||
|
haveNextNextGaussian=@Boolean[false],
|
||||||
|
serialPersistentFields=@ObjectStreamField[][isEmpty=false;size=3],
|
||||||
|
unsafe=@Unsafe[sun.misc.Unsafe@2eaa1027],
|
||||||
|
seedOffset=@Long[24],
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Tip: if the static field is a complex class, you can even use [`OGNL`](https://commons.apache.org/proper/commons-ognl/language-guide.html) to traverse, filter and access the inner properties of this class.
|
||||||
|
|
||||||
|
* [OGNL official guide](https://commons.apache.org/proper/commons-ognl/language-guide.html)
|
||||||
|
* [Special usages](https://github.com/alibaba/arthas/issues/71)
|
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"title": "Arthas getstatic Command",
|
||||||
|
"description": "Arthas getstatic 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": "getstatic Command",
|
||||||
|
"text": "getstatic.md"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"intro": {
|
||||||
|
"text": "intro.md"
|
||||||
|
},
|
||||||
|
"finish": {
|
||||||
|
"text": "finish.md"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"uilayout": "terminal"
|
||||||
|
},
|
||||||
|
"backend": {
|
||||||
|
"imageid": "java",
|
||||||
|
"environmentsprotocol": "http"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue