Skip to content

3.x Configuration

LinShunKang edited this page Jul 13, 2024 · 5 revisions

MyPerf4J provides the following Attribute by default to control the behavior of MyPerf4J:

Attribute Type Required Default Value Description
app_name String Yes Configure application name
debug boolean No false Configure debug mode, true/false
http.server.port int No 2048,2000,2040 Configure Http server port,format:preferPort,minBackupPort,maxBackupPort
http.server.min_workers int No 1 Configure Http server min work count
http.server.max_workers int No 2 Configure Http server max work count
http.server.accept_count int No 1024
Configure the maximum number of queued requests for the Http server
metrics.exporter String No log.stdout Configure MetricsExporter type, log.stdout:Output to stdout.log in a standard formatted structure; log.standard:Output to disk in standard formatted structure; log.influxdb:Output to disk in InfluxDB LineProtocol format; http.influxdb:Output to InfluxDB server in InfluxDB LineProtocol format; need configure influxdb configurations
metrics.log.method String No /data/logs/MyPerf4J/metrics.log Configure the log path of the Method Metrics. If the value is NULL, the collected MethodMetrics are discarded
metrics.log.class_loading String No NULL Configure the log path of the Class Loading Metrics. If the value is NULL, the collected Class Load Metrics are discarded
metrics.log.gc String No NULL Configure the log path of the GC Metrics. If the value is NULL, the collected GC Metrics are discarded
metrics.log.memory String No NULL Configure the log path of the Memory Metrics. If the value is NULL, the collected Memory Metrics are discarded
metrics.log.buff_pool String No NULL Configure the log path of the BufferPool Metrics. If the value is NULL, the collected BufferPool Metrics are discarded
metrics.log.thread String No NULL Configure the log path of the Thread Metrics. If the value is NULL, the collected ThreadMetrics are discarded
metrics.log.file_desc String No NULL Configure the log path of the FileDescriptor Metrics. If the value is NULL, the collected ThreadMetrics are discarded
metrics.log.compilation String No NULL Configure the log path of the Compilation Metrics. If the value is NULL, the collected ThreadMetrics are discarded
metrics.log.rolling.time_unit String No DAILY Configure the log file scrolling interval, which has three values: MINUTELY, HOURLY, and DAILY
metrics.log.reserve.count int No 7 Configure the number of historical log files to keep
metrics.time_slice.method int No 60000 Configure Method Metrics TimeSlice, time unit: ms, min:1s, max:600s
metrics.time_slice.jvm int No 60000 Configure JVM Metrics TimeSlice, time unit: ms, min:1s, max:600s
metrics.method.show_params boolean No false Config show method params type
metrics.method.class_level_mapping String No "" Config Class level mapping
recorder.size.timing_arr int No 1000
recorder.size.timing_map int No 16
recorders.backup_count Int No 1
filter.packages.include String Yes Configure packages to injects,separated with ';'
filter.packages.exclude String No "" Configure packages not to injects,separated with ';'
filter.methods.exclude String No "" Configure methods not to injects,separated with ';'
filter.methods.exclude_private boolean No true Configure not to injects private methods,separated with ';'true/false
filter.class_loaders.exclude String No "" Configure classloaders not to injects,separated with ';'
influxdb.version String No 1.0 Configure InfluxDB's version
influxdb.orgName String No "" Configure InfluxDB's organization, required when InfluxDB is v2.x
influxdb.host String No 127.0.0.1 Configure InfluxDB host
influxdb.port int No 8086 Configure InfluxDB port
influxdb.database String No "" Configure InfluxDB databse
influxdb.username String No "" Configure InfluxDB username
influxdb.password String No "" Configure InfluxDB password
influxdb.conn_timeout int No 3000 Configure InfluxDB connection timeout, unit: ms
influxdb.read_timeout int No 5000 Configure InfluxDB read timeout, unit: ms

About package rule

filter.packages.include and filter.packages.exclude currently support the following three rules:

  • com.demo.p1 represents all packages and classes prefixed with com.demo.p1
  • [] represents the concept of a set: for example, com.demo.[p1,p2,p3] means to include com.demo.p1, com.demo.p2 and com.demo.p3 All packages and classes prefixed with are equivalent to com.demo.p1;com.demo.p2;com.demo.p3
  • * means wildcard: it can refer to zero or more characters, for example, com.*.demo.*

About the usage rules of filter.methods.exclude

filter.methods.exclude currently supports the following three rules:

  • filter.methods.exclude = getId1 means to exclude all methods whose method name is getId1
  • filter.methods.exclude = DemoServiceImpl.getId1 means to exclude all methods named getId1 in the class DemoServiceImpl
  • filter.methods.exclude = DemoServiceImpl.getId1(long) means to exclude methods in the class DemoServiceImpl whose method signature is getId1(long)

About the usage rules of metrics.method.class_level_mapping

metrics.method.class_level_mapping is used to configure the class level mapping relationship, the format is: LevelA:[classNameExpA1,classNameExpA2];LevelB:[classNameExpB1,classNameExpB2], with metrics.method.class_level_mapping = Api:[*Api, *ApiImpl];Controller:[*Controller];As an example:

  • Api:[*Api,*ApiImpl] means all classes ending in Api and ApiImpl have Api level
  • Controller:[*Controller] means that the level of all classes ending with Controller is Controller
Clone this wiki locally