We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tt 主要是用来记录请求的数据,方便二次触发,比如和测试找bug,触发了一次之后自己触发调试即可,不过这种场景用得还是比较少,现在获取tt 主要是为了获取spring context 然后进行一些操作。参考 arthas 这个获取spring context
idea 打开右键获取tt命令
com.github.wangji92.arthas.plugin.common.enums.TimeTunnelCommandEnum 主要是这个类
重常用命令列表选择复制命令粘贴到arthas的界面
tt -p -i 1000
重新出发5次,每次时间间隔 2秒
tt -p --replay-times 5 --replay-interval 2000 -i 1000
前提是要触发一次 spring mvc的相关的接口 arthas 官方问题链接
tt -t org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter invokeHandlerMethod
其他的使用和上面的一致的,这里有了这个index 就可以获取spring context 了
这里的index 要修改为1001
tt -w 'target.getApplicationContext()' -i 1001
效果如下 也可以获取某个bean 处理方法
tt -w 'target.getApplicationContext().getBean("controllerTest").test()' -i 1001
other 示范
tt -w 'target.getApplicationContext().getBean(@org.springframework.web.servlet.view.BeanNameViewResolver@class).getOrder()' -i 1001
这种需要触发一次不是很方便
ognl -x 3 '#springContext=@com.wj.study.demo.generator.ApplicationContextProvider@context,#springContext.getBean("controllerTest").test()' -c 18b4aac2
arthas 插件命令直接支持 配置一下静态的位置即可。
watch org.springframework.web.servlet.DispatcherServlet doDispatch '@org.springframework.web.context.support.WebApplicationContextUtils@getWebApplicationContext(params[0].getServletContext()).getBean("controllerTest").test()' -n 5 -x 3
The text was updated successfully, but these errors were encountered:
No branches or pull requests
tt 说明
tt 主要是用来记录请求的数据,方便二次触发,比如和测试找bug,触发了一次之后自己触发调试即可,不过这种场景用得还是比较少,现在获取tt 主要是为了获取spring context 然后进行一些操作。参考 arthas 这个获取spring context
打开 tt 命令
idea 打开右键获取tt命令
界面 说明
停留一会回出现一些中文的提示信息
命令演示
接口信息
arthas 打开 执行命令(参考arthas 安装)
触发一下这个接口
tt time list 按Q 退出
执行一次重新触发一次
重常用命令列表选择复制命令粘贴到arthas的界面
周期性的触发
重新出发5次,每次时间间隔 2秒
特殊用法 获取spring contxt
前提是要触发一次 spring mvc的相关的接口
arthas 官方问题链接
其他的使用和上面的一致的,这里有了这个index 就可以获取spring context 了
这里的index 要修改为1001
tt -w 'target.getApplicationContext()' -i 1001
效果如下
也可以获取某个bean 处理方法
tt -w 'target.getApplicationContext().getBean("controllerTest").test()' -i 1001
other 示范
tt -w 'target.getApplicationContext().getBean(@org.springframework.web.servlet.view.BeanNameViewResolver@class).getOrder()' -i 1001
还有其他的获取spring context的方法?
1、上面的tt 获取
这种需要触发一次不是很方便
2、静态的stata 的 spring context
ognl -x 3 '#springContext=@com.wj.study.demo.generator.ApplicationContextProvider@context,#springContext.getBean("controllerTest").test()' -c 18b4aac2
arthas 插件命令直接支持
配置一下静态的位置即可。
3、watch 获取
这种需要触发一次不是很方便
watch org.springframework.web.servlet.DispatcherServlet doDispatch '@org.springframework.web.context.support.WebApplicationContextUtils@getWebApplicationContext(params[0].getServletContext()).getBean("controllerTest").test()' -n 5 -x 3
The text was updated successfully, but these errors were encountered: