diff --git a/tutorials/katacoda/command-vmtool-cn/vmtool-classloader.md b/tutorials/katacoda/command-vmtool-cn/vmtool-classloader.md index 997ec1011..5304af1f0 100644 --- a/tutorials/katacoda/command-vmtool-cn/vmtool-classloader.md +++ b/tutorials/katacoda/command-vmtool-cn/vmtool-classloader.md @@ -3,9 +3,8 @@ ### 指定 classloader name -```bash -vmtool --action getInstances --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader --className org.springframework.context.ApplicationContext -``` + +`vmtool --action getInstances --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader --className org.springframework.context.ApplicationContext`{{execute T2}} ### 指定 classloader hash diff --git a/tutorials/katacoda/command-vmtool-cn/vmtool-gc.md b/tutorials/katacoda/command-vmtool-cn/vmtool-gc.md index ac9da5780..1b60289ab 100644 --- a/tutorials/katacoda/command-vmtool-cn/vmtool-gc.md +++ b/tutorials/katacoda/command-vmtool-cn/vmtool-gc.md @@ -1,6 +1,7 @@ ### 强制GC -```bash -vmtool --action forceGc -``` + +`vmtool --action forceGc`{{execute T2}} + + diff --git a/tutorials/katacoda/command-vmtool-cn/vmtool-spring.md b/tutorials/katacoda/command-vmtool-cn/vmtool-spring.md index 8c37925e8..9d7d6d858 100644 --- a/tutorials/katacoda/command-vmtool-cn/vmtool-spring.md +++ b/tutorials/katacoda/command-vmtool-cn/vmtool-spring.md @@ -2,6 +2,8 @@ ### 查找spring context +`vmtool --action getInstances --className org.springframework.context.ApplicationContext `{{execute T2}} + ```bash $ vmtool --action getInstances --className org.springframework.context.ApplicationContext @ApplicationContext[][ @@ -15,9 +17,7 @@ $ vmtool --action getInstances --className org.springframework.context.Applicati > 通过 `-x`/`--expand` 参数可以指定结果的展开层次,默认值是1。 -```bash -vmtool --action getInstances -c 19469ea2 --className org.springframework.context.ApplicationContext -x 2 -``` +`vmtool --action getInstances --className org.springframework.context.ApplicationContext -x 2`{{execute T2}} ### 执行表达式 @@ -25,12 +25,15 @@ vmtool --action getInstances -c 19469ea2 --className org.springframework.context 查找所有的spring beans名字: -```bash -vmtool --action getInstances --className org.springframework.context.ApplicationContext --express 'instances[0].getBeanDefinitionNames()' -``` + +`vmtool --action getInstances --className org.springframework.context.ApplicationContext --express 'instances[0].getBeanDefinitionNames()'`{{execute T2}} + 调用`userController.findUserById(1)`函数: + +`vmtool --action getInstances --className org.springframework.context.ApplicationContext --express 'instances[0].getBean("userController").findUserById(1)'`{{execute T2}} + ``` $ vmtool --action getInstances --className org.springframework.context.ApplicationContext --express 'instances[0].getBean("userController").findUserById(1)' @User[ @@ -41,6 +44,9 @@ $ vmtool --action getInstances --className org.springframework.context.Applicati ### 查找所有的spring mapping对象 + +`vmtool --action getInstances --className org.springframework.web.servlet.HandlerMapping`{{execute T2}} + ```bash $ vmtool --action getInstances --className org.springframework.web.servlet.HandlerMapping @HandlerMapping[][ diff --git a/tutorials/katacoda/command-vmtool-cn/vmtool.md b/tutorials/katacoda/command-vmtool-cn/vmtool.md index 24a2f5fe8..8a3e7bb3f 100644 --- a/tutorials/katacoda/command-vmtool-cn/vmtool.md +++ b/tutorials/katacoda/command-vmtool-cn/vmtool.md @@ -5,6 +5,8 @@ ### 查找jvm里的字符串对象 +`vmtool --action getInstances --className java.lang.String`{{execute T2}} + ```bash $ vmtool --action getInstances --className java.lang.String @String[][ diff --git a/tutorials/katacoda/command-vmtool-en/vmtool-classloader.md b/tutorials/katacoda/command-vmtool-en/vmtool-classloader.md index 01eab4f72..5ae959c79 100644 --- a/tutorials/katacoda/command-vmtool-en/vmtool-classloader.md +++ b/tutorials/katacoda/command-vmtool-en/vmtool-classloader.md @@ -1,9 +1,6 @@ ### Specify classloader name -```bash -vmtool --action getInstances --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader --className org.springframework.context.ApplicationContext -``` - +`vmtool --action getInstances --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader --className org.springframework.context.ApplicationContext`{{execute T2}} ### Specify classloader hash diff --git a/tutorials/katacoda/command-vmtool-en/vmtool-gc.md b/tutorials/katacoda/command-vmtool-en/vmtool-gc.md index b2d98069a..cd82543b5 100644 --- a/tutorials/katacoda/command-vmtool-en/vmtool-gc.md +++ b/tutorials/katacoda/command-vmtool-en/vmtool-gc.md @@ -1,6 +1,4 @@ ### forceGc -```bash -vmtool --action forceGc -``` +`vmtool --action forceGc`{{execute T2}} \ No newline at end of file diff --git a/tutorials/katacoda/command-vmtool-en/vmtool-spring.md b/tutorials/katacoda/command-vmtool-en/vmtool-spring.md index dc0531e2a..da461384c 100644 --- a/tutorials/katacoda/command-vmtool-en/vmtool-spring.md +++ b/tutorials/katacoda/command-vmtool-en/vmtool-spring.md @@ -2,6 +2,8 @@ Next, use the `vmtool` command to find objects in spring. ### Find spring context +`vmtool --action getInstances --className org.springframework.context.ApplicationContext `{{execute T2}} + ```bash $ vmtool --action getInstances --className org.springframework.context.ApplicationContext @ApplicationContext[][ @@ -15,9 +17,7 @@ $ vmtool --action getInstances --className org.springframework.context.Applicati > The expansion level of the result can be specified by the `-x`/`--expand` parameter, the default value is 1. -```bash -vmtool --action getInstances -c 19469ea2 --className org.springframework.context.ApplicationContext -x 2 -``` +`vmtool --action getInstances --className org.springframework.context.ApplicationContext -x 2`{{execute T2}} ### Execute expression @@ -25,11 +25,11 @@ vmtool --action getInstances -c 19469ea2 --className org.springframework.context Find the names of all spring beans: -```bash -vmtool --action getInstances --className org.springframework.context.ApplicationContext --express'instances[0].getBeanDefinitionNames()' -``` +`vmtool --action getInstances --className org.springframework.context.ApplicationContext --express 'instances[0].getBeanDefinitionNames()'`{{execute T2}} -Call the `userController.findUserById(1)` function: +Call the `userController.findUserById(1)` method: + +`vmtool --action getInstances --className org.springframework.context.ApplicationContext --express 'instances[0].getBean("userController").findUserById(1)'`{{execute T2}} ``` $ vmtool --action getInstances --className org.springframework.context.ApplicationContext --express'instances[0].getBean("userController").findUserById(1)' @@ -41,6 +41,8 @@ $ vmtool --action getInstances --className org.springframework.context.Applicati ### Find all spring mapping objects +`vmtool --action getInstances --className org.springframework.web.servlet.HandlerMapping`{{execute T2}} + ```bash $ vmtool --action getInstances --className org.springframework.web.servlet.HandlerMapping @HandlerMapping[][ diff --git a/tutorials/katacoda/command-vmtool-en/vmtool.md b/tutorials/katacoda/command-vmtool-en/vmtool.md index e230a1b89..b5bd74b29 100644 --- a/tutorials/katacoda/command-vmtool-en/vmtool.md +++ b/tutorials/katacoda/command-vmtool-en/vmtool.md @@ -6,6 +6,8 @@ Use the `vmtool` command to find the jvm object. ### Find string objects in jvm +`vmtool --action getInstances --className java.lang.String`{{execute T2}} + ```bash $ vmtool --action getInstances --className java.lang.String @String[][