You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/03/22 16:26:56 UTC

[11/18] logging-log4j2 git commit: SimplePerfTest.sh added options for logging safepoint time, perf stat options

SimplePerfTest.sh added options for logging safepoint time, perf stat options


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/03910c65
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/03910c65
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/03910c65

Branch: refs/heads/LOG4J2-1278-gc-free-logger
Commit: 03910c65bbe08020720d83488654364efeb68e58
Parents: 13aadaa
Author: rpopma <rp...@apache.org>
Authored: Mon Mar 21 17:57:14 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Mon Mar 21 17:57:14 2016 +0900

----------------------------------------------------------------------
 .../log4j/core/async/perftest/SimplePerfTest.sh | 32 +++++++++++++++-----
 1 file changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/03910c65/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
index d2d1efb..8da9902 100755
--- 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
@@ -1,22 +1,38 @@
 #!/bin/sh
-
-if [ $# -ne 1 ]; then
-    echo Usage: $0 version
+if [ $# -eq 0 ]; then
+    echo Usage: $0 api-version core-version
     exit 1
 fi
 
-export MEM_OPTIONS="-Xms128m -Xmx128m"
-export GC_OPTIONS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime"
+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-${1}.jar:disruptor-3.3.4.jar"
-CP="${CP}:${HOME}/Documents/log4j/log4j-core/target/test-classes"
+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"
 
-java ${MEM_OPTIONS} ${GC_OPTIONS} ${LOG4J_OPTIONS} -cp "${CP}" ${MAIN}
+#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}