SPL integration into JMH Maven Plugin

Plugin for easy collecting data from JMH benchmarks

License

License

Categories

Categories

Maven Build Tools JMH Application Testing & Monitoring Performance analysis
GroupId

GroupId

cz.cuni.mff.d3s.spl
ArtifactId

ArtifactId

jmh_spl-maven-plugin
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

SPL integration into JMH Maven Plugin
Plugin for easy collecting data from JMH benchmarks
Source Code Management

Source Code Management

https://github.com/SemaiCZE/jmh_spl-maven-plugin/tree/master

Download jmh_spl-maven-plugin

How to add to project

<plugin>
    <groupId>cz.cuni.mff.d3s.spl</groupId>
    <artifactId>jmh_spl-maven-plugin</artifactId>
    <version>1.0.4</version>
</plugin>

Dependencies

compile (5)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 2.0
org.codehaus.plexus : plexus-utils jar 3.0.8
org.apache.maven : maven-core jar 3.0.1
org.openjdk.jmh : jmh-core jar 1.19
org.apache.ivy : ivy jar 2.4.0

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (1)

Group / Artifact Type Version
junit : junit jar 4.8.2

Project Modules

There are no modules declared in this project.

JMH_SPL Maven plugin

This project is Maven plugin for easy integration of benchmarks using JMH with our SPL evaluation engine.

Simplest usage using default configuration in pom.xml snippet:

<plugin>
    <groupId>cz.cuni.mff.d3s.spl</groupId>
    <artifactId>jmh_spl-maven-plugin</artifactId>
    <version>1.0.0</version>
    <executions>
        <execution>
            <goals>
                <goal>spl_annotation</goal>
                <goal>evaluator_fetcher</goal>
                <goal>data_saver</goal>
                <goal>formula_extractor</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Data saver goal

Data_saver goal of this plugin handles saving measured data from benchmarks.jar in JSON format into configured directory. Also, custom revision identifier can be specified.

By default this goal is executed in maven verify phase, because it's after package phase where benchmarks.jar file is created.

For using this plugin goal you need to add these lines into your benchmark project pom.xml:

<plugin>
    <groupId>cz.cuni.mff.d3s.spl</groupId>
    <artifactId>jmh_spl-maven-plugin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <executions>
        <execution>
            <id>Generate data</id>
            <goals>
                <goal>data_saver</goal>
            </goals>
        </execution>
    </executions>
</plugin>

There are several configuring options:

pom.xml property default value description
revisionID data_saver.revision_id last Identifier of current revision. Possibly existing data will be overwriten.
jmhJar data_saver.benchmarks_jar ${project.build.directory}/${uberjar.name}.jar Path to benchmarks.jar generated by JMH build.
resultPath data_saver.result_path ${project.basedir}/measurements/data Path to directory, where are stored measured data in Json format. Will be created if not exists.
additionalOpts data_saver.additional_options "" Arguments which will be directly passed to benchmarks.jar while executing. For example "-v SILENT -foe true"
skip data_saver.skip false Skip goal execution.

You can specify these options from command line with property identifier:

$ mvn clean install -Ddata_saver.revision_id=ver3

Or in pom.xml file like this:

...
</executions>
<configuration>
    <jmhJar>${project.build.directory}/${uberjar.name}.jar</jmhJar>
    <resultPath>${project.basedir}/measurements</resultPath>
</configuration>
...

SPL annotation goal

This goal is used for distribution of SPLFormula annotation for further processing. Default execution phase is generate-sources. SPLFormula.java file is copied to target/generated-sources/spl_annotations/cz/cuni/mff/d3s/spl directory. Compilation CLASSPATH is also altered.

pom.xml snippet of benchmarking project:

<execution>
    <id>Provide SPL annotation</id>
    <goals>
        <goal>spl_annotation</goal>
    </goals>
</execution>

SPL formula extractor goal

This goal extracts SPLFormula annotations from project, parses them and saves them into META-INF/SPLFormulas file. Default execution phase is compile. File format is line based - benchmark name, :, SPL formula.

<execution>
    <id>Parse SPL annotation from sources</id>
    <goals>
        <goal>formula_extractor</goal>
    </goals>
</execution>

Evaluator fetcher goal

This goal fetches spl-evaluation-java JAR from Maven Central Repository.

<execution>
    <id>Fetch evaluator</id>
    <goals>
        <goal>evaluator_fetcher</goal>
    </goals>
</execution>
pom.xml property default value description
evaluatorVersion evaluator_fetcher.version 1.0.0 Version of downloaded JAR.
evaluatorSaveDir evaluator_fetcher.save_dir ${project.basedir}/measurements Path to directory, where the JAR is stored. Will be created if not exists.

Versions

Version
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0