You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2019/11/22 06:51:22 UTC

[logging-log4j2] branch release-2.x updated: Fixing travis build

This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new 30ccb98  Fixing travis build
30ccb98 is described below

commit 30ccb98fa544da0972f235f0b61cbc2adc80b3c9
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Thu Nov 21 23:51:07 2019 -0700

    Fixing travis build
---
 log4j-perf/pom.xml                                                | 8 +-------
 .../apache/logging/log4j/perf/jmh/LoggingDisabledBenchmark.java   | 8 ++++++--
 .../org/apache/logging/log4j/perf/jmh/ReflectionBenchmark.java    | 2 +-
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/log4j-perf/pom.xml b/log4j-perf/pom.xml
index 838fdbc..03f6a6a 100644
--- a/log4j-perf/pom.xml
+++ b/log4j-perf/pom.xml
@@ -42,7 +42,6 @@
     <javac.target>1.7</javac.target>
     <uberjar.name>benchmarks</uberjar.name>
     <revapi.skip>true</revapi.skip>
-    <newrelic.agent.version>4.8.0</newrelic.agent.version>
   </properties>
 
   <dependencies>
@@ -58,11 +57,6 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>com.newrelic.agent.java</groupId>
-      <artifactId>newrelic-api</artifactId>
-      <version>${newrelic.agent.version}</version>
-    </dependency>
-    <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-api</artifactId>
     </dependency>
@@ -168,7 +162,7 @@
         <configuration>
           <toolchains>
             <jdk>
-              <version>9</version>
+              <version>[9, )</version>
             </jdk>
           </toolchains>
         </configuration>
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggingDisabledBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggingDisabledBenchmark.java
index 538c1ae..0f8805c 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggingDisabledBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggingDisabledBenchmark.java
@@ -31,7 +31,7 @@ import org.openjdk.jmh.annotations.State;
 import org.openjdk.jmh.annotations.TearDown;
 import org.slf4j.LoggerFactory;
 
-import com.newrelic.api.agent.Trace;
+//import com.newrelic.api.agent.Trace;
 
 /**
  * Benchmark logging with logging disabled.
@@ -90,12 +90,16 @@ public class LoggingDisabledBenchmark {
     public void baseline() {
     }
 
+    /*
+      This benchmark tests the overhead of NewRelic on method calls. It is commented out so
+      that we don't have to include the dependency during a "normal" build. Uncomment and add
+      the New Relic Agent client dependency if you would like to test this.
     @Benchmark
     @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS)
     @Trace(dispatcher = true)
     public void log4j2NewRelic() {
         log4j2Logger.debug("This won't be logged");
-    }
+    } */
 
     @Benchmark
     @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS)
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ReflectionBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ReflectionBenchmark.java
index d1fb6f6..3adb5db 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ReflectionBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ReflectionBenchmark.java
@@ -42,7 +42,7 @@ import org.openjdk.jmh.annotations.State;
  * </p>
  *
  * <pre>
- *     T
+ *     java -jar benchmarks.jar ".*ReflectionBenchmark.*" -i 5 -f 1 -wi 5 -bm Throughput -tu ms
  * </pre>
  */
 public class ReflectionBenchmark {