mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
update as.sh to support --versions
This commit is contained in:
+17
-1
@@ -9,7 +9,9 @@
|
||||
|
||||
## 改进用户文档
|
||||
|
||||
用户文档在`site/src/site/sphinx`目录下,如果希望改进arthas用户文档,可以提交PR。
|
||||
用户文档在`site/src/site/sphinx`目录下,如果希望改进arthas用户文档,欢迎提交PR。
|
||||
|
||||
英文文档在`site/src/site/sphinx/en`目录下,欢迎提交翻译PR。
|
||||
|
||||
## 开发者相关
|
||||
|
||||
@@ -23,6 +25,20 @@
|
||||
|
||||
也可以直接 `./mvnw clean package -DskipTests`打包,生成的zip在 `packaging/target/` 下面。但是注意`as.sh`启动加载的是`~/.arthas/lib`下面的版本。
|
||||
|
||||
### 启动指定版本的arthas
|
||||
|
||||
本地开发时,可能会产生多个版本,可以用 `--use-version` 参数来指定版本,比如
|
||||
|
||||
```bash
|
||||
./as.sh --use-version 3.0.5.20180919185025
|
||||
```
|
||||
|
||||
可以用`--versions`参数来列出所有版本:
|
||||
|
||||
```bash
|
||||
./as.sh --versions
|
||||
```
|
||||
|
||||
### Debug
|
||||
|
||||
Arthas启动过程分为两部分:
|
||||
|
||||
@@ -204,6 +204,7 @@ Usage:
|
||||
[-f] : specify the path to batch script file.
|
||||
[--attach-only] : only attach the arthas agent to target jvm.
|
||||
[--use-version] : use the specified arthas version to attach.
|
||||
[--versions] : list all arthas versions.
|
||||
|
||||
Example:
|
||||
./as.sh <PID>
|
||||
@@ -213,7 +214,8 @@ Example:
|
||||
./as.sh -b <PID>
|
||||
./as.sh -b -f /path/to/script
|
||||
./as.sh --attach-only <PID>
|
||||
./as.sh --use-version 2.0.20161221142407 <PID>
|
||||
./as.sh --use-version 3.0.5.20180919185025 <PID>
|
||||
./as.sh --versions
|
||||
|
||||
Here is the list of possible java process(es) to attatch:
|
||||
|
||||
@@ -221,6 +223,13 @@ $(${JAVA_HOME}/bin/jps -l | grep -v sun.tools.jps.Jps)
|
||||
"
|
||||
}
|
||||
|
||||
# list arthas versions
|
||||
list_versions()
|
||||
{
|
||||
echo "Arthas versions under ${ARTHAS_LIB_DIR}:"
|
||||
ls -1 ${ARTHAS_LIB_DIR}
|
||||
}
|
||||
|
||||
# parse the argument
|
||||
parse_arguments()
|
||||
{
|
||||
@@ -229,6 +238,11 @@ parse_arguments()
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ([ "$1" = "--versions" ]) ; then
|
||||
list_versions
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "-b" ]; then
|
||||
BATCH_MODE=true
|
||||
shift
|
||||
|
||||
Reference in New Issue
Block a user