From d4e2e87c9bb9dfe32fa15aea16fc24b86a0fe661 Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Sat, 25 Jul 2015 02:51:34 -0400 Subject: [PATCH] Actually add the profile to run the benchmarks Signed-off-by: Alexandre Montplaisir --- pom.xml | 26 ++++++++++++++- .../jul/handler/DummyHandlerBenchmark.java | 31 ------------------ ...mark.java => JulHandlerBenchmarkBase.java} | 2 +- .../jul/handler/NoHandlerBenchmark.java | 6 ---- .../builtin/DummyHandlerBenchmark.java | 32 +++++++++++++++++++ .../{ => builtin}/FileHandlerBenchmark.java | 5 +-- .../handler/builtin/NoHandlerBenchmark.java | 8 +++++ ...tngJulHandlerTracingDisabledBenchmark.java | 4 +-- ...ttngJulHandlerTracingEnabledBenchmark.java | 4 +-- ...tngJulHandlerTracingDisabledBenchmark.java | 4 +-- ...ttngJulHandlerTracingEnabledBenchmark.java | 4 +-- 11 files changed, 77 insertions(+), 49 deletions(-) delete mode 100644 src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/DummyHandlerBenchmark.java rename src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/{AbstractJulBenchmark.java => JulHandlerBenchmarkBase.java} (98%) delete mode 100644 src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/NoHandlerBenchmark.java create mode 100644 src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/DummyHandlerBenchmark.java rename src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/{ => builtin}/FileHandlerBenchmark.java (76%) create mode 100644 src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/NoHandlerBenchmark.java diff --git a/pom.xml b/pom.xml index e5ec790..fe19978 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 + + 3.0 + + org.lttng.ust.agent lttng-ust-agent-tests 1.0.0 @@ -82,7 +86,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.1 + 3.3 1.8 1.8 @@ -91,4 +95,24 @@ + + + benchmark + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.18.1 + + + **/*Benchmark.java + + + + + + + + diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/DummyHandlerBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/DummyHandlerBenchmark.java deleted file mode 100644 index d962b42..0000000 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/DummyHandlerBenchmark.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.lttng.ust.agent.benchmarks.jul.handler; - -import java.util.logging.Handler; -import java.util.logging.LogRecord; - -import org.junit.Before; - -public class DummyHandlerBenchmark extends AbstractJulBenchmark { - - @Before - public void testSetup() { - handler = new DummyHandler(); - } - - private static class DummyHandler extends Handler { - - public DummyHandler() { - super(); - } - - @Override - public void close() throws SecurityException {} - - @Override - public void flush() {} - - @Override - public void publish(LogRecord record) {} - - } -} diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/AbstractJulBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/JulHandlerBenchmarkBase.java similarity index 98% rename from src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/AbstractJulBenchmark.java rename to src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/JulHandlerBenchmarkBase.java index a089e9d..dbfd331 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/AbstractJulBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/JulHandlerBenchmarkBase.java @@ -10,7 +10,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -public abstract class AbstractJulBenchmark { +public abstract class JulHandlerBenchmarkBase { // ------------------------------------------------------------------------ // Configurable test parameters diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/NoHandlerBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/NoHandlerBenchmark.java deleted file mode 100644 index 424b32e..0000000 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/NoHandlerBenchmark.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.lttng.ust.agent.benchmarks.jul.handler; - -public class NoHandlerBenchmark extends AbstractJulBenchmark { - - /* Do not setup any handler */ -} diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/DummyHandlerBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/DummyHandlerBenchmark.java new file mode 100644 index 0000000..cc867cb --- /dev/null +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/DummyHandlerBenchmark.java @@ -0,0 +1,32 @@ +package org.lttng.ust.agent.benchmarks.jul.handler.builtin; + +import java.util.logging.Handler; +import java.util.logging.LogRecord; + +import org.junit.Before; +import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; + +public class DummyHandlerBenchmark extends JulHandlerBenchmarkBase { + + @Before + public void testSetup() { + handler = new DummyHandler(); + } + + private static class DummyHandler extends Handler { + + public DummyHandler() { + super(); + } + + @Override + public void close() throws SecurityException {} + + @Override + public void flush() {} + + @Override + public void publish(LogRecord record) {} + + } +} diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/FileHandlerBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/FileHandlerBenchmark.java similarity index 76% rename from src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/FileHandlerBenchmark.java rename to src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/FileHandlerBenchmark.java index 167c741..41a8bae 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/FileHandlerBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/FileHandlerBenchmark.java @@ -1,4 +1,4 @@ -package org.lttng.ust.agent.benchmarks.jul.handler; +package org.lttng.ust.agent.benchmarks.jul.handler.builtin; import java.io.IOException; import java.nio.file.Files; @@ -8,8 +8,9 @@ import java.util.logging.SimpleFormatter; import org.junit.After; import org.junit.Before; +import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; -public class FileHandlerBenchmark extends AbstractJulBenchmark { +public class FileHandlerBenchmark extends JulHandlerBenchmarkBase { private Path outputFile; diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/NoHandlerBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/NoHandlerBenchmark.java new file mode 100644 index 0000000..953e5ba --- /dev/null +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/NoHandlerBenchmark.java @@ -0,0 +1,8 @@ +package org.lttng.ust.agent.benchmarks.jul.handler.builtin; + +import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; + +public class NoHandlerBenchmark extends JulHandlerBenchmarkBase { + + /* Do not setup any handler */ +} diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingDisabledBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingDisabledBenchmark.java index 18f84d3..62f7ec5 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingDisabledBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingDisabledBenchmark.java @@ -6,12 +6,12 @@ import java.io.IOException; import org.junit.After; import org.junit.Before; -import org.lttng.ust.agent.benchmarks.jul.handler.AbstractJulBenchmark; +import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; import org.lttng.ust.agent.jul.LttngLogHandler; import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; -public class LttngJulHandlerTracingDisabledBenchmark extends AbstractJulBenchmark { +public class LttngJulHandlerTracingDisabledBenchmark extends JulHandlerBenchmarkBase { private LttngSession session; diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingEnabledBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingEnabledBenchmark.java index 02c7b05..031c26e 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingEnabledBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingEnabledBenchmark.java @@ -6,12 +6,12 @@ import java.io.IOException; import org.junit.After; import org.junit.Before; -import org.lttng.ust.agent.benchmarks.jul.handler.AbstractJulBenchmark; +import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; import org.lttng.ust.agent.jul.LttngLogHandler; import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; -public class LttngJulHandlerTracingEnabledBenchmark extends AbstractJulBenchmark { +public class LttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchmarkBase { private LttngSession session; diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java index 2978fe0..275e33d 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java @@ -5,12 +5,12 @@ import static org.junit.Assert.assertTrue; import org.junit.After; import org.junit.Before; import org.lttng.ust.agent.LTTngAgent; -import org.lttng.ust.agent.benchmarks.jul.handler.AbstractJulBenchmark; +import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; @SuppressWarnings("deprecation") -public class OldLttngJulHandlerTracingDisabledBenchmark extends AbstractJulBenchmark { +public class OldLttngJulHandlerTracingDisabledBenchmark extends JulHandlerBenchmarkBase { private LttngSession session; diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java index c6cc49c..1e2ce4b 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java @@ -8,13 +8,13 @@ import java.lang.reflect.Field; import org.junit.After; import org.junit.Before; import org.lttng.ust.agent.LTTngAgent; -import org.lttng.ust.agent.benchmarks.jul.handler.AbstractJulBenchmark; +import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; import org.lttng.ust.agent.jul.LttngLogHandler; import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; @SuppressWarnings("deprecation") -public class OldLttngJulHandlerTracingEnabledBenchmark extends AbstractJulBenchmark { +public class OldLttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchmarkBase { private LttngSession session; private LttngLogHandler agentHandler; -- 2.34.1