Skip to content

Commit

Permalink
More replacements of cachebench with radargun
Browse files Browse the repository at this point in the history
  • Loading branch information
maniksurtani committed Dec 8, 2010
1 parent f704234 commit 0f800b0
Show file tree
Hide file tree
Showing 91 changed files with 291 additions and 311 deletions.
4 changes: 2 additions & 2 deletions bin/detect_slave_ips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ then
exit 1
fi
echo ""
echo "=== Cache Benchmark Framework ==="
echo "=== RadarGun ==="
echo " This script is to be used on environments where slave nodes are provisioned via PXE boot"
echo " and a master provides this PXE image and also acts as a DHCP server. This script should"
echo " *only* be run on the master, and it will attempt to detect the slave nodes' IP addresses"
Expand Down Expand Up @@ -69,7 +69,7 @@ fi
grep "^lease " $dhcp_leases_file | sed -e "s/^lease //g" -e "s/ {.*$//g" > /tmp/ip_address_guesses

echo "" >> /etc/hosts
echo "#### GENERATED BY CacheBenchFwk" >> /etc/hosts
echo "#### GENERATED BY RadarGun" >> /etc/hosts
echo "" >> /etc/hosts

./unique_ips.py /tmp/ip_address_guesses $SLAVE_PREFIX > /tmp/slave_addresses
Expand Down
2 changes: 1 addition & 1 deletion bin/ssh_key_acceptor.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

echo ""
echo "=== Cache Benchmark Framework ==="
echo "=== RadarGun ==="
echo " This script is to be used on environments where slave nodes are provisioned via PXE boot"
echo " and a master provides this PXE image and also acts as a DHCP server. This script should"
echo " *only* be run on the master, to SSH into each slave and 'accept' its SSH key."
Expand Down
Binary file removed extras/cbf_logo.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package org.cachebench;
package org.radargun;


