diff --git a/site/src/site/sphinx/arthas3.md b/site/src/site/sphinx/arthas3.md index df93a15d7..15fa0fb51 100644 --- a/site/src/site/sphinx/arthas3.md +++ b/site/src/site/sphinx/arthas3.md @@ -19,7 +19,7 @@ Arthas 3.0开始支持管道, 率先提供了`grep`,`wc`,`plaintext`的支持。 groovy表达式在arthas2.0中大量使用,例如watch表达式 -```sh +```bash watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "params + ' ' + returnObj" params.size()==2 ``` diff --git a/site/src/site/sphinx/arthas_3_0/new_feature.md b/site/src/site/sphinx/arthas_3_0/new_feature.md index f73cb52ed..d38392e94 100644 --- a/site/src/site/sphinx/arthas_3_0/new_feature.md +++ b/site/src/site/sphinx/arthas_3_0/new_feature.md @@ -16,7 +16,7 @@ Arthas 3.0最重要的特性,通过Arthas在线诊断平台,无需再登陆 Arthas 3.0开始支持管道, 率先提供了`grep`,`wc`,`plaintext`的支持。 -```sh +```bash java.vendor.url http://java.oracle.com/ java.vm.vendor Oracle Corporation java.runtime.name Java(TM) SE Runtime Environment @@ -55,7 +55,7 @@ To solve this, choose one of the following command: groovy表达式在arthas2.0中大量使用,例如watch表达式 -```sh +```bash watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "params + ' ' + returnObj" params.size()==2 ``` diff --git a/site/src/site/sphinx/async.md b/site/src/site/sphinx/async.md index 90e827da3..aaa0a3267 100644 --- a/site/src/site/sphinx/async.md +++ b/site/src/site/sphinx/async.md @@ -6,14 +6,14 @@ arthas中的异步调用,使用了仿linux系统任务相关的命令。[linux ## 1. 使用&在后台执行任务 比如希望执行后台执行trace命令,那么调用下面命令 -```sh +```bash trace Test t & ``` 这时命令在后台执行,可以在console中继续执行其他命令。 ## 2. 通过jobs查看任务 如果希望查看当前有哪些arthas任务在执行,可以执行jobs命令,执行结果如下 -```sh +```bash $ jobs [10]* Stopped watch com.taobao.container.Test test "params[0].{? #this.name == null }" -x 2 @@ -43,13 +43,13 @@ $ jobs ## 5. 任务输出重定向 可通过`>`或者`>>`将任务输出结果输出到指定的文件中,可以和`&`一起使用,实现arthas命令的异步调用。比如: -```sh +```bash $ trace Test t >> test.out & ``` 这时trace命令会在后台执行,并且把结果输出到~/logs/arthas-cache/test.out。可继续执行其他命令。并可查看文件中的命令执行结果。 当连接到远程的arthas server时,可能无法查看远程机器的文件,arthas同时支持了自动重定向到本地缓存路径。使用方法如下: -```sh +```bash $ trace Test t >> & job id : 2 cache location : /Users/gehui/logs/arthas-cache/28198/2 diff --git a/site/src/site/sphinx/batch-support.md b/site/src/site/sphinx/batch-support.md index 5d17473fb..d1199537e 100644 --- a/site/src/site/sphinx/batch-support.md +++ b/site/src/site/sphinx/batch-support.md @@ -28,12 +28,12 @@ sc -d org.apache.commons.lang.StringUtils 通过`-b`开启批处理模式, `-f`执行脚本文件, 批处理脚本默认会输出到标准输出中,可以将结果重定向到文件中。 -```sh +```bash ./as.sh -b -f /var/tmp/test.as 56328 > test.out ``` #### 第三步: 查看运行结果 -```sh +```bash cat test.out ``` \ No newline at end of file diff --git a/site/src/site/sphinx/classloader.md b/site/src/site/sphinx/classloader.md index f0e9c934c..c7f6233b6 100644 --- a/site/src/site/sphinx/classloader.md +++ b/site/src/site/sphinx/classloader.md @@ -41,7 +41,7 @@ Affect(row-cnt:11) cost in 66 ms. * 按类加载实例查看统计信息 -```sh +```bash $ classloader -l name loadedCount hash parent BootstrapClassLoader 3711 null null diff --git a/site/src/site/sphinx/en/async.md b/site/src/site/sphinx/en/async.md index 2f53e0416..c24bfab2f 100644 --- a/site/src/site/sphinx/en/async.md +++ b/site/src/site/sphinx/en/async.md @@ -8,7 +8,7 @@ Asynchronous jobs in arthas, using commands related to linux jobs.[linux man job For example, execute the trace command in the background: -```sh +```bash trace Test t & ``` @@ -17,7 +17,7 @@ trace Test t & If you want to list all background jobs, you can execute the `jobs` command and the results are as follows: -```sh +```bash $ jobs [10]* Stopped watch com.taobao.container.Test test "params[0].{? #this.name == null }" -x 2 @@ -54,7 +54,7 @@ When the job is executing in the foreground, such as directly calling the comman The job output can be redirect to the specified file by `>` or `>>`, and can be used together with `&` to implement the asynchronous job of the arthas command. such as: -```sh +```bash $ trace Test t >> test.out & ``` @@ -63,7 +63,7 @@ The trace command will be executed in the background and the output will be redi When connecting to a remote arthas server, you may not be able to view the files of the remote machine. Arthas also supports automatic redirection to the local cache file. Examples are as follows: -```sh +```bash $ trace Test t >> & job id : 2 cache location : /Users/gehui/logs/arthas-cache/28198/2 diff --git a/site/src/site/sphinx/en/batch-support.md b/site/src/site/sphinx/en/batch-support.md index 1095985b1..6672f2006 100644 --- a/site/src/site/sphinx/en/batch-support.md +++ b/site/src/site/sphinx/en/batch-support.md @@ -28,12 +28,12 @@ Attention: Using `-b` to turn on script mode, and `-f` to run it and you can also *redirect* the output as: -```sh +```bash ./as.sh -b -f /var/tmp/test.as 56328 > test.out ``` #### Step-3: Check the outputs -```sh +```bash cat test.out ``` diff --git a/site/src/site/sphinx/en/classloader.md b/site/src/site/sphinx/en/classloader.md index 913f9d4de..a20105599 100644 --- a/site/src/site/sphinx/en/classloader.md +++ b/site/src/site/sphinx/en/classloader.md @@ -19,7 +19,7 @@ It can be a great help for `ResourceNotFoundException` when you can use command * Categorised by class loader -```sh +```bash $ classloader name numberOfInstances loadedCountTotal com.taobao.pandora.service.loader.ModuleClassLoader 29 11659 @@ -38,7 +38,7 @@ Affect(row-cnt:11) cost in 66 ms. * Categorized by class loader instance -```sh +```bash $ classloader -l name loadedCount hash parent BootstrapClassLoader 3711 null null diff --git a/site/src/site/sphinx/en/jad.md b/site/src/site/sphinx/en/jad.md index 6aa6fc6af..ef6a55ad5 100644 --- a/site/src/site/sphinx/en/jad.md +++ b/site/src/site/sphinx/en/jad.md @@ -122,7 +122,7 @@ Affect(row-cnt:1) cost in 190 ms. De-compile the specified method: -```sh +```bash $ jad com.taobao.container.web.arthas.rest.MetricsController directMetrics ClassLoader: diff --git a/site/src/site/sphinx/en/save-log.md b/site/src/site/sphinx/en/save-log.md index cb4ba4c25..0d580c513 100644 --- a/site/src/site/sphinx/en/save-log.md +++ b/site/src/site/sphinx/en/save-log.md @@ -5,7 +5,7 @@ Log command outputs for later analysis, turned off by default. To turn it on, using [options](options.md) as: -```sh +```bash $ options save-result true NAME BEFORE-VALUE AFTER-VALUE ---------------------------------------- @@ -23,7 +23,7 @@ F.Y.I :notes: :notes: With the latest Arthas, you can log the outputs asynchronously in the background: -```sh +```bash $ trace Test t >> & job id : 2 cache location : /Users/zhuyong/logs/arthas-cache/28198/2 diff --git a/site/src/site/sphinx/en/sm.md b/site/src/site/sphinx/en/sm.md index 062a32018..a11502b1d 100644 --- a/site/src/site/sphinx/en/sm.md +++ b/site/src/site/sphinx/en/sm.md @@ -61,7 +61,7 @@ org.apache.catalina.connector.Connector->getMaxCookieCount ``` -```sh +```bash $ sm org.apache.catalina.connector.Connector -d declaring-class org.apache.catalina.connector.Connector constructor-name diff --git a/site/src/site/sphinx/en/start-arthas.md b/site/src/site/sphinx/en/start-arthas.md index 0dd5b6f07..3cfc333bd 100644 --- a/site/src/site/sphinx/en/start-arthas.md +++ b/site/src/site/sphinx/en/start-arthas.md @@ -7,7 +7,7 @@ Start Arthas ./as.sh ``` -```sh +```bash ➜ bin git:(develop) ✗ ./as.sh Found existing java process, please choose one and hit RETURN. [1]: 3088 org.jetbrains.idea.maven.server.RemoteMavenServer diff --git a/site/src/site/sphinx/en/thread.md b/site/src/site/sphinx/en/thread.md index 7c9b4b9cd..21e00d33f 100644 --- a/site/src/site/sphinx/en/thread.md +++ b/site/src/site/sphinx/en/thread.md @@ -100,7 +100,7 @@ $ thread 1 Using `-b`, we can effectively locate the threads holding locks blocking other threads resulting in a frozen system. -```sh +```bash $ thread -b "http-bio-8080-exec-4" Id=27 TIMED_WAITING at java.lang.Thread.sleep(Native Method) @@ -144,7 +144,7 @@ $ thread -b #### thread -i specify the collecting interval -```sh +```bash $ thread -n 3 -i 1000 "as-command-execute-daemon" Id=4759 cpuUsage=23% RUNNABLE at sun.management.ThreadImpl.dumpThreads0(Native Method) diff --git a/site/src/site/sphinx/jad.md b/site/src/site/sphinx/jad.md index 56ec3deaf..7ad01c335 100644 --- a/site/src/site/sphinx/jad.md +++ b/site/src/site/sphinx/jad.md @@ -119,7 +119,7 @@ Affect(row-cnt:1) cost in 190 ms. 反编译指定的方法: -```sh +```bash $ jad com.taobao.container.web.arthas.rest.MetricsController directMetrics ClassLoader: diff --git a/site/src/site/sphinx/save-log.md b/site/src/site/sphinx/save-log.md index 33fa4e898..920ce1cef 100644 --- a/site/src/site/sphinx/save-log.md +++ b/site/src/site/sphinx/save-log.md @@ -5,7 +5,7 @@ * 默认情况下,该功能是关闭的,如果需要开启,请执行以下命令: -```sh +```bash $ options save-result true NAME BEFORE-VALUE AFTER-VALUE ---------------------------------------- @@ -21,7 +21,7 @@ Affect(row-cnt:1) cost in 3 ms. ### 使用新版本Arthas的异步后台任务将结果存日志文件 -```sh +```bash $ trace Test t >> & job id : 2 cache location : /Users/zhuyong/logs/arthas-cache/28198/2 diff --git a/site/src/site/sphinx/sm.md b/site/src/site/sphinx/sm.md index d486f04af..a37345892 100644 --- a/site/src/site/sphinx/sm.md +++ b/site/src/site/sphinx/sm.md @@ -60,7 +60,7 @@ org.apache.catalina.connector.Connector->getMaxCookieCount ``` -```sh +```bash $ sm org.apache.catalina.connector.Connector -d declaring-class org.apache.catalina.connector.Connector constructor-name diff --git a/site/src/site/sphinx/start-arthas.md b/site/src/site/sphinx/start-arthas.md index 4e0d65ec1..61a4e2de5 100644 --- a/site/src/site/sphinx/start-arthas.md +++ b/site/src/site/sphinx/start-arthas.md @@ -7,7 +7,7 @@ ./as.sh ``` -```sh +```bash ➜ bin git:(develop) ✗ ./as.sh Found existing java process, please choose one and hit RETURN. [1]: 3088 org.jetbrains.idea.maven.server.RemoteMavenServer diff --git a/site/src/site/sphinx/thread.md b/site/src/site/sphinx/thread.md index aa9c63c91..bf2d8411b 100644 --- a/site/src/site/sphinx/thread.md +++ b/site/src/site/sphinx/thread.md @@ -99,7 +99,7 @@ $ thread 1 有时候我们发现应用卡住了, 通常是由于某个线程拿住了某个锁, 并且其他线程都在等待这把锁造成的。 为了排查这类问题, arthas提供了`thread -b`, 一键找出那个罪魁祸首。 -```sh +```bash $ thread -b "http-bio-8080-exec-4" Id=27 TIMED_WAITING at java.lang.Thread.sleep(Native Method) @@ -143,7 +143,7 @@ $ thread -b #### thread -i, 指定采样时间间隔 -```sh +```bash $ thread -n 3 -i 1000 "as-command-execute-daemon" Id=4759 cpuUsage=23% RUNNABLE at sun.management.ThreadImpl.dumpThreads0(Native Method)