|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jlf.vitals.VitalsManager
VitalsManager
is a singleton class that tries to keep track
of all the vital signs collected in the virtual machine, yet not
blow out the memory of the virtual machine with all of this information.
It keeps track of two primary types of vital signs, the first is a set
of vitals that needs to be collected on an automated, periodic basis,
by the vitals sampler thread.
The next is a set of vitals that is collected ad-hoc, that is, your
code notifies the vitals manager of a newly collected vital sign
measurement at the moment your code takes it (and it isn't regular/periodic).
The vitals manager knows the difference based on the
measurement frequency setting in the vital sign.
VitalSign
Field Summary | |
protected java.util.Map |
adhocVitals
Holds a collection of vital signs that are sampled on an ad-hoc basis. |
protected java.util.Map |
periodicVitals
Holds a collection of vital signs that need to be sampled periodically over time. |
protected static VitalsManager |
singleton
Holds the singleton instance of the vitals manager in the JVM. |
Constructor Summary | |
protected |
VitalsManager()
Protect the singleton by scoping the constructor to protected and also initialize it with any vital signs to collect periodically. |
Method Summary | |
protected java.util.Collection |
collectAllVitals(java.util.Map vitalMap)
Helper method to retrieve all vitals, parent and child, from a vital map. |
protected VitalSign |
findParentOrChildVital(java.lang.String vitalKey,
java.util.Collection vitals)
Helper method to iterate through a collection and find a vital that matches the vital key. |
VitalSign |
findRegisteredVitalSign(java.lang.String vitalKey)
Tries to find a registered vital sign. |
VitalSign |
getAdhocVital(java.lang.String vitalKey)
Helper method to find a vital sign in the adhocVitals collection. |
java.util.Collection |
getAdhocVitals()
Returns a collection of adhoc vitals that are registered. |
java.util.Collection |
getAllAdhocVitals()
Returns a collection of adhoc vitals that are registered, including parents and child instances. |
java.util.Collection |
getAllPeriodicVitals()
Returns a collection of periodic vitals that are registered, including parents and child instances. |
java.util.Collection |
getCollectableAdhocVitals()
Returns a collection of adhoc vitals that are registered and collectable. |
java.util.Collection |
getCollectablePeriodicVitals()
Returns a collection of periodic vitals that are registered and collectable. |
static VitalsManager |
getInstance()
Class accessor which answers the singleton instance of the VitalsManager for this virtual machine. |
VitalSign |
getParentOrChildAdhocVital(java.lang.String vitalKey)
Helper method to find a vital sign in the adhoc Vitals collection, whether the vital is a parent or child instance. |
VitalSign |
getParentOrChildPeriodicVital(java.lang.String vitalKey)
Helper method to find a vital sign in the periodic Vitals collection, whether a parent or a child vital. |
VitalSign |
getPeriodicVital(java.lang.String vitalKey)
Helper method to find a vital sign in the periodicVitals collection. |
java.util.Collection |
getPeriodicVitals()
Returns a collection of periodic vitals that are registered. |
protected void |
loadPeriodicVital(java.lang.String vitalKey)
Helper method that loads a periodic vital with the key given, wrapping any exceptions thrown, logging them but not throwing them back so loading any others will continue. |
protected void |
loadPeriodicVitals()
Helper method that looks through property file settings and load vitals designated to be captured. |
static void |
main(java.lang.String[] args)
Method that simply allows the vitals manager to start up using something like a WebLogic startup class. |
protected void |
putAdhocVital(VitalSign vitalSign)
Helper method to put a vital sign in the adhocVitals collection. |
protected void |
putPeriodicVital(VitalSign vitalSign)
Helper method to put a vital sign in the periodicVitals collection. |
VitalSign |
registerMeasurement(java.lang.String vitalKey,
AbstractVitalMeasurement newMeasurement)
Registers a measurement with a vital sign. |
VitalSign |
registerVitalSign(VitalSign inputVitalSign)
Adds a vital sign to the list of vitals that is being tracked. |
protected java.util.Collection |
siftCollectableVitals(java.util.Collection vitals)
Helper method to retrieve collectable vitals from a collection of vitals that may contain uncollectable parent vitals. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static VitalsManager singleton
protected java.util.Map periodicVitals
protected java.util.Map adhocVitals
Constructor Detail |
protected VitalsManager()
Method Detail |
public static VitalsManager getInstance()
protected void loadPeriodicVital(java.lang.String vitalKey)
protected void loadPeriodicVitals()
protected void putAdhocVital(VitalSign vitalSign)
AppError
- if the vital sign is already registeredpublic VitalSign getAdhocVital(java.lang.String vitalKey)
public VitalSign getParentOrChildAdhocVital(java.lang.String vitalKey)
protected VitalSign findParentOrChildVital(java.lang.String vitalKey, java.util.Collection vitals)
public java.util.Collection getAdhocVitals()
public java.util.Collection getAllAdhocVitals()
protected java.util.Collection siftCollectableVitals(java.util.Collection vitals)
protected java.util.Collection collectAllVitals(java.util.Map vitalMap)
public java.util.Collection getCollectableAdhocVitals()
protected void putPeriodicVital(VitalSign vitalSign)
AppError
- if the vital sign is already registeredpublic VitalSign getPeriodicVital(java.lang.String vitalKey)
public VitalSign getParentOrChildPeriodicVital(java.lang.String vitalKey)
public java.util.Collection getPeriodicVitals()
public java.util.Collection getAllPeriodicVitals()
public java.util.Collection getCollectablePeriodicVitals()
public VitalSign findRegisteredVitalSign(java.lang.String vitalKey)
public VitalSign registerVitalSign(VitalSign inputVitalSign)
public VitalSign registerMeasurement(java.lang.String vitalKey, AbstractVitalMeasurement newMeasurement)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |