打算学习下CloudBeaver ,但是无奈CloudBeaver源码基于osgi,同时构建依赖的模块复杂,所以基于arthas
的火焰图功能梳理简单提供一个CloudBeaver 查询的处理流程
dockerfile
基于已经制作好的
1FROM dalongrong/cloudbeaver:latest 2 3COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas
环境准备
docker-compose 文件
1version: "3" 2 3services: 4 5 cloudbeaver: 6 7 image: dalongrong/cloudbeaver:arthas 8 9 build: ./ 10 11 volumes: 12 13 - "./demos:/opt/demos" 14 15 ports: 16 17 - "80:8978" 18 19 cap_add: 20 21 - ALL
使用
-
启动
docker-compose up -d
-
进入容器生成火焰图
docker-compose exec cloudbeaver sh
java -jar /opt/arthas/arthas-boot.jar
profiler start -i 200
-
运行查询
多点几次

-
停止生成火焰图
profiler stop
效果


- 打开火焰图



说明
基于以上我们打开可以了解一次代码的处理,同时我们可以基于trace 、monitor、stack 、watch 等查看具体的处理,基于
arthas也是一个学习复杂系统的一个方法
参考资料
https://alibaba.github.io/arthas/en/docker.html
https://github.com/dbeaver/cloudbeaver
https://www.cnblogs.com/rongfengliang/p/12798154.html