Skip to content

Commit

Permalink
Add maven dependency for JMH framework.
Browse files Browse the repository at this point in the history
In order to provide patch for LANG-1110, required dependcy on JMH lib.
Current commit add benchmark profile and ability to run JMH based benchmark by
executing "mvn test -P benchmark" command, moreover it's also possible to
specify exact benchmark name by running "mvn test -P benchmark
-Dbenchmark=benchmark.full.class.name".
  • Loading branch information
C0rWin committed Feb 12, 2017
1 parent b715d18 commit d38aea4
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions pom.xml
Expand Up @@ -532,6 +532,21 @@
<version>3.4</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<distributionManagement>
Expand Down Expand Up @@ -576,6 +591,10 @@

<!-- Override clirr version to be able to build the site on Java 8 -->
<commons.clirr.version>2.8</commons.clirr.version>

<!-- JMH Benchmark related properties, version, target compiler and name of the benchmarking uber jar. -->
<jmh.version>1.17.4</jmh.version>
<uberjar.name>benchmarks</uberjar.name>
</properties>


Expand Down Expand Up @@ -810,6 +829,57 @@
</plugins>
</build>
</profile>

<profile>
<id>benchmark</id>
<properties>
<skipTests>true</skipTests>
<benchmark>org.apache</benchmark>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerVersion>${maven.compiler.target}</compilerVersion>
<source>${maven.compiler.target}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>benchmark</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<classpathScope>test</classpathScope>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>org.openjdk.jmh.Main</argument>
<argument>-rf</argument>
<argument>json</argument>
<argument>-rff</argument>
<argument>target/jmh-result.${benchmark}.json</argument>
<argument>${benchmark}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

</profiles>

</project>

0 comments on commit d38aea4

Please sign in to comment.