Repository navigation
Writing Custom Plugins
mmarkus edited this page Dec 14, 2010
·
20 revisions
The RadarGun is thought as a generic benchmarking mechanism in which both the benchmark (i.e. the data access pattern used) and the product that needs to be benchmarked are pluggable. This page describes the way in which new products (i.e. plugins, in RadarGun talk) can be added to the framework.
- The first thing to do is to get the source code from GIT (a plugin can also be built based on binaries, but this is the simplest way to do it). In order to do that, refer to "Download source code" section from Build Binaries wiki page.
- Add new product plugin dir. A new folder should be added under /plugins directory. The used naming convention is , e.g. infinispan4, jbosscache3 etc. All the plugin-related stuff will be added under this directory. Important:_' this dir name will identify the product and will be used in configuration files. E.g. in the following snippet from benchmark.xml, both '''coherence3''' and '_infinispan4 correspond to existing plugin directories /plugins/coherence3 and /plugins/infinispan4.
<!-- other stuff here-->
<bench-config>
<products>
<coherence3>
<config name="replicated"/>
<config name="distributed"/>
</coherence3>
<infinispan4>
<config name="repl-sync.xml"/>
<config name="dist-sync.xml"/>
</infinispan4>
</products>
<reports>
<report name="sync-repl">
<item product="infinispan4" config="repl-sync.xml"/>
<item product="coherence3" config="replicated"/>
</report>
</reports>
</bench-config>- Add maven support. It's going to be maven that will do the building and assembly, so maven configuration files will be required. Add pom.xml in the root of the newly created module. Bellow is a snippet of the pom.xml from infinispan4 plugin, annotated with comments
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- this element is mandatory, it links this new module to the framework -->
<parent>
<groupId>org.cachebench</groupId>
<artifactId>cache-benchmark-plugin-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>plugin-infinispan4</artifactId>
<name>Infinispan 4.x plugin for benchmark framework</name>
<!-- this section describe module's dependencies, and should be customised -->
<dependencies>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>After that follow the stept described in the Compile and build distribution section of BuildBinaries.
If it is not for a proprietary clustering solution, we request you to commit back the wrapper to the RadarGun, so that other people can use it for other benchmarks as well. Look here for becoming a contributor.