/**
* CacheWrappers wrap cacheing products tp provide the cachebench framework with a standard way of
* CacheWrappers wrap caching products tp provide RadarGun with a standard way of
* accessing and manipulating a cache.
*
* @author Manik Surtani ([email protected])
* @version $Id: CacheWrapper.java,v 1.5 2007/05/17 08:13:45 msurtani Exp $
*/
public interface CacheWrapper
{
/**
* Initialises the cache. Typically this step will configure the
* cacheing product with various params passed in, described in
* cachebench.xml for a particular cacheing product, which is
* benchmark.xml for a particular cacheing product, which is
* usually the name or path to a config file specific to the
* cacheing product being tested.
*
Expand All @@ -33,7 +32,7 @@ public interface CacheWrapper
* as a black box, and is what is timed, so it should be implemented in the most efficient (or most
* realistic) way possible.
*
* @param bucket a bucket is a group of keys. Some implementations might ignore the bucket (e.g. {@link org.cachebench.cachewrappers.InfinispanWrapper}}
* @param bucket a bucket is a group of keys. Some implementations might ignore the bucket (e.g. {@link org.radargun.cachewrappers.InfinispanWrapper}}
* so in order to avoid key collisions, one should make sure that the keys are unique even between different buckets.
* @param key
* @param value
Expand All @@ -46,7 +45,7 @@ public interface CacheWrapper
Object get(String bucket, Object key) throws Exception;

/**
* This is called after each test type (if emptyCacheBetweenTests is set to true in cachebench.xml) and is
* This is called after each test type (if emptyCacheBetweenTests is set to true in benchmark.xml) and is
* used to flush the cache.
*/
void empty() throws Exception;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cachebench;
package org.radargun;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cachebench;
package org.radargun;

import org.cachebench.state.SlaveState;
import org.cachebench.state.MasterState;
import org.radargun.state.SlaveState;
import org.radargun.state.MasterState;

import java.io.Serializable;
import java.util.List;
Expand All @@ -23,7 +23,7 @@ public interface DistStage extends Stage, Serializable {
public void setActiveSlavesCount(int activeSlaves);

/**
* Do whatever on the slave. This will only be called after {@link #initOnSlave(org.cachebench.state.SlaveState)} is called.
* Do whatever on the slave. This will only be called after {@link #initOnSlave(org.radargun.state.SlaveState)} is called.
* @return an response that will be serialized and send back to the master.
*/
DistStageAck executeOnSlave();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cachebench;
package org.radargun;

import java.io.Serializable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.cachebench;
package org.radargun;


import org.cachebench.config.ConfigParser;
import org.cachebench.config.MasterConfig;
import org.radargun.config.ConfigParser;
import org.radargun.config.MasterConfig;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.cachebench;
package org.radargun;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.cachebench.config.MasterConfig;
import org.cachebench.state.MasterState;
import org.radargun.config.MasterConfig;
import org.radargun.state.MasterState;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.cachebench;
package org.radargun;

import org.cachebench.state.MasterState;
import org.radargun.state.MasterState;

/**
* A master stage is a stage that only gets executed on the master. E.g. report generation is suitable for being a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cachebench;
package org.radargun;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cachebench;
package org.radargun;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.cachebench;
package org.radargun;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.cachebench.state.SlaveState;
import org.radargun.state.SlaveState;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cachebench;
package org.radargun;

/**
* A stage is a step in the benchmark process. E.g. of stages are starting cache wrapper, warmup, run actual test etc.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.cachebench;
package org.radargun;

public class Version {
private static final String ver = "1.1.0-SNAPSHOT";
public static void main(String[] args) {
System.out.println("=== CacheBenchFwk ===");
System.out.println(" version: " + ver);
System.out.println("=== RadarGun ===");
System.out.println("");
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cachebench.config;
package org.radargun.config;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cachebench.config;
package org.radargun.config;

/**
* Abstracts the logic of parsing an configuration file.
Expand All @@ -10,7 +10,7 @@ public abstract class ConfigParser {
public abstract MasterConfig parseConfig(String config) throws Exception;

public static ConfigParser getConfigParser() {
if (System.getProperties().contains("cachebench.oldLauncher")) {
if (System.getProperties().contains("radargun.oldLauncher")) {
return new JaxbConfigParser();
}
return new DomConfigParser();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.cachebench.config;
package org.radargun.config;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Attr;
import org.cachebench.stages.GenerateChartStage;
import org.cachebench.stages.StartClusterStage;
import org.cachebench.Master;
import org.cachebench.Stage;
import org.radargun.stages.GenerateChartStage;
import org.radargun.stages.StartClusterStage;
import org.radargun.Master;
import org.radargun.Stage;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.cachebench.config;
package org.radargun.config;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.cachebench.DistStage;
import org.cachebench.Stage;
import org.cachebench.utils.Utils;
import org.radargun.DistStage;
import org.radargun.Stage;
import org.radargun.utils.Utils;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -14,7 +14,7 @@
* such a benchmark.
*
* @author [email protected]
* @see org.cachebench.config.ScalingBenchmarkConfig
* @see org.radargun.config.ScalingBenchmarkConfig
*/
public class FixedSizeBenchmarkConfig implements Cloneable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.cachebench.config;
package org.radargun.config;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.cachebench.Master;
import org.cachebench.config.jaxb.BenchConfig;
import org.cachebench.config.jaxb.FixedSizeBenchmark;
import org.cachebench.config.jaxb.Property;
import org.cachebench.config.jaxb.ScalingBenchmark;
import org.cachebench.config.jaxb.Stage;
import org.radargun.Master;
import org.radargun.config.jaxb.BenchConfig;
import org.radargun.config.jaxb.FixedSizeBenchmark;
import org.radargun.config.jaxb.Property;
import org.radargun.config.jaxb.ScalingBenchmark;
import org.radargun.config.jaxb.Stage;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
Expand All @@ -31,14 +31,14 @@ public class JaxbConfigParser extends ConfigParser {


public MasterConfig parseConfig(String config) throws Exception {
JAXBContext jc = JAXBContext.newInstance("org.cachebench.config.jaxb");
JAXBContext jc = JAXBContext.newInstance("org.radargun.config.jaxb");
Unmarshaller unmarshaller = jc.createUnmarshaller();
BenchConfig benchConfig = (BenchConfig) unmarshaller.unmarshal(new File(config));
return getMasterConfig(benchConfig);
}

private MasterConfig getMasterConfig(BenchConfig benchConfig) {
org.cachebench.config.jaxb.Master master = benchConfig.getMaster();
org.radargun.config.jaxb.Master master = benchConfig.getMaster();
int port = master.getPort() != null ? toInt(master.getPort()) : Master.DEFAULT_PORT;
MasterConfig masterConfig = new MasterConfig(port, master.getBind(), toInt(master.getSlavesCount()));
for (ScalingBenchmark sb : benchConfig.getScalingBenchmark()) {
Expand Down Expand Up @@ -70,11 +70,11 @@ private MasterConfig getMasterConfig(BenchConfig benchConfig) {
return masterConfig;
}

private List<org.cachebench.Stage> processStages(List<Stage> stagesFromXml) {
List<org.cachebench.Stage> result = new ArrayList<org.cachebench.Stage>();
private List<org.radargun.Stage> processStages(List<Stage> stagesFromXml) {
List<org.radargun.Stage> result = new ArrayList<org.radargun.Stage>();
for (Stage stage : stagesFromXml) {
List<Property> list = stage.getProperty();
org.cachebench.Stage st = getStage(stage.getName());
org.radargun.Stage st = getStage(stage.getName());
Map<String, String> simpleProps = new HashMap<String, String>();
Map<String, Map> aggregatedProps = new HashMap<String, Map>();
for (Property prop : list) {
Expand All @@ -96,7 +96,7 @@ private List<org.cachebench.Stage> processStages(List<Stage> stagesFromXml) {
return result;
}

private void setAggregatedValues(org.cachebench.Stage st, Map<String, Map> aggregatedProps) {
private void setAggregatedValues(org.radargun.Stage st, Map<String, Map> aggregatedProps) {
for (String propName : aggregatedProps.keySet()) {
String setterName = "set" + propName.substring(0, 1).toUpperCase() + propName.substring(1);
Method method;
Expand All @@ -117,12 +117,12 @@ private void setAggregatedValues(org.cachebench.Stage st, Map<String, Map> aggre
}


public static org.cachebench.Stage getStage(String stageName) {
public static org.radargun.Stage getStage(String stageName) {
if (stageName.indexOf('.') < 0) {
stageName = "org.cachebench.stages." + stageName;
stageName = "org.radargun.stages." + stageName;
}
try {
return (org.cachebench.Stage) Class.forName(stageName).newInstance();
return (org.radargun.Stage) Class.forName(stageName).newInstance();
} catch (Exception e) {
String s = "Could not create stage of type: " + stageName;
log.error(s);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cachebench.config;
package org.radargun.config;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package org.cachebench.config;
package org.radargun.config;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


import org.cachebench.Stage;
import org.radargun.Stage;

import java.util.List;
import java.util.ArrayList;

/**
* A scaling benchmark is one that executes on an increasing number of slaves. E.g. consdering the {@link
* org.cachebench.stages.WebSessionBenchmarkStage}, one might want to execute it over multiple clusteres of
* org.radargun.stages.WebSessionBenchmarkStage}, one might want to execute it over multiple clusteres of
* different sizes: e.g 2,3,4,5..10 etc in order to check how a product scales etc.
*
* @author [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//


package org.cachebench.config.jaxb;
package org.radargun.config.jaxb;

import org.cachebench.config.ConfigHelper;
import org.radargun.config.ConfigHelper;

import javax.xml.bind.annotation.adapters.XmlAdapter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//


package org.cachebench.config.jaxb;
package org.radargun.config.jaxb;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//


package org.cachebench.config.jaxb;
package org.radargun.config.jaxb;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//


package org.cachebench.config.jaxb;
package org.radargun.config.jaxb;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//


package org.cachebench.config.jaxb;
package org.radargun.config.jaxb;

import java.util.ArrayList;
import java.util.List;
Expand Down
Loading

0 comments on commit 0f800b0

Please sign in to comment.