Class AbstractProfileMonitor
java.lang.Object
clazzfish.jdbc.monitor.AbstractProfileMonitor
- All Implemented Interfaces:
ProfileMonitor, Comparable<ProfileMonitor>
- Direct Known Subclasses:
SimpleProfileMonitor
The Class AbstractProfileMonitor.
- Since:
- 27.12.2008
- Version:
- $Revision: 1.19 $
- Author:
- oliver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intcompareTo(ProfileMonitor other) The ProfileMonitor with the higher number of totals is considered as "greater".booleanIf we impmlement theComparable.compareTo(Object)method we should also implement/overwrite theObject.equals(Object)method.final StringGets the last value as time string.inthashCode()Hash code.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ProfileMonitor
add, getActive, getAvg, getAvgActive, getFirstAccess, getHits, getLabel, getLastAccess, getLastValue, getMax, getMaxActive, getMin, getMonitors, getTotal, getUnits, readFromCsv, reset, start, stop, toCsvHeadline, toCsvString, toShortStringModifier and TypeMethodDescriptionvoidadd(double value) Normally this method should be synchronized.doubleGets the active.doublegetAvg()Gets the avg.doubleGets the avg active.Gets the first access.intgetHits()Gets the hits.getLabel()Gets the label.Gets the last access.doubleGets the last value.doublegetMax()Gets the max.doubleGets the max active.doublegetMin()Gets the min.Gets the monitors.doublegetTotal()Gets the total.getUnits()Gets the units.voidreadFromCsv(String line) Reads the data from an CSV line.voidreset()Reset.voidstart()Start.voidstop()Stop.To csv headline.To csv string.To short string.
-
Constructor Details
-
AbstractProfileMonitor
public AbstractProfileMonitor()
-
-
Method Details
-
compareTo
The ProfileMonitor with the higher number of totals is considered as "greater".- Specified by:
compareToin interfaceComparable<ProfileMonitor>- Parameters:
other- the other ProfileMonitor- Returns:
- 0 if both ProfileMonitors has the same result and the same label
-
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:
getLastTimein interfaceProfileMonitor- Returns:
- the last time (e.g. "42 seconds")
- Since:
- 1.4.2
-
equals
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. -
hashCode
-