Package patterntesting.runtime.monitor
Class SimpleProfileMonitor
- java.lang.Object
-
- patterntesting.runtime.monitor.AbstractProfileMonitor
-
- patterntesting.runtime.monitor.SimpleProfileMonitor
-
- All Implemented Interfaces:
java.lang.Comparable<ProfileMonitor>
,ProfileMonitor
public final class SimpleProfileMonitor extends AbstractProfileMonitor
The Class SimpleProfileMonitor.- Since:
- 19.12.2008
- Version:
- $Revision: 1.27 $
- Author:
- oliver
-
-
Constructor Summary
Constructors Constructor Description SimpleProfileMonitor()
Instantiates a new simple profile monitor.SimpleProfileMonitor(java.lang.String rootLabel)
Instantiates a new simple profile monitor.SimpleProfileMonitor(java.lang.String label, SimpleProfileMonitor parent)
Instantiates a new simple profile monitor.SimpleProfileMonitor(org.aspectj.lang.Signature label, SimpleProfileMonitor parent)
Instantiates a new simple profile monitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(double value)
Adds the.void
addChild(java.lang.String lbl)
Adds the child.protected void
addChild(SimpleProfileMonitor child)
Adds the child.void
addChildren(java.util.List<java.lang.String> labels)
Adds the children.boolean
equals(java.lang.Object obj)
Only two monitors of the same instance can be equals.double
getActive()
Gets the active.double
getAvg()
Gets the avg.double
getAvgActive()
Gets the avg active.java.util.Date
getFirstAccess()
Gets the first access.int
getHits()
Gets the hits.java.lang.String
getLabel()
Gets the label.java.util.Date
getLastAccess()
Gets the last access.double
getLastValue()
Gets the last value.double
getMax()
Gets the max.double
getMaxActive()
Gets the max active.double
getMin()
Gets the min.SimpleProfileMonitor
getMonitor(java.lang.String lbl)
Gets the monitor.SimpleProfileMonitor
getMonitor(org.aspectj.lang.Signature sig)
We use now the signature without the return value.ProfileMonitor[]
getMonitors()
Gets the monitors.int
getNumberOfMonitors()
Gets the number of monitors.double
getTotal()
Gets the total.java.lang.String
getUnits()
Gets the units.int
hashCode()
Hash code.void
removeMonitor(SimpleProfileMonitor monitor)
Removes the given child monitor.void
reset()
Reset.void
start()
Start.void
stop()
Stop.java.lang.String
toCsvHeadline()
To csv headline.java.lang.String
toCsvString()
To csv string.java.lang.String
toShortString()
To short string.java.lang.String
toString()
To string.-
Methods inherited from class patterntesting.runtime.monitor.AbstractProfileMonitor
compareTo, getLastTime
-
-
-
-
Constructor Detail
-
SimpleProfileMonitor
public SimpleProfileMonitor()
Instantiates a new simple profile monitor.
-
SimpleProfileMonitor
public SimpleProfileMonitor(java.lang.String rootLabel)
Instantiates a new simple profile monitor.- Parameters:
rootLabel
- the root label
-
SimpleProfileMonitor
public SimpleProfileMonitor(org.aspectj.lang.Signature label, SimpleProfileMonitor parent)
Instantiates a new simple profile monitor.- Parameters:
label
- the labelparent
- the parent
-
SimpleProfileMonitor
public SimpleProfileMonitor(java.lang.String label, SimpleProfileMonitor parent)
Instantiates a new simple profile monitor.- Parameters:
label
- the labelparent
- the parent
-
-
Method Detail
-
reset
public void reset()
Reset.- See Also:
ProfileMonitor.reset()
-
addChild
protected void addChild(SimpleProfileMonitor child)
Adds the child.- Parameters:
child
- the child
-
addChildren
public void addChildren(java.util.List<java.lang.String> labels)
Adds the children.- Parameters:
labels
- the labels
-
addChild
public void addChild(java.lang.String lbl)
Adds the child.- Parameters:
lbl
- the label
-
getMonitors
public ProfileMonitor[] getMonitors()
Gets the monitors.- Returns:
- the monitors
- See Also:
ProfileMonitor.getMonitors()
-
getNumberOfMonitors
public int getNumberOfMonitors()
Gets the number of monitors.- Returns:
- the number of monitors
- Since:
- 1.6
-
removeMonitor
public void removeMonitor(SimpleProfileMonitor monitor)
Removes the given child monitor. To be sure to get the correct entry we use the label of the given monitor.- Parameters:
monitor
- the monitor- Since:
- 1.6
-
getMonitor
public SimpleProfileMonitor getMonitor(org.aspectj.lang.Signature sig)
We use now the signature without the return value. That's enough.- Parameters:
sig
- the sig- Returns:
- the monitor for sig
-
getMonitor
public SimpleProfileMonitor getMonitor(java.lang.String lbl)
Gets the monitor.- Parameters:
lbl
- the label as String- Returns:
- the monitor
- Since:
- 1.4.2
-
start
public void start()
Start.- See Also:
ProfileMonitor.start()
-
stop
public void stop()
Stop.- See Also:
ProfileMonitor.stop()
-
add
public void add(double value)
Adds the.- Parameters:
value
- the measured time- See Also:
ProfileMonitor.add(double)
-
getTotal
public double getTotal()
Gets the total.- Returns:
- the total
- See Also:
ProfileMonitor.getTotal()
-
getLastValue
public double getLastValue()
Gets the last value.- Returns:
- the last value
- See Also:
ProfileMonitor.getLastValue()
-
getMax
public double getMax()
Gets the max.- Returns:
- the max
- See Also:
ProfileMonitor.getMax()
-
getMin
public double getMin()
Gets the min.- Returns:
- the min
- See Also:
ProfileMonitor.getMin()
-
getHits
public int getHits()
Gets the hits.- Returns:
- the hits
- See Also:
ProfileMonitor.getHits()
-
getAvg
public double getAvg()
Gets the avg.- Returns:
- the avg
- See Also:
ProfileMonitor.getAvg()
-
getLabel
public java.lang.String getLabel()
Gets the label.- Returns:
- the label
- See Also:
ProfileMonitor.getLabel()
-
toString
public java.lang.String toString()
To string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string
- See Also:
Object.toString()
-
toShortString
public java.lang.String toShortString()
To short string.- Returns:
- the string
- See Also:
ProfileMonitor.toShortString()
-
toCsvHeadline
public java.lang.String toCsvHeadline()
To csv headline.- Returns:
- the string
- See Also:
ProfileMonitor.toCsvHeadline()
-
toCsvString
public java.lang.String toCsvString()
To csv string.- Returns:
- the string
- See Also:
ProfileMonitor.toCsvString()
-
getUnits
public java.lang.String getUnits()
Gets the units.- Returns:
- the units
- See Also:
ProfileMonitor.getUnits()
-
getActive
public double getActive()
Gets the active.- Returns:
- the active
- See Also:
ProfileMonitor.getActive()
-
getAvgActive
public double getAvgActive()
Gets the avg active.- Returns:
- the avg active
- See Also:
ProfileMonitor.getAvgActive()
-
getFirstAccess
public java.util.Date getFirstAccess()
Gets the first access.- Returns:
- the first access
- See Also:
ProfileMonitor.getFirstAccess()
-
getLastAccess
public java.util.Date getLastAccess()
Gets the last access.- Returns:
- the last access
- See Also:
ProfileMonitor.getLastAccess()
-
getMaxActive
public double getMaxActive()
Gets the max active.- Returns:
- the max active
- See Also:
ProfileMonitor.getMaxActive()
-
equals
public boolean equals(java.lang.Object obj)
Only two monitors of the same instance can be equals. Otherwise the result is the same as the one of the superclass.- Overrides:
equals
in classAbstractProfileMonitor
- Parameters:
obj
- the obj- Returns:
- true, if successful
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Hash code.- Overrides:
hashCode
in classAbstractProfileMonitor
- Returns:
- the int
- See Also:
AbstractProfileMonitor.hashCode()
-
-