Class SimpleProfileMonitor
java.lang.Object
clazzfish.jdbc.monitor.AbstractProfileMonitor
clazzfish.jdbc.monitor.SimpleProfileMonitor
- All Implemented Interfaces:
ProfileMonitor
,Comparable<ProfileMonitor>
The Class SimpleProfileMonitor.
- Since:
- 19.12.2008
- Version:
- $Revision: 1.27 $
- Author:
- oliver
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new simple profile monitor.SimpleProfileMonitor
(String rootLabel) Instantiates a new simple profile monitor.SimpleProfileMonitor
(String label, SimpleProfileMonitor parent) Instantiates a new simple profile monitor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(double value) Adds the.protected void
addChild
(SimpleProfileMonitor child) Adds the child.void
Adds the child.void
addChildren
(List<String> labels) Adds the children.boolean
Only two monitors of the same instance can be equals.double
Gets the active.double
getAvg()
Gets the avg.double
Gets the avg active.Gets the first access.int
getHits()
Gets the hits.getLabel()
Gets the label.Gets the last access.double
Gets the last value.double
getMax()
Gets the max.double
Gets the max active.double
getMin()
Gets the min.getMonitor
(String lbl) Gets the monitor.Gets the monitors.int
Gets the number of monitors.double
getTotal()
Gets the total.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.To csv headline.To csv string.To short string.toString()
To string.Methods inherited from class clazzfish.jdbc.monitor.AbstractProfileMonitor
compareTo, getLastTime
-
Constructor Details
-
SimpleProfileMonitor
public SimpleProfileMonitor()Instantiates a new simple profile monitor. -
SimpleProfileMonitor
Instantiates a new simple profile monitor.- Parameters:
rootLabel
- the root label
-
SimpleProfileMonitor
Instantiates a new simple profile monitor.- Parameters:
label
- the labelparent
- the parent
-
-
Method Details
-
reset
public void reset()Reset.- See Also:
-
addChild
-
addChildren
-
addChild
-
getMonitors
-
getNumberOfMonitors
public int getNumberOfMonitors()Gets the number of monitors.- Returns:
- the number of monitors
- Since:
- 1.6
-
removeMonitor
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
Gets the monitor.- Parameters:
lbl
- the label as String- Returns:
- the monitor
-
start
public void start()Start.- See Also:
-
stop
public void stop()Stop.- See Also:
-
add
public void add(double value) Adds the.- Parameters:
value
- the measured time- See Also:
-
getTotal
public double getTotal()Gets the total.- Returns:
- the total
- See Also:
-
getLastValue
public double getLastValue()Gets the last value.- Returns:
- the last value
- See Also:
-
getMax
public double getMax()Gets the max.- Returns:
- the max
- See Also:
-
getMin
public double getMin()Gets the min.- Returns:
- the min
- See Also:
-
getHits
public int getHits()Gets the hits.- Returns:
- the hits
- See Also:
-
getAvg
public double getAvg()Gets the avg.- Returns:
- the avg
- See Also:
-
getLabel
-
toString
-
toShortString
-
toCsvHeadline
-
toCsvString
-
getUnits
-
getActive
public double getActive()Gets the active.- Returns:
- the active
- See Also:
-
getAvgActive
public double getAvgActive()Gets the avg active.- Returns:
- the avg active
- See Also:
-
getFirstAccess
-
getLastAccess
-
getMaxActive
public double getMaxActive()Gets the max active.- Returns:
- the max active
- See Also:
-
equals
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:
-
hashCode
public int hashCode()Hash code.- Overrides:
hashCode
in classAbstractProfileMonitor
- Returns:
- the int
- See Also:
-