How to add enable flag for Flight Recorder in Maven project?

假装没事ソ 提交于 2019-12-06 15:43:37

If you are using jcmd command from jdk, then could enable JFR via:

jcmd 31118 VM.unlock_commercial_features

Then use JFR.

e.g

jcmd 31118 JFR.start name=a

That configuration should be added to the running VM of Jetty so I'd try this:

mvn jetty:run -XX:+UnlockCommercialFeatures -XX:+FlightRecorder

I could not test this, and I work most on Tomcat, but I think this could help you

I got the answer by using below.

export MAVEN_OPTS="$MAVEN_OPTS -XX:+UnlockCommercialFeatures -XX:+FlightRecorder"
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!