mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-14 06:45:19 +00:00
update as.sh to support --versions
This commit is contained in:
1 parent
6d8ebeea23
commit
280fac704c
2 files changed
+32
-2
No files matched your search
+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`下面的版本。
|
也可以直接 `./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
|
### Debug
|
||||||
|
|
||||||
Arthas启动过程分为两部分:
|
Arthas启动过程分为两部分:
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ Usage:
|
|||||||
[-f] : specify the path to batch script file.
|
[-f] : specify the path to batch script file.
|
||||||
[--attach-only] : only attach the arthas agent to target jvm.
|
[--attach-only] : only attach the arthas agent to target jvm.
|
||||||
[--use-version] : use the specified arthas version to attach.
|
[--use-version] : use the specified arthas version to attach.
|
||||||
|
[--versions] : list all arthas versions.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
./as.sh <PID>
|
./as.sh <PID>
|
||||||
@@ -213,7 +214,8 @@ Example:
|
|||||||
./as.sh -b <PID>
|
./as.sh -b <PID>
|
||||||
./as.sh -b -f /path/to/script
|
./as.sh -b -f /path/to/script
|
||||||
./as.sh --attach-only <PID>
|
./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:
|
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 the argument
|
||||||
parse_arguments()
|
parse_arguments()
|
||||||
{
|
{
|
||||||
@@ -229,6 +238,11 @@ parse_arguments()
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ([ "$1" = "--versions" ]) ; then
|
||||||
|
list_versions
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$1" = "-b" ]; then
|
if [ "$1" = "-b" ]; then
|
||||||
BATCH_MODE=true
|
BATCH_MODE=true
|
||||||
shift
|
shift
|
||||||
|
|||||||
Reference in new issue
Block a user