arthas是否支持动态执行代码?
- Dominant language
- Java
- Stars
- 37.5k
- Forks
- 7.6k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 4
Description
- [x] 我已经在 [issues](https://github.com/alibaba/arthas/issues) 里搜索,没有重复的issue。
### 背景
1. 项目是一个Java实现的**长连接有状态**的服务器程序(比如游戏服务器端)
2. 线上出现问题时,通常需要一种排查方式或者解决办法
- 输入一段代码,编译,加载,执行
- 代码段可以输入项目任何项目的公共api调用,然后输出内存数据排查
3. 调试环境下,类似ide debug下可以执行一段表达式代码,然后execute
4. 之前的线上环境,我们是直接用了如beanshell脚本,直接编写beanshell脚本,调用已有api获取数据,然后动态执行
### 疑问
想问一下arthas是否提供类似功能
### 思路
- 其实之前自己实现也比较简单。服务器端提供一个解析脚本接口,输入是.java(或者源文件字符串)。服务器端收到后,动态编译、加载、执行。
- 不过如果arthas直接支持就更好了
Contributor guide
Research direction
No file, test, or entry point is named. Start by reviewing Arthas's existing capabilities for compiling, loading, and executing Java or BeanShell code, then define the supported input, execution boundaries, and output behavior; done means the requested dynamic-code workflow is implemented and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100