Skip to content

Commit

Permalink
fix: update tutorials link
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatpandac committed Aug 10, 2023
1 parent 0ab0595 commit f352564
Show file tree
Hide file tree
Showing 80 changed files with 143 additions and 143 deletions.
2 changes: 1 addition & 1 deletion site/docs/doc/async.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Arthas 后台异步任务

[`后台异步任务`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=case-async-jobs)
[`后台异步任务`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=async-jobs)

arthas 中的后台异步任务,使用了仿 linux 系统任务相关的命令。[linux 任务相关介绍](https://ehlxr.me/2017/01/18/Linux-%E4%B8%AD-fg%E3%80%81bg%E3%80%81jobs%E3%80%81-%E6%8C%87%E4%BB%A4/)

Expand Down
2 changes: 1 addition & 1 deletion site/docs/doc/cat.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cat

[`cat`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-cat)
[`cat`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=cat)

::: tip
打印文件内容,和 linux 里的 cat 命令类似。
Expand Down
2 changes: 1 addition & 1 deletion site/docs/doc/classloader.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# classloader

[`classloader`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-classloader)
[`classloader`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=classloader)

::: tip
查看 classloader 的继承树,urls,类加载信息
Expand Down
16 changes: 8 additions & 8 deletions site/docs/doc/dashboard.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# dashboard

[`dashboard`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-dashboard)
[`dashboard`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=dashboard)

::: tip
当前系统的实时数据面板,按 ctrl+c 退出。
:::

当运行在 Ali-tomcat 时,会显示当前 tomcat 的实时信息,如 HTTP 请求的 qps, rt, 错误数, 线程池信息等等。
当运行在 Ali-tomcat 时,会显示当前 tomcat 的实时信息,如 HTTP 请求的 qps, rt, 错误数线程池信息等等。

## 参数说明

Expand Down Expand Up @@ -57,7 +57,7 @@ uptime 272s
- ID: Java 级别的线程 ID,注意这个 ID 不能跟 jstack 中的 nativeID 一一对应。
- NAME: 线程名
- GROUP: 线程组名
- PRIORITY: 线程优先级, 1~10 之间的数字,越大表示优先级越高
- PRIORITY: 线程优先级1~10 之间的数字,越大表示优先级越高
- STATE: 线程的状态
- CPU%: 线程的 cpu 使用率。比如采样间隔 1000ms,某个线程的增量 cpu 时间为 100ms,则 cpu 使用率=100/1000=10%
- DELTA_TIME: 上次采样之后线程运行增量 CPU 时间,数据格式为``
Expand All @@ -67,17 +67,17 @@ uptime 272s

### JVM 内部线程

Java 8 之后支持获取 JVM 内部线程 CPU 时间,这些线程只有名称和 CPU 时间,没有 ID 及状态等信息(显示 ID 为-1)。
Java 8 之后支持获取 JVM 内部线程 CPU 时间,这些线程只有名称和 CPU 时间,没有 ID 及状态等信息(显示 ID 为 -1)。
通过内部线程可以观测到 JVM 活动,如 GC、JIT 编译等占用 CPU 情况,方便了解 JVM 整体运行状况。

- 当 JVM 堆(heap)/元数据(metaspace)空间不足或 OOM 时,可以看到 GC 线程的 CPU 占用率明显高于其他的线程。
- 当 JVM 堆 (heap)/元数据 (metaspace) 空间不足或 OOM 时,可以看到 GC 线程的 CPU 占用率明显高于其他的线程。
- 当执行`trace/watch/tt/redefine`等命令后,可以看到 JIT 线程活动变得更频繁。因为 JVM 热更新 class 字节码时清除了此 class 相关的 JIT 编译结果,需要重新编译。

JVM 内部线程包括下面几种:

- JIT 编译线程: `C1 CompilerThread0`, `C2 CompilerThread0`
- GC 线程: `GC Thread0`, `G1 Young RemSet Sampling`
- 其它内部线程: `VM Periodic Task Thread`, `VM Thread`, `Service Thread`
- JIT 编译线程`C1 CompilerThread0`, `C2 CompilerThread0`
- GC 线程`GC Thread0`, `G1 Young RemSet Sampling`
- 其它内部线程`VM Periodic Task Thread`, `VM Thread`, `Service Thread`

## 截图展示

Expand Down
4 changes: 2 additions & 2 deletions site/docs/doc/dump.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dump

[`dump`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-dump)
[`dump`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=dump)

::: tip
dump 已加载类的 bytecode 到特定目录
Expand Down Expand Up @@ -60,6 +60,6 @@ $ dump --classLoaderClass sun.misc.Launcher$AppClassLoader demo.*
Affect(row-cnt:1) cost in 39 ms.
```

-: 这里 classLoaderClass 在 java 8 是 sun.misc.Launcher$AppClassLoader,而java 11的classloader是jdk.internal.loader.ClassLoaders$AppClassLoader,katacoda 目前环境是 java8。
-这里 classLoaderClass 在 java 8 是 sun.misc.Launcher$AppClassLoader,而 java 11 的 classloader 是 jdk.internal.loader.ClassLoaders$AppClassLoader,katacoda 目前环境是 java8。

`--classLoaderClass` 的值是 ClassLoader 的类名,只有匹配到唯一的 ClassLoader 实例时才能工作,目的是方便输入通用命令,而`-c <hashcode>`是动态变化的。
2 changes: 1 addition & 1 deletion site/docs/doc/echo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# echo

[`echo`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-echo)
[`echo`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=echo)

::: tip
打印参数,和 linux 里的 echo 命令类似。
Expand Down
4 changes: 2 additions & 2 deletions site/docs/doc/getstatic.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# getstatic

[`getstatic`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-getstatic)
[`getstatic`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=getstatic)

### 使用参考

Expand Down Expand Up @@ -44,7 +44,7 @@ $ getstatic -c 3d4eac69 demo.MathGame random

`getstatic --classLoaderClass sun.misc.Launcher$AppClassLoader demo.MathGame random`

-: 这里 classLoaderClass 在 java 8 是 sun.misc.Launcher$AppClassLoader,而java 11的classloader是jdk.internal.loader.ClassLoaders$AppClassLoader,katacoda 目前环境是 java8。
-这里 classLoaderClass 在 java 8 是 sun.misc.Launcher$AppClassLoader,而 java 11 的 classloader 是 jdk.internal.loader.ClassLoaders$AppClassLoader,katacoda 目前环境是 java8。

`--classLoaderClass` 的值是 ClassLoader 的类名,只有匹配到唯一的 ClassLoader 实例时才能工作,目的是方便输入通用命令,而`-c <hashcode>`是动态变化的。

Expand Down
2 changes: 1 addition & 1 deletion site/docs/doc/grep.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# grep

[`grep`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-grep)
[`grep`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=grep)

::: tip
类似传统的`grep`命令。
Expand Down
4 changes: 2 additions & 2 deletions site/docs/doc/heapdump.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# heapdump

[`heapdump`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-heapdump)
[`heapdump`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=heapdump)

::: tip
dump java heap, 类似 jmap 命令的 heap dump 功能。
Expand All @@ -17,7 +17,7 @@ Heap dump file created
```

::: tip
生成文件在`arthas-output`目录,可以通过浏览器下载: http://localhost:8563/arthas-output/
生成文件在`arthas-output`目录,可以通过浏览器下载:http://localhost:8563/arthas-output/
:::

### 只 dump live 对象
Expand Down
16 changes: 8 additions & 8 deletions site/docs/doc/http-api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Http API

[`Http API`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=case-http-api)
[`Http API`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=http-api)

## 概览

Expand Down Expand Up @@ -35,9 +35,9 @@ Http API 接口地址为:`http://ip:port/api`,必须使用 POST 方式提交
- `sessionId` : Arthas 会话 ID,一次性命令不需要设置会话 ID。
- `consumerId` : Arthas 消费者 ID,用于多人共享会话。
- `command` : Arthas command line 。
- `execTimeout` : 命令同步执行的超时时间(ms),默认为 30000。
- `execTimeout` : 命令同步执行的超时时间 (ms),默认为 30000。

注意: 不同的 action 使用到参数不同,根据具体的 action 来设置参数。
注意不同的 action 使用到参数不同,根据具体的 action 来设置参数。

### 请求 Action

Expand Down Expand Up @@ -152,7 +152,7 @@ curl -Ss -XPOST http://localhost:8563/api -d '
由用户创建及管理 Arthas 会话,适用于复杂的交互过程。访问流程如下:

- 创建会话
- 加入会话(可选)
- 加入会话 (可选)
- 拉取命令结果
- 执行一系列命令
- 中断命令执行
Expand All @@ -178,7 +178,7 @@ curl -Ss -XPOST http://localhost:8563/api -d '
}
```

当前会话 ID 为: `b09f1353-202c-407b-af24-701b744f971e` 当前消费者 ID 为:`5ae4e5fbab8b4e529ac404f260d4e2d1_1 `
当前会话 ID 为: `b09f1353-202c-407b-af24-701b744f971e`,当前消费者 ID 为:`5ae4e5fbab8b4e529ac404f260d4e2d1_1 `

### 加入会话

Expand Down Expand Up @@ -222,7 +222,7 @@ curl -Ss -XPOST http://localhost:8563/api -d '
'
```

