Repository: logging-log4j2 Updated Branches: refs/heads/master 0754292b6 -> 5fff529bc
LOG4J2-1297 moved perf test scripts to log4j-core/src/test/resources/perf Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5fff529b Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5fff529b Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5fff529b Branch: refs/heads/master Commit: 5fff529bc9b36c721a880b1a788cfa9a3db84edb Parents: 0754292 Author: rpopma <[email protected]> Authored: Sun May 8 14:31:35 2016 +0900 Committer: rpopma <[email protected]> Committed: Sun May 8 14:31:35 2016 +0900 ---------------------------------------------------------------------- .../core/async/perftest/SimplePerfTest.bat | 47 ---------------- .../log4j/core/async/perftest/SimplePerfTest.sh | 57 -------------------- .../src/test/resources/perf/SimplePerfTest.bat | 47 ++++++++++++++++ .../src/test/resources/perf/SimplePerfTest.sh | 57 ++++++++++++++++++++ .../src/test/resources/perf/runResponseTm.sh | 43 +++++++++++++++ 5 files changed, 147 insertions(+), 104 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5fff529b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimplePerfTest.bat ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimplePerfTest.bat b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimplePerfTest.bat deleted file mode 100644 index d6ca9ec..0000000 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimplePerfTest.bat +++ /dev/null @@ -1,47 +0,0 @@ -@echo off -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. - -REM reject if no arg supplied -IF %1.==. echo Usage: %0 version [core-version] & exit /b -IF %2.==. set %2=%1 - -set GC_OPTIONS= -:set GC_OPTIONS=-XX:+UnlockDiagnosticVMOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -:set GC_OPTIONS=-XX:+PrintCompilation - -set LOG4J_OPTIONS= -set LOG4J_OPTIONS=-Dlog4j.configurationFile=perf-CountingNoOpAppender.xml -:set LOG4J_OPTIONS=-Dlog4j.configurationFile=perf3PlainNoLoc.xml -set LOG4J_OPTIONS=%LOG4J_OPTIONS% -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -:set LOG4J_OPTIONS=%LOG4J_OPTIONS% -Dlog4j2.enable.threadlocals=true -:set LOG4J_OPTIONS=%LOG4J_OPTIONS% -DAsyncLogger.WaitStrategy=Yield -:set LOG4J_OPTIONS=%LOG4J_OPTIONS% -DAsyncLogger.RingBufferSize=262144 - -REM Java Flight Recorder settings: %JAVA_HOME%jre\lib\jfr\default.jfc -REM Tip: set all 3 settings for "allocation-profiling-enabled" to true -set JFR_OPTIONS= -set JFR_OPTIONS=-XX:+UnlockCommercialFeatures -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -XX:+FlightRecorder -set JFR_OPTIONS=%JFR_OPTIONS% -XX:StartFlightRecording=duration=60s,filename=log4j-%1.jfr - -set CP= -set CP=log4j-api-%1.jar;log4j-core-%1.jar;disruptor-3.3.4.jar;log4j-1.2.17.jar;slf4j-api-1.7.13.jar;logback-classic-1.1.3.jar;logback-core-1.1.3.jar -set CP=%CP%;C:\Users\remko\IdeaProjects\logging-log4j2\log4j-core\target\test-classes -:set CP=%CP%;log4j-core-2.6-SNAPSHOT-tests.jar - -set MAIN=org.apache.logging.log4j.core.async.perftest.SimplePerfTest - -@echo on -java -Xms256M -Xmx256M %JFR_OPTIONS% %GC_OPTIONS% %LOG4J_OPTIONS% -cp %CP% %MAIN% http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5fff529b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimplePerfTest.sh ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimplePerfTest.sh b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimplePerfTest.sh deleted file mode 100755 index e7cbcf2..0000000 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimplePerfTest.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -if [ $# -eq 0 ]; then - echo Usage: $0 api-version core-version - exit 1 -fi - -DIR=$HOME -NOW=$(date +%Y%m%d-%H%M%S) - -GC_OPTIONS="-XX:+UnlockDiagnosticVMOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps" -GC_OPTIONS="${GC_OPTIONS} -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime" -GC_OPTIONS="${GC_OPTIONS} -XX:+PrintGCCause -Xloggc:$DIR/gc-$NOW.log" -#GC_OPTIONS="${GC_OPTIONS} -XX:+PrintSafepointStatistics -XX:+LogVMOutput -XX:LogFile=$DIR/safepoint$NOW.log" -GC_OPTIONS= - -# Needs -XX:+UnlockDiagnosticVMOptions (as first VM arg) -#VM_OPTIONS="-XX:+PrintCompilation -XX:+PrintInlining" - -LOG4J_OPTIONS="-Dlog4j.configurationFile=perf-CountingNoOpAppender.xml" -LOG4J_OPTIONS="${LOG4J_OPTIONS} -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector" -LOG4J_OPTIONS="${LOG4J_OPTIONS} -Dlog4j2.enable.threadlocals=true" -LOG4J_OPTIONS="${LOG4J_OPTIONS} -DAsyncLogger.WaitStrategy=Block" -LOG4J_OPTIONS="${LOG4J_OPTIONS} -Dlog4j.format.msg.async=true" -export LOG4J_OPTIONS - -CP="log4j-api-${1}.jar:log4j-core-${2}.jar:disruptor-3.3.4.jar" -CP="${CP}:log4j-core-2.6-SNAPSHOT-tests.jar" -#CP="${CP}:${HOME}/Documents/log4j/log4j-core/target/test-classes" -export CP - -export MEM_OPTIONS="-Xms128m -Xmx128m" -export MAIN="org.apache.logging.log4j.core.async.perftest.SimplePerfTest" - -#PERF_OPTIONS="-e cycles,instructions,cache-references,cache-misses,branches,branch-misses,L1-dcache-loads,L1-dcache-load-misses,dTLB-loads,dTLB-load-misses" -PERF_OPTIONS= -#perf stat ${PERF_OPTIONS} java ${MEM_OPTIONS} ${GC_OPTIONS} ${VM_OPTIONS} ${LOG4J_OPTIONS} -cp "${CP}" ${MAIN} - -java ${MEM_OPTIONS} ${GC_OPTIONS} ${VM_OPTIONS} ${LOG4J_OPTIONS} -cp "${CP}" ${MAIN} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5fff529b/log4j-core/src/test/resources/perf/SimplePerfTest.bat ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/resources/perf/SimplePerfTest.bat b/log4j-core/src/test/resources/perf/SimplePerfTest.bat new file mode 100644 index 0000000..d6ca9ec --- /dev/null +++ b/log4j-core/src/test/resources/perf/SimplePerfTest.bat @@ -0,0 +1,47 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +REM reject if no arg supplied +IF %1.==. echo Usage: %0 version [core-version] & exit /b +IF %2.==. set %2=%1 + +set GC_OPTIONS= +:set GC_OPTIONS=-XX:+UnlockDiagnosticVMOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime +:set GC_OPTIONS=-XX:+PrintCompilation + +set LOG4J_OPTIONS= +set LOG4J_OPTIONS=-Dlog4j.configurationFile=perf-CountingNoOpAppender.xml +:set LOG4J_OPTIONS=-Dlog4j.configurationFile=perf3PlainNoLoc.xml +set LOG4J_OPTIONS=%LOG4J_OPTIONS% -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector +:set LOG4J_OPTIONS=%LOG4J_OPTIONS% -Dlog4j2.enable.threadlocals=true +:set LOG4J_OPTIONS=%LOG4J_OPTIONS% -DAsyncLogger.WaitStrategy=Yield +:set LOG4J_OPTIONS=%LOG4J_OPTIONS% -DAsyncLogger.RingBufferSize=262144 + +REM Java Flight Recorder settings: %JAVA_HOME%jre\lib\jfr\default.jfc +REM Tip: set all 3 settings for "allocation-profiling-enabled" to true +set JFR_OPTIONS= +set JFR_OPTIONS=-XX:+UnlockCommercialFeatures -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -XX:+FlightRecorder +set JFR_OPTIONS=%JFR_OPTIONS% -XX:StartFlightRecording=duration=60s,filename=log4j-%1.jfr + +set CP= +set CP=log4j-api-%1.jar;log4j-core-%1.jar;disruptor-3.3.4.jar;log4j-1.2.17.jar;slf4j-api-1.7.13.jar;logback-classic-1.1.3.jar;logback-core-1.1.3.jar +set CP=%CP%;C:\Users\remko\IdeaProjects\logging-log4j2\log4j-core\target\test-classes +:set CP=%CP%;log4j-core-2.6-SNAPSHOT-tests.jar + +set MAIN=org.apache.logging.log4j.core.async.perftest.SimplePerfTest + +@echo on +java -Xms256M -Xmx256M %JFR_OPTIONS% %GC_OPTIONS% %LOG4J_OPTIONS% -cp %CP% %MAIN% http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5fff529b/log4j-core/src/test/resources/perf/SimplePerfTest.sh ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/resources/perf/SimplePerfTest.sh b/log4j-core/src/test/resources/perf/SimplePerfTest.sh new file mode 100644 index 0000000..e7cbcf2 --- /dev/null +++ b/log4j-core/src/test/resources/perf/SimplePerfTest.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +if [ $# -eq 0 ]; then + echo Usage: $0 api-version core-version + exit 1 +fi + +DIR=$HOME +NOW=$(date +%Y%m%d-%H%M%S) + +GC_OPTIONS="-XX:+UnlockDiagnosticVMOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps" +GC_OPTIONS="${GC_OPTIONS} -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime" +GC_OPTIONS="${GC_OPTIONS} -XX:+PrintGCCause -Xloggc:$DIR/gc-$NOW.log" +#GC_OPTIONS="${GC_OPTIONS} -XX:+PrintSafepointStatistics -XX:+LogVMOutput -XX:LogFile=$DIR/safepoint$NOW.log" +GC_OPTIONS= + +# Needs -XX:+UnlockDiagnosticVMOptions (as first VM arg) +#VM_OPTIONS="-XX:+PrintCompilation -XX:+PrintInlining" + +LOG4J_OPTIONS="-Dlog4j.configurationFile=perf-CountingNoOpAppender.xml" +LOG4J_OPTIONS="${LOG4J_OPTIONS} -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector" +LOG4J_OPTIONS="${LOG4J_OPTIONS} -Dlog4j2.enable.threadlocals=true" +LOG4J_OPTIONS="${LOG4J_OPTIONS} -DAsyncLogger.WaitStrategy=Block" +LOG4J_OPTIONS="${LOG4J_OPTIONS} -Dlog4j.format.msg.async=true" +export LOG4J_OPTIONS + +CP="log4j-api-${1}.jar:log4j-core-${2}.jar:disruptor-3.3.4.jar" +CP="${CP}:log4j-core-2.6-SNAPSHOT-tests.jar" +#CP="${CP}:${HOME}/Documents/log4j/log4j-core/target/test-classes" +export CP + +export MEM_OPTIONS="-Xms128m -Xmx128m" +export MAIN="org.apache.logging.log4j.core.async.perftest.SimplePerfTest" + +#PERF_OPTIONS="-e cycles,instructions,cache-references,cache-misses,branches,branch-misses,L1-dcache-loads,L1-dcache-load-misses,dTLB-loads,dTLB-load-misses" +PERF_OPTIONS= +#perf stat ${PERF_OPTIONS} java ${MEM_OPTIONS} ${GC_OPTIONS} ${VM_OPTIONS} ${LOG4J_OPTIONS} -cp "${CP}" ${MAIN} + +java ${MEM_OPTIONS} ${GC_OPTIONS} ${VM_OPTIONS} ${LOG4J_OPTIONS} -cp "${CP}" ${MAIN} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5fff529b/log4j-core/src/test/resources/perf/runResponseTm.sh ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/resources/perf/runResponseTm.sh b/log4j-core/src/test/resources/perf/runResponseTm.sh new file mode 100644 index 0000000..3953a41 --- /dev/null +++ b/log4j-core/src/test/resources/perf/runResponseTm.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +NOW=$(date +%Y%m%d-%H%M%S) + +GC_OPTIONS="-XX:+UnlockDiagnosticVMOptions -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime" +#GC_OPTIONS="${GC_OPTIONS} -XX:GuaranteedSafepointInterval=500000" +GC_OPTIONS="${GC_OPTIONS} -XX:+PrintGCCause -XX:+PrintSafepointStatistics -XX:+LogVMOutput -XX:LogFile=safepoint$NOW.log" +COMPILE_OPTIONS="-XX:CompileCommand=dontinline,org.apache.logging.log4j.core.async.perftest.NoOpIdleStrategy::idle" + +#VM_OPTIONS="-XX:+UnlockDiagnosticVMOptions -XX:+PrintCompilation -XX:+PrintInlining" + +LOG4J_OPTIONS= +#LOG4J_OPTIONS="-Dlog4j.configurationFile=perf-CountingNoOpAppender.xml" +#LOG4J_OPTIONS="-Dlog4j.configurationFile=perf3PlainNoLoc.xml" +#LOG4J_OPTIONS="-Dlog4j.configurationFile=perf7MixedNoLoc.xml" +LOG4J_OPTIONS="-Dlog4j.configurationFile=perf5AsyncApndNoLoc.xml" + +#LOG4J_OPTIONS="-Dlog4j.configuration=perf-log4j12.xml" +#LOG4J_OPTIONS="-Dlog4j.configuration=perf-log4j12-async.xml" +#LOG4J_OPTIONS="-Dlogback.configurationFile=perf-logback-async.xml" +#LOG4J_OPTIONS="-Dlogback.configurationFile=perf-logback.xml" + +#LOG4J_OPTIONS="${LOG4J_OPTIONS} -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector" +LOG4J_OPTIONS="${LOG4J_OPTIONS} -Dlog4j2.enable.threadlocals=true" +LOG4J_OPTIONS="${LOG4J_OPTIONS} -Dlog4j2.enable.direct.encoders=true" +LOG4J_OPTIONS="${LOG4J_OPTIONS} -DAsyncLogger.WaitStrategy=busySpin" +LOG4J_OPTIONS="${LOG4J_OPTIONS} -DAsyncLoggerConfig.WaitStrategy=busySpin" +#LOG4J_OPTIONS="${LOG4J_OPTIONS} -Dlog4j.format.msg.async=true" +export LOG4J_OPTIONS + +CP=".:HdrHistogram-2.1.8.jar:disruptor-3.3.4.jar:log4j-1.2.17.jar:slf4j-api-1.7.21.jar:slf4j-ext-1.7.21.jar:logback-core-1.1.7.jar:logback-classic-1.1.7.jar:log4j-api-2.6-SNAPSHOT.jar:log4j-core-2.6-SNAPSHOT.jar:log4j-core-2.6-SNAPSHOT-tests.jar" + +RUNNER=RunLog4j2 +RESULTDIR=ApndLog4j2 +java -Xms1G -Xmx1G $GC_OPTIONS $COMPILE_OPTIONS $VM_OPTIONS $JFR_OPTIONS $LOG4J_OPTIONS -cp $CP org.apache.logging.log4j.core.async.perftest.ResponseTimeTest 1 10000 $RUNNER +java -Xms1G -Xmx1G $GC_OPTIONS $COMPILE_OPTIONS $VM_OPTIONS $JFR_OPTIONS $LOG4J_OPTIONS -cp $CP org.apache.logging.log4j.core.async.perftest.ResponseTimeTest 2 5000 $RUNNER +java -Xms1G -Xmx1G $GC_OPTIONS $COMPILE_OPTIONS $VM_OPTIONS $JFR_OPTIONS $LOG4J_OPTIONS -cp $CP org.apache.logging.log4j.core.async.perftest.ResponseTimeTest 4 2500 $RUNNER +mkdir async$RESULTDIR-10k +mv *k? async$RESULTDIR-10k +mv nohup.out async$RESULTDIR-10k +mv safepoint$NOW.log async$RESULTDIR-10k + +
