#MyPerf4J 所有配置请参考:https://github.com/LinShunKang/MyPerf4J/wiki/%E9%85%8D%E7%BD%AE #配置监控应用的名称 AppName=MyApp #MetricsProcessor类型, #0:以标准格式化结构输出到stdout.log #1:以标准格式化结构输出到磁盘 #2:以InfluxDB LineProtocol格式输出到磁盘 MetricsProcessorType=1 #配置各项监控指标日志的文件路径 #如果 MetricsProcessorType 配置为 2,建议把所有的 MetricsFile 路径配置成一样以方便 Telegraf 收集 MethodMetricsFile=/data/logs/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 BufPoolMetricsFile=/data/logs/MyPerf4J/buf_pool_metrics ThreadMetricsFile=/data/logs/MyPerf4J/thread_metrics.log FileDescMetricsFile=/data/logs/MyPerf4J/file_desc_metrics.log CompilationMetricsFile=/data/logs/MyPerf4J/compilation_metrics.log #配置日志文件滚动时间间隔,分别有MINUTELY、HOURLY和DAILY三个值 LogRollingTimeUnit=DAILY #配置历史日志文件保留个数 LogReserveCount=7 #配置Recorder模式,可配置为accurate/rough RecorderMode=accurate #配置Recorders转盘的数量 BackupRecordersCount=1 #配置时间片,单位为ms,最小1s,最大600s MilliTimeSlice=30000 #是否展示方法参数类型 ShowMethodParams=true #配置 Java类的层级映射关系 #规则为:LevelA:[classNameExpA1,classNameExpA2];LevelB:[classNameExpB1,classNameExpB2]; ClassLevelMapping=Controller:[*Controller];Api:[*Api,*ApiImpl]; #需要监控的package,可配置多个,用英文';'分隔 #com.demo.p1 代表包含以 com.demo.p1 为前缀的所有包和类 #[] 表示集合的概念:例如,com.demo.[p1,p2,p3] 代表包含以 com.demo.p1、com.demo.p2 和 com.demo.p3 为前缀的所有包和类,等价于 com.demo.p1;com.demo.p2;com.demo.p3 #* 表示通配符:可以指代零个或多个字符,例如,com.*.demo.* IncludePackages=cn.perf4j.demo;cn.perf4j.demo1.[p1,p2,p3];cn.*.demo.*; #不需要监控的package,可配置多个,用英文';'分隔 ExcludePackages=org.spring; #配置不需要进行监控的方法名,每个方法名用英文 ';' 分隔 #ExcludeMethods=getId1 代表排除所有方法名为 getId1 的方法 #ExcludeMethods=DemoServiceImpl.getId1 代表排除类 DemoServiceImpl 中所有方法名为 getId1 的方法 #ExcludeMethods=DemoServiceImpl.getId1(long) 代表排除类 DemoServiceImpl 中方法签名为 getId1(long) 的方法 ExcludeMethods=getId1;DemoServiceImpl.getId2;DemoServiceImpl.getId3(long) #是否排除私有方法,true/false ExcludePrivateMethod=true #可配置多个ClassLoader,用英文';'分隔 ExcludeClassLoaders= #是否开启debug日志,可配置为true/false Debug.PrintDebugLog=false #指定配置文件路径,该配置文件通过指定某些方法执行时间阈值来进行内存占用调优 ProfilingParamsFile= #指定通用的方法执行时间阈值,单位为ms ProfilingTimeThreshold=1000 #指定一个时间片内,超过方法执行时间阈值的次数,仅在RecorderMode=accurate时有效 ProfilingOutThresholdCount=16