用 Bash 脚本定时拉取结果消息:
用 Bash 脚本定时拉取结果消息

```bash
while true; do curl -Ss -XPOST http://localhost:8563/api -d '
Expand Down Expand Up @@ -480,7 +480,7 @@ curl -Ss -XPOST http://localhost:8563/api -d '''
`type``status`表示命令执行状态:

每个命令执行结束后都有唯一一个 status 结果。`statusCode`
为 0 表示执行成功,`statusCode` 为非 0 值表示执行失败,类似进程退出码(exit code)。
为 0 表示执行成功,`statusCode` 为非 0 值表示执行失败,类似进程退出码 (exit code)。

命令执行失败时一般会提供错误消息,如:

Expand Down Expand Up @@ -585,7 +585,7 @@ classpath: demo-arthas-spring-boot.jar

注意:

- `echo $json_data | tr -d '\n'` : 删除换行符(`line.separator`的值),避免影响`sed`/`json_pp`命令处理。
- `echo $json_data | tr -d '\n'` : 删除换行符 (`line.separator`的值),避免影响`sed`/`json_pp`命令处理。
- `awk -F'"' '{ print $4 }'` : 使用双引号作为分隔符号

<a id="change_watch_value_to_map"></a>
Expand Down
2 changes: 1 addition & 1 deletion site/docs/doc/jad.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# jad

[`jad`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-jad)
[`jad`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=jad)

::: tip
反编译指定已加载类的源码
Expand Down
10 changes: 5 additions & 5 deletions site/docs/doc/jfr.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# jfr

[`jfr`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-jfr)
[`jfr`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=jfr)

::: tip
Java Flight Recorder (JFR) 是一种用于收集有关正在运行的 Java 应用程序的诊断和分析数据的工具。它集成到 Java 虚拟机 (JVM) 中,几乎不会造成性能开销,因此即使在负载较重的生产环境中也可以使用。
:::

`jfr` 命令支持在程序动态运行过程中开启和关闭 JFR 记录。 记录收集有关 event 的数据。事件在特定时间点发生在 JVM 或 Java 应用程序中。每个事件都有一个名称、一个时间戳和一个可选的有效负载。负载是与事件相关的数据,例如 CPU 使用率、事件前后的 Java 堆大小、锁持有者的线程 ID 等。
`jfr` 命令支持在程序动态运行过程中开启和关闭 JFR 记录。记录收集有关 event 的数据。事件在特定时间点发生在 JVM 或 Java 应用程序中。每个事件都有一个名称、一个时间戳和一个可选的有效负载。负载是与事件相关的数据,例如 CPU 使用率、事件前后的 Java 堆大小、锁持有者的线程 ID 等。

`jfr` 命令基本运行结构是 `jfr cmd [actionArg]`

> 注意: JDK8 的 8u262 版本之后才支持 jfr
> 注意:JDK8 的 8u262 版本之后才支持 jfr
## 参数说明

Expand All @@ -26,7 +26,7 @@ Java Flight Recorder (JFR) 是一种用于收集有关正在运行的 Java 应
| [s:] | 采集 Event 的详细配置文件,默认是 default.jfc 位于 `$JAVA_HOME/lib/jfr/default.jfc` |
| [f:] | 将输出转储到指定路径 |
| [maxage:] | 缓冲区数据最大文件记录保存时间,支持单位配置,不带单位就是秒,默认是不限制 |
| [maxsize:] | 缓冲区的最大文件大小,支持单位配置, 不带单位是字节,m 或者 M 代表 MB,g 或者 G 代表 GB。 |
| [maxsize:] | 缓冲区的最大文件大小,支持单位配置,不带单位是字节,m 或者 M 代表 MB,g 或者 G 代表 GB。 |
| [state:] | jfr 记录状态 |

## 启动 JFR 记录
Expand Down Expand Up @@ -113,4 +113,4 @@ Stop recording 1, The result will be written to:

生成的结果可以用支持 jfr 格式的工具来查看。比如:

- JDK Mission Control https://github.com/openjdk/jmc
- JDK Mission Control : https://github.com/openjdk/jmc
2 changes: 1 addition & 1 deletion site/docs/doc/jvm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# jvm

[`jvm`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-jvm)
[`jvm`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=jvm)

::: tip
查看当前 JVM 信息
Expand Down
2 changes: 1 addition & 1 deletion site/docs/doc/keymap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# keymap

[`keymap`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-keymap)
[`keymap`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=keymap)

`keymap`命令输出当前的快捷键映射表:

Expand Down
4 changes: 2 additions & 2 deletions site/docs/doc/logger.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# logger

[`logger`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-logger)
[`logger`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=logger)

::: tip
查看 logger 信息,更新 logger level
Expand Down Expand Up @@ -133,7 +133,7 @@

`logger --classLoaderClass sun.misc.Launcher$AppClassLoader`

-: 这里 classLoaderClass 在 java 8 是 sun.misc.Launcher$AppClassLoader,而java 11的classloader是jdk.internal.loader.ClassLoaders$AppClassLoader。
-这里 classLoaderClass 在 java 8 是 sun.misc.Launcher$AppClassLoader,而 java 11 的 classloader 是 jdk.internal.loader.ClassLoaders$AppClassLoader。

`--classLoaderClass` 的值是 ClassLoader 的类名,只有匹配到唯一的 ClassLoader 实例时才能工作,目的是方便输入通用命令,而`-c <hashcode>`是动态变化的。

Expand Down
2 changes: 1 addition & 1 deletion site/docs/doc/mbean.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mbean

[`mbean`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-mbean)
[`mbean`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=mbean)

::: tip
查看 Mbean 的信息
Expand Down
2 changes: 1 addition & 1 deletion site/docs/doc/mc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mc

[`mc-retransform`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-mc-retransform)
[`mc-retransform`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=mc-retransform)

## 使用参考

Expand Down
8 changes: 4 additions & 4 deletions site/docs/doc/monitor.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# monitor

[`monitor`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-monitor)
[`monitor`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=monitor)

::: tip
方法执行监控
:::

对匹配 `class-pattern``method-pattern``condition-express`的类、方法的调用进行监控。

`monitor` 命令是一个非实时返回命令.
`monitor` 命令是一个非实时返回命令

实时返回命令是输入之后立即返回,而非实时返回的命令,则是不断的等待目标 Java 进程返回信息,直到用户输入 `Ctrl+C` 为止。

Expand Down Expand Up @@ -87,7 +87,7 @@ Affect(class count:1 , method count:1) cost in 384 ms, listenerId: 6.
2022-12-25 21:12:59 demo.MathGame primeFactors 0 0 0 0.00 0.00%
```

