com.thoughtworks.xstream.tools.benchmark
Class Harness

java.lang.Object
  extended bycom.thoughtworks.xstream.tools.benchmark.Harness

public class Harness
extends Object

A simple harness for running benchmarks over object serialization products.

There are three dimensions that can be added:

The Harness will then across every permuation of these (in order of product, metric, target), and write the results to a Reporter.

Example usage

 Harness harness = new Harness();

 // Compare speed of serialization/deserialization metrics...
 harness.addMetric(new SerializationSpeedMetric());
 harness.addMetric(new DeserializationSpeedMetric());

 // Using a simple String and a JTree instance...
 harness.addTarget(new StringTarget());
 harness.addTarget(new JTreeTarget());

 // Across XStream with different XML drivers.
 harness.addProduct(new XStreamDom());
 harness.addProduct(new XStreamXpp());
 harness.addProduct(new XStreamSax());

 // Now do it, and report the results as text to the console.
 harness.run(new TextReporter());
 

Author:
Joe Walnes

Constructor Summary
Harness()
           
 
Method Summary
 void addMetric(Metric metric)
           
 void addProduct(Product product)
           
 void addTarget(Target target)
           
 void run(Reporter reporter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Harness

public Harness()
Method Detail

addProduct

public void addProduct(Product product)

addTarget

public void addTarget(Target target)

addMetric

public void addMetric(Metric metric)

run

public void run(Reporter reporter)


Copyright © 2004-2007 XStream. All Rights Reserved.