01: /*
02: * Copyright (C) 2006 Joe Walnes.
03: * Copyright (C) 2006, 2007 XStream Committers.
04: * All rights reserved.
05: *
06: * The software in this package is published under the terms of the BSD
07: * style license a copy of which has been included with this distribution in
08: * the LICENSE.txt file.
09: *
10: * Created on 15. July 2006 by Joe Walnes
11: */
12: package com.thoughtworks.xstream.tools.benchmark;
13:
14: /**
15: * A listener to what the {@link Harness} is doing that should report the results.
16: *
17: * The sequence of methods is:
18: * <pre>
19: * startBenchmark,
20: * (
21: * startMetric,
22: * (
23: * startTarget,
24: * ( metricRecorded | metricFailed ),
25: * endTarget
26: * ) * ,
27: * endMetric
28: * ) * ,
29: * endBenchmark
30: * </pre>
31: *
32: * @author Joe Walnes
33: * @see Harness
34: */
35: public interface Reporter {
36:
37: /**
38: * Benchmark has started. This will always be called ONCE (and only once) BEFORE everything else.
39: */
40: void startBenchmark();
41:
42: void startMetric(Metric metric);
43:
44: void startTarget(Target target);
45:
46: void metricRecorded(Product product, double result);
47:
48: void metricFailed(Product product, Exception e);
49:
50: void endTarget(Target target);
51:
52: void endMetric(Metric metric);
53:
54: /**
55: * Benchmark has ended. This will always be called ONCE (and only once) AFTER everything else.
56: */
57: void endBenchmark();
58:
59: }
|