这个是堆栈异常
java -javaagent:D:\MyPerf4J\MyPerf4J-ASM.jar -DMyPerf4JPropFile=D:\MyPerf4J\myPerf4J.properties -jar hk8700-1.3.0.jar
2018-11-08 10:01:32.504 [MyPerf4J] WARN profilingParamFile is empty!
2018-11-08 10:01:32.522 [MyPerf4J] INFO
__ ___ ____ ______ __ __
/ |/ /_ / __ _ __/ / // / / /
/ /|/ / / / / // / _ / / // // / / /
/ / / / // / / __/ / / / __/ // /
// //_, // _// // // _/
/____/
2018-11-08 10:01:32.522 [MyPerf4J] INFO AbstractBootstrap doInitial() SUCCESS!!!
2018-11-08 10:01:32.561 [MyPerf4J] INFO ProfilingTransformer.transform(sun.misc.Launcher$AppClassLoader@18b4aac2, com/elink/estos/api/bootstrap/Bootstrap8700, classBeingRedefined, protectionDomain, 1332)...
2018-11-08 10:01:32.586 [MyPerf4J] ERROR ProfilingTransformer.transform(sun.misc.Launcher$AppClassLoader@18b4aac2, com/elink/estos/api/bootstrap/Bootstrap8700, null, ProtectionDomain (file:/D:/Users/30451/Documents/estos-api4/hk8700/target/hk8700-1.3.0.jar )
sun.misc.Launcher$AppClassLoader@18b4aac2
java.security.Permissions@17a7cec2 (
("java.io.FilePermission" "\D:\Users\30451\Documents\estos-api4\hk8700\target\hk8700-1.3.0.jar" "read")
("java.lang.RuntimePermission" "exitVM")
)
, 1332)
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at cn.myperf4j.asm.aop.ProfilingTransformer.getBytes(ProfilingTransformer.java:54)
at cn.myperf4j.asm.aop.ProfilingTransformer.transform(ProfilingTransformer.java:37)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
2018-11-08 10:01:32.693 [MyPerf4J] INFO ProfilingTransformer.transform(sun.misc.Launcher$AppClassLoader@18b4aac2, com/elink/common/utils/PropertiesLoader, classBeingRedefined, protectionDomain, 5941)...
2018-11-08 10:01:32.695 [MyPerf4J] ERROR ProfilingTransformer.transform(sun.misc.Launcher$AppClassLoader@18b4aac2, com/elink/common/utils/PropertiesLoader, null, ProtectionDomain (file:/D:/Users/30451/Documents/estos-api4/hk8700/target/hk8700-1.3.0.jar )
sun.misc.Launcher$AppClassLoader@18b4aac2
java.security.Permissions@17a7cec2 (
("java.io.FilePermission" "\D:\Users\30451\Documents\estos-api4\hk8700\target\hk8700-1.3.0.jar" "read")
("java.lang.RuntimePermission" "exitVM")
)
, 5941)
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at cn.myperf4j.asm.aop.ProfilingTransformer.getBytes(ProfilingTransformer.java:54)
at cn.myperf4j.asm.aop.ProfilingTransformer.transform(ProfilingTransformer.java:37)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.elink.estos.api.bootstrap.Bootstrap8700.(Bootstrap8700.java:22)
start hk8700 server
2018-11-08 10:01:32.736 [MyPerf4J] INFO ProfilingTransformer.transform(sun.misc.Launcher$AppClassLoader@18b4aac2, com/elink/common/utils/FileUtils, classBeingRedefined, protectionDomain, 14416)...
2018-11-08 10:01:32.737 [MyPerf4J] ERROR ProfilingTransformer.transform(sun.misc.Launcher$AppClassLoader@18b4aac2, com/elink/common/utils/FileUtils, null, ProtectionDomain (file:/D:/Users/30451/Documents/estos-api4/hk8700/target/hk8700-1.3.0.jar )
sun.misc.Launcher$AppClassLoader@18b4aac2
java.security.Permissions@17a7cec2 (
("java.io.FilePermission" "\D:\Users\30451\Documents\estos-api4\hk8700\target\hk8700-1.3.0.jar" "read")
("java.lang.RuntimePermission" "exitVM")
)
, 14416)
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at cn.myperf4j.asm.aop.ProfilingTransformer.getBytes(ProfilingTransformer.java:54)
at cn.myperf4j.asm.aop.ProfilingTransformer.transform(ProfilingTransformer.java:37)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.elink.estos.api.bootstrap.Bootstrap8700.main(Bootstrap8700.java:28)
配置文件信息
#应用名称
AppName=MyPerf4JTest
#MetricsProcessor类型,0:以标准格式化结构输出到stdout.log 1:以标准格式化结构输出到磁盘 2:以InfluxDB LineProtocol格式输出到磁盘
MetricsProcessorType=1
#配置各个Metrics日志的文件路径,可不配置
MethodMetricsFile=D:\MyPerf4J\method_metrics.log
#ClassMetricsFile=/data/logs/MyPerf4J/class_metrics.log
#GCMetricsFile=/data/logs/MyPerf4J/gc_metrics.log
#MemMetricsFile=/data/logs/MyPerf4J/memory_metrics.log
ThreadMetricsFile=D:\MyPerf4J\thread_metrics.log
#配置日志文件滚动时间间隔,分别有MINUTELY、HOURLY和DAILY三个值
LogRollingTimeUnit=HOURLY
#配置备份Recorders的数量,默认为1,最小为1,最大为8,当需要在较小MillTimeSlice内统计大量方法性能数据时可配置大一些
BackupRecordersCount=1
#配置Record模式,可配置为accurate/rough
RecorderMode=accurate
#配置时间片,单位为ms,最小1s,最大600s
MilliTimeSlice=10000
#是否展示方法参数类型
ShowMethodParams=true
#需要监控的package,可配置多个,用英文';'分隔
IncludePackages=com.elink
#不需要监控的package,可配置多个,用英文';'分隔
ExcludePackages=org.spring;
#可配置多个方法名,用英文';'分隔
ExcludeMethods=equals;hash
#是否排除私有方法,true/false
ExcludePrivateMethod=true
#通用的方法执行时间阈值,单位为ms
ProfilingTimeThreshold=1000
#在一个时间片内,超过方法执行时间阈值的次数,仅在RecorderMode=accurate时有效
ProfilingOutThresholdCount=10