### 计算条件表达式过滤统计结果(方法执行完毕之后)
### 计算条件表达式过滤统计结果 (方法执行完毕之后)

```bash
monitor -c 5 demo.MathGame primeFactors "params[0] <= 2"
Expand All @@ -114,7 +114,7 @@ Affect(class count: 1 , method count: 1) cost in 19 ms, listenerId: 5
2020-09-02 09:42:56 demo.MathGame primeFactors 5 3 2 0.15 40.00%
```

### 计算条件表达式过滤统计结果(方法执行完毕之前)
### 计算条件表达式过滤统计结果 (方法执行完毕之前)

```bash
monitor -b -c 5 com.test.testes.MathGame primeFactors "params[0] <= 2"
Expand Down
2 changes: 1 addition & 1 deletion site/docs/doc/ognl.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ognl

[`ognl`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-ognl)
[`ognl`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=ognl)

::: tip
执行 ognl 表达式
Expand Down
6 changes: 3 additions & 3 deletions site/docs/doc/options.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# options

[`options`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-options)
[`options`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=options)

::: tip
全局开关
Expand All @@ -13,7 +13,7 @@
| batch-re-transform | true | 是否支持批量对匹配到的类执行 retransform 操作 |
| json-format | false | 是否支持 json 化的输出 |
| disable-sub-class | false | 是否禁用子类匹配,默认在匹配目标类的时候会默认匹配到其子类,如果想精确匹配,可以关闭此开关 |
| support-default-method | true | 是否支持匹配到 default method, 默认会查找 interface,匹配里面的 default method。参考 [#1105](https://github.com/alibaba/arthas/issues/1105) |
| support-default-method | true | 是否支持匹配到 default method,默认会查找 interface,匹配里面的 default method。参考 [#1105](https://github.com/alibaba/arthas/issues/1105) |
| save-result | false | 是否打开执行结果存日志功能,打开之后所有命令的运行结果都将保存到`~/logs/arthas-cache/result.log`|
| job-timeout | 1d | 异步后台任务的默认超时时间,超过这个时间,任务自动停止;比如设置 1d, 2h, 3m, 25s,分别代表天、小时、分、秒 |
| print-parent-fields | true | 是否打印在 parent class 里的 filed |
Expand Down Expand Up @@ -130,4 +130,4 @@ watch failed, condition is: target.illegalArgumentCount=1, express is: target, B

用户如果确定要在`ognl`表达式里更新对象,可以执行`options strict false`,关闭`strict`模式。

- 更多信息参考: https://github.com/alibaba/arthas/issues/2128
- 更多信息参考:https://github.com/alibaba/arthas/issues/2128
2 changes: 1 addition & 1 deletion site/docs/doc/perfcounter.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# perfcounter

[`perfcounter`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-perfcounter)
[`perfcounter`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=perfcounter)

::: tip
查看当前 JVM 的 Perf Counter 信息
Expand Down
Loading

1 comment on commit f352564

@vercel
Copy link

@vercel vercel bot commented on f352564 Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.