You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2016/06/18 20:04:22 UTC
logging-log4j2 git commit: Parameterize AsyncAppender with location
benchmark
Repository: logging-log4j2
Updated Branches:
refs/heads/feature/LOG4J2-1430 059df7f57 -> 2e6e143b9
Parameterize AsyncAppender with location benchmark
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2e6e143b
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2e6e143b
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2e6e143b
Branch: refs/heads/feature/LOG4J2-1430
Commit: 2e6e143b96d9795f5e8e7c3538169f3a72b06544
Parents: 059df7f
Author: Matt Sicker <bo...@gmail.com>
Authored: Sat Jun 18 15:04:17 2016 -0500
Committer: Matt Sicker <bo...@gmail.com>
Committed: Sat Jun 18 15:04:17 2016 -0500
----------------------------------------------------------------------
.../AsyncAppenderLog4j2LocationBenchmark.java | 12 ++++++--
...perf5AsyncApndDsrptrWithLoc-noOpAppender.xml | 32 ++++++++++++++++++++
.../perf5AsyncApndXferQWithLoc-noOpAppender.xml | 32 ++++++++++++++++++++
3 files changed, 73 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2e6e143b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2LocationBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2LocationBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2LocationBenchmark.java
index c306ac1..9b96253 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2LocationBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2LocationBenchmark.java
@@ -28,13 +28,12 @@ import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.TearDown;
-import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
-
/**
* Tests Log4j2 Async Appender performance when including caller location information.
*/
@@ -53,9 +52,16 @@ import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
public class AsyncAppenderLog4j2LocationBenchmark {
Logger logger;
+ @Param({
+ "perf5AsyncApndWithLoc-noOpAppender.xml",
+ "perf5AsyncApndDsrptrWithLoc-noOpAppender.xml",
+ "perf5AsyncApndXferQWithLoc-noOpAppender.xml"
+ })
+ public String configFileName;
+
@Setup(Level.Trial)
public void up() {
- System.setProperty("log4j.configurationFile", "perf5AsyncApndWithLoc-noOpAppender.xml");
+ System.setProperty("log4j.configurationFile", configFileName);
logger = LogManager.getLogger(getClass());
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2e6e143b/log4j-perf/src/main/resources/perf5AsyncApndDsrptrWithLoc-noOpAppender.xml
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/resources/perf5AsyncApndDsrptrWithLoc-noOpAppender.xml b/log4j-perf/src/main/resources/perf5AsyncApndDsrptrWithLoc-noOpAppender.xml
new file mode 100644
index 0000000..35c4ecb
--- /dev/null
+++ b/log4j-perf/src/main/resources/perf5AsyncApndDsrptrWithLoc-noOpAppender.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ -->
+<Configuration status="OFF">
+ <Appenders>
+ <CountingNoOp name="NoOp">
+ </CountingNoOp>
+ <Async name="Async" blocking="true" bufferSize="262144" includeLocation="true">
+ <appender-ref ref="NoOp"/>
+ <DisruptorBlockingQueue/>
+ </Async>
+ </Appenders>
+ <Loggers>
+ <Root level="info">
+ <appender-ref ref="Async"/>
+ </Root>
+ </Loggers>
+</Configuration>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2e6e143b/log4j-perf/src/main/resources/perf5AsyncApndXferQWithLoc-noOpAppender.xml
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/resources/perf5AsyncApndXferQWithLoc-noOpAppender.xml b/log4j-perf/src/main/resources/perf5AsyncApndXferQWithLoc-noOpAppender.xml
new file mode 100644
index 0000000..c16984a
--- /dev/null
+++ b/log4j-perf/src/main/resources/perf5AsyncApndXferQWithLoc-noOpAppender.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ -->
+<Configuration status="OFF">
+ <Appenders>
+ <CountingNoOp name="NoOp">
+ </CountingNoOp>
+ <Async name="Async" blocking="true" bufferSize="262144" includeLocation="true">
+ <appender-ref ref="NoOp"/>
+ <LinkedTransferQueue/>
+ </Async>
+ </Appenders>
+ <Loggers>
+ <Root level="info">
+ <appender-ref ref="Async"/>
+ </Root>
+ </Loggers>
+</Configuration>