01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package mx4j.tools.stats;
10:
11: import java.util.Date;
12: import java.util.SortedMap;
13:
14: /**
15: * Management interface to be implemented by recorder MBeans.
16: * RecorderMBeans store a value and also keep statistics about the given value.
17: * Different implementations can determine how to acquire and calculate the value.
18: * <p/>
19: * The MBean doesn't starts automatically. It has to wait for a {@link #start} call
20: *
21: * @version $Revision: 1.4 $
22: * @see PointTime
23: */
24: public interface StatisticsRecorderMBean {
25: /**
26: * Returns the Maximum Value
27: */
28: public Number getMax();
29:
30: /**
31: * Returns the Average Value
32: */
33: public Number getAverage();
34:
35: /**
36: * Returns the Minimum Value
37: */
38: public Number getMin();
39:
40: /**
41: * Returns how many entries may be recorded. When the maximum amount is
42: * reached the default behaviour is to forget the oldest one
43: */
44: public int getMaxEntries();
45:
46: /**
47: * Sets the maximum entries stored in this recorder
48: */
49: public void setMaxEntries(int maxEntries);
50:
51: /**
52: * Returns the date when it started recording
53: */
54: public Date getRecordingStart();
55:
56: /**
57: * Returs a sorted map of the recorded values indexed by PointTime
58: */
59: public SortedMap getEntries();
60:
61: /**
62: * Indicates whether the MBean is recording values
63: */
64: public boolean isActive();
65:
66: /**
67: * Starts recording a variable
68: */
69: public void start();
70:
71: /**
72: * Stops recording a variable
73: */
74: public void stop();
75: }
|