com.thoughtworks.xstream.tools.benchmark
Interface Metric

All Known Implementing Classes:
DeserializationSpeedMetric, SerializationSpeedMetric, SizeMetric

public interface Metric

A metric is what's actually recorded. This provides a strategy for what to do with an object for a given product and should return a measurable result. For example it could serialize an object against a product and return how long it took to complete the operation.

Author:
Joe Walnes
See Also:
Harness

Method Summary
 boolean biggerIsBetter()
          Whether a big result is better for this metric.
 double run(Product product, Object object)
          Run the test and produce a metric.
 String unit()
          The unit the metric is recorded in (for reporting purposes).
 

Method Detail

run

public double run(Product product,
                  Object object)
           throws Exception
Run the test and produce a metric.

Parameters:
product - Product to use in test.
object - A object to use against the product.
Returns:
The resulting metric (eg. 12.22).
Throws:
Exception - If this metric could not be obtained. This will be reported back to the Reporter.

unit

public String unit()
The unit the metric is recorded in (for reporting purposes). e.g. "ms" or "bytes".


biggerIsBetter

public boolean biggerIsBetter()
Whether a big result is better for this metric.



Copyright © 2004-2007 XStream. All Rights Reserved.