Package patterntesting.runtime.monitor
Class ProfileMonitorFactory
- java.lang.Object
-
- patterntesting.runtime.monitor.ProfileMonitorFactory
-
- Direct Known Subclasses:
JamonMonitorFactory
,SimpleProfileMonitorFactory
public abstract class ProfileMonitorFactory extends java.lang.Object
This factory abstracts the differences between the monitor based on JAMon and the simple monitor provided by PatternTesting itself.- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description protected SimpleProfileMonitor
rootMonitor
The root monitor.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProfileMonitorFactory(SimpleProfileMonitor rootMonitor)
Instantiates a new monitor factory.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addMonitor(java.lang.String label)
Adds the monitor.abstract void
addMonitors(java.util.List<java.lang.String> labels)
Adds the monitors.abstract int
getMaxNumMonitors()
Gets the max num monitors.abstract ProfileMonitor
getMonitor(java.lang.String label)
Gets the monitor.abstract ProfileMonitor[]
getMonitors()
Gets the monitors (unsorted).SimpleProfileMonitor
getRootMonitor()
Gets the root monitor.abstract void
reset()
Reset.abstract void
setMaxNumMonitors(int maxMonitors)
Sets the max num monitors.java.lang.String
toString()
To string.
-
-
-
Field Detail
-
rootMonitor
protected final SimpleProfileMonitor rootMonitor
The root monitor.
-
-
Constructor Detail
-
ProfileMonitorFactory
protected ProfileMonitorFactory(SimpleProfileMonitor rootMonitor)
Instantiates a new monitor factory.- Parameters:
rootMonitor
- the root monitor
-
-
Method Detail
-
getRootMonitor
public SimpleProfileMonitor getRootMonitor()
Gets the root monitor.- Returns:
- the root monitor
-
setMaxNumMonitors
public abstract void setMaxNumMonitors(int maxMonitors)
Sets the max num monitors.- Parameters:
maxMonitors
- the new max num monitors
-
getMaxNumMonitors
public abstract int getMaxNumMonitors()
Gets the max num monitors.- Returns:
- the max num monitors
-
addMonitors
public abstract void addMonitors(java.util.List<java.lang.String> labels)
Adds the monitors.- Parameters:
labels
- the labels
-
addMonitor
public void addMonitor(java.lang.String label)
Adds the monitor.- Parameters:
label
- the label
-
getMonitor
public abstract ProfileMonitor getMonitor(java.lang.String label)
Gets the monitor.- Parameters:
label
- the label or signature- Returns:
- the monitor
-
getMonitors
public abstract ProfileMonitor[] getMonitors()
Gets the monitors (unsorted).- Returns:
- the monitors
-
reset
public abstract void reset()
Reset.
-
toString
public java.lang.String toString()
To string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string
- See Also:
Object.toString()
-
-