Package patterntesting.runtime.monitor
Class AbstractProfileMonitor
- java.lang.Object
-
- patterntesting.runtime.monitor.AbstractProfileMonitor
-
- All Implemented Interfaces:
java.lang.Comparable<ProfileMonitor>
,ProfileMonitor
- Direct Known Subclasses:
JamonMonitor
,SimpleProfileMonitor
public abstract class AbstractProfileMonitor extends java.lang.Object implements ProfileMonitor
The Class AbstractProfileMonitor.- Since:
- 27.12.2008
- Version:
- $Revision: 1.19 $
- Author:
- oliver
-
-
Constructor Summary
Constructors Constructor Description AbstractProfileMonitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ProfileMonitor other)
The ProfileMonitor with the higher number of totals is considered as "greater".boolean
equals(java.lang.Object obj)
If we impmlement theComparable.compareTo(Object)
method we should also implement/overwrite theObject.equals(Object)
method.java.lang.String
getLastTime()
Gets the last value as time string.int
hashCode()
Hash code.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface patterntesting.runtime.monitor.ProfileMonitor
add, getActive, getAvg, getAvgActive, getFirstAccess, getHits, getLabel, getLastAccess, getLastValue, getMax, getMaxActive, getMin, getMonitors, getTotal, getUnits, reset, start, stop, toCsvHeadline, toCsvString, toShortString
-
-
-
-
Method Detail
-
compareTo
public final int compareTo(ProfileMonitor other)
The ProfileMonitor with the higher number of totals is considered as "greater".- Specified by:
compareTo
in interfacejava.lang.Comparable<ProfileMonitor>
- Parameters:
other
- the other ProfileMonitor- Returns:
- 0 if both ProfileMonitors has the same result and the same label
-
getLastTime
public final java.lang.String getLastTime()
Gets the last value as time string. It returns the same result asProfileMonitor.getLastValue()
but in a human readable format. The english locale is used for formatting because this method is normally used for logging (which should be normally done in English).- Specified by:
getLastTime
in interfaceProfileMonitor
- Returns:
- the last time (e.g. "42 seconds")
- Since:
- 1.4.2
-
equals
public boolean equals(java.lang.Object obj)
If we impmlement theComparable.compareTo(Object)
method we should also implement/overwrite theObject.equals(Object)
method. For the result of the equals method we use not the result ofComparable.compareTo(Object)
but the label of the other object.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the other- Returns:
- true, if successful
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the int
- See Also:
Object.hashCode()
-
-