public class FactoryEnabled extends Object implements MonitorFactoryInterface
MonitorFactory is simply
 a wrapper that makes calling this class simpler.   MonitorFactory contains a static reference to
 a FactoryEnabled class.VERSION| Constructor and Description | 
|---|
FactoryEnabled()
Creates a new instance of MonFactoryEnabled. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
Monitor | 
add(MonKey key,
   double value)
Used when you want to create your own key for the monitor. 
 | 
Monitor | 
add(String label,
   String units,
   double value)
Return a monitor with the given label and units. 
 | 
Monitor | 
addException(Monitor mon,
            Throwable throwable)
Note this creates 2 exception monitors and the more specific one is returned 
 | 
Monitor | 
addException(Throwable throwable)
Track an exception except there is no other associated monitor to put the details in. 
 | 
void | 
addListeners(List<JamonPropertiesLoader.JamonListenerProperty> listeners)
Add listeners. 
 | 
FactoryEnabled | 
copy()  | 
void | 
disableTotalKeySizeTracking()  | 
void | 
enableActivityTracking(boolean enable)
This determines if activity tracking in ranges is enabled. 
 | 
void | 
enableGlobalActive(boolean enable)  | 
void | 
enableTotalKeySizeTracking()
This will keep track of the total size of of the keys used to store the monitors which can be useful in keeping track of memory used by JAMon. 
 | 
boolean | 
exists(MonKey key)
Return true if the monitor associated with the passed in key exists 
 | 
boolean | 
exists(String label,
      String units)
Return true if the monitor associated with the passed in label and units exists 
 | 
MonitorComposite | 
getComposite(String units)
Pass in the units (or range type) and return all monitors of that
 type. 
 | 
Map | 
getMap()
Get the backing map that holds the the Monitors. 
 | 
int | 
getMaxNumMonitors()
Return the max number of configured of monitors. 
 | 
int | 
getMaxSqlSize()
Return the size that sql statements can be before truncating them. 
 | 
Monitor | 
getMonitor()
Returns a non-TimeMonitor that won't update the jamon factory. 
 | 
Monitor | 
getMonitor(MonKey key)
Get the monitor associated with the passed in key. 
 | 
Monitor | 
getMonitor(String label,
          String units)
Get the monitor with the passed in label, and units. 
 | 
int | 
getNumRows()
Get the number of monitors in this factory 
 | 
String[] | 
getRangeHeader()
Return the header associated with range names 
 | 
Object[][] | 
getRangeNames()
Return an array of range names. 
 | 
MonitorComposite | 
getRootMonitor()
getComposite("AllMonitors") is the same as getRootMonitor() 
 | 
Monitor | 
getTimeMonitor(MonKey key)
Get the time monitor associated with the passed in key. 
 | 
Monitor | 
getTimeMonitor(String label)
Get the time monitor associated with the passed in label. 
 | 
long | 
getTotalKeySize()
Returns the total of all keys in the monitor map. 
 | 
String | 
getVersion()
Get JAMon's version. 
 | 
boolean | 
isActivityTrackingEnabled()  | 
boolean | 
isGlobalActiveEnabled()  | 
boolean | 
isTotalKeySizeTrackingEnabled()  | 
Iterator | 
iterator()
Deprecated.   
 | 
void | 
remove(MonKey key)
Remove the monitor associated with the passed in key 
 | 
void | 
remove(String label,
      String units)
Remove the monitor associated with the passed in label and units 
 | 
void | 
reset()
Wipe out existing jamon data. 
 | 
void | 
setMap(Map map)
allows for using a faster/open source map. 
 | 
void | 
setMaxNumMonitors(int maxMonitors)
Set the max number of monitors that can be tracked. 
 | 
void | 
setMaxSqlSize(int size)
Set the maximum size for a sql statement. 
 | 
void | 
setRangeDefault(String key,
               RangeHolder rangeHolder)
Note if a null is passed in it will have the same effect as an empty
 RangeHolder (i.e. 
 | 
Monitor | 
start()
Returns a TimeMonitor that won't update the jamon factory. 
 | 
Monitor | 
start(MonKey key)
Start using the passed in key. 
 | 
Monitor | 
start(String label)
Return a time monitor (the units are implied and are ms. 
 | 
Monitor | 
startNano(MonKey key)
Provide your own key to a nanosecond timer 
 | 
Monitor | 
startNano(String label)
Create a timing monitor that uses nanosecond granularity (1,000,000 ns.=1 ms.) 
 | 
Monitor | 
startPrimary(MonKey key)
Start a monitor with the specified key and mark it as primary 
 | 
Monitor | 
startPrimary(String label)
Start a time monitor and mark it as primary 
 | 
public FactoryEnabled()
public Monitor add(MonKey key, double value)
MonitorFactoryInterfaceadd in interface MonitorFactoryInterfacepublic Monitor add(String label, String units, double value)
MonitorFactoryInterfaceSample Call: factory.add("com.fdsapi.MyException", "error", 1);
add in interface MonitorFactoryInterfacepublic Monitor start(MonKey key)
MonitorFactoryInterfacestart in interface MonitorFactoryInterfacepublic Monitor start(String label)
MonitorFactoryInterfacestart in interface MonitorFactoryInterfacepublic Monitor startNano(String label)
MonitorFactoryInterfacestartNano in interface MonitorFactoryInterfacepublic Monitor startNano(MonKey key)
MonitorFactoryInterfacestartNano in interface MonitorFactoryInterfacepublic Monitor startPrimary(MonKey key)
MonitorFactoryInterfacestartPrimary in interface MonitorFactoryInterfacepublic Monitor startPrimary(String label)
MonitorFactoryInterfacestartPrimary in interface MonitorFactoryInterfacepublic Monitor start()
MonitorFactoryInterfacestart in interface MonitorFactoryInterfacepublic Monitor getMonitor()
MonitorFactoryInterfacegetMonitor in interface MonitorFactoryInterfacepublic void setMap(Map map)
setMap in interface MonitorFactoryInterfacepublic Monitor getMonitor(MonKey key)
MonitorFactoryInterfacegetMonitor in interface MonitorFactoryInterfacepublic Monitor getMonitor(String label, String units)
MonitorFactoryInterfacegetMonitor in interface MonitorFactoryInterfacepublic Monitor getTimeMonitor(MonKey key)
MonitorFactoryInterfacegetTimeMonitor in interface MonitorFactoryInterfacepublic Monitor addException(Monitor mon, Throwable throwable)
addException in interface MonitorFactoryInterfacemon - optional monitor where we want to store the stack trace.throwable - exception that we want to create a monitor forpublic Monitor addException(Throwable throwable)
MonitorFactoryInterfaceaddException in interface MonitorFactoryInterfacethrowable - exception to create a monitor for.public Monitor getTimeMonitor(String label)
MonitorFactoryInterfacegetTimeMonitor in interface MonitorFactoryInterfacepublic void setRangeDefault(String key, RangeHolder rangeHolder)
setRangeDefault in interface MonitorFactoryInterfacepublic String[] getRangeHeader()
MonitorFactoryInterfacegetRangeHeader in interface MonitorFactoryInterfacepublic Object[][] getRangeNames()
MonitorFactoryInterfacegetRangeNames in interface MonitorFactoryInterfacepublic void remove(MonKey key)
MonitorFactoryInterfaceremove in interface MonitorFactoryInterfacepublic void remove(String label, String units)
MonitorFactoryInterfaceremove in interface MonitorFactoryInterfacepublic boolean exists(MonKey key)
MonitorFactoryInterfaceexists in interface MonitorFactoryInterfacepublic boolean exists(String label, String units)
MonitorFactoryInterfaceexists in interface MonitorFactoryInterfacepublic int getNumRows()
MonitorFactoryInterfacegetNumRows in interface MonitorFactoryInterfacepublic MonitorComposite getRootMonitor()
getRootMonitor in interface MonitorFactoryInterfacepublic MonitorComposite getComposite(String units)
getComposite in interface MonitorFactoryInterfacepublic String getVersion()
MonitorFactoryInterfacegetVersion in interface MonitorFactoryInterfacepublic long getTotalKeySize()
getTotalKeySize in interface MonitorFactoryInterfacepublic void reset()
reset in interface MonitorFactoryInterfacepublic void enableGlobalActive(boolean enable)
enableGlobalActive in interface MonitorFactoryInterfacepublic boolean isGlobalActiveEnabled()
isGlobalActiveEnabled in interface MonitorFactoryInterface@Deprecated public Iterator iterator()
mon.getMonKey().
 Alternatively the backing map can be retrieved and either the MonKey or Monitor can be iterated separately.iterator in interface MonitorFactoryInterfacepublic Map getMap()
MonitorFactoryInterfacegetMap in interface MonitorFactoryInterfacepublic void enableActivityTracking(boolean enable)
MonitorFactoryInterfaceenableActivityTracking in interface MonitorFactoryInterfacepublic boolean isActivityTrackingEnabled()
isActivityTrackingEnabled in interface MonitorFactoryInterfacepublic int getMaxNumMonitors()
MonitorFactoryInterfacegetMaxNumMonitors in interface MonitorFactoryInterfacepublic void setMaxNumMonitors(int maxMonitors)
MonitorFactoryInterfacesetMaxNumMonitors in interface MonitorFactoryInterfacemaxMonitors - If positive then this is the max number of monitors that can be stored.  0 or negative means monitors can grow unbounded.public void enableTotalKeySizeTracking()
MonitorFactoryInterfaceenableTotalKeySizeTracking in interface MonitorFactoryInterfacepublic void disableTotalKeySizeTracking()
disableTotalKeySizeTracking in interface MonitorFactoryInterfacepublic boolean isTotalKeySizeTrackingEnabled()
isTotalKeySizeTrackingEnabled in interface MonitorFactoryInterfacepublic int getMaxSqlSize()
MonitorFactoryInterfacegetMaxSqlSize in interface MonitorFactoryInterfacepublic void addListeners(List<JamonPropertiesLoader.JamonListenerProperty> listeners)
MonitorFactoryInterfaceaddListeners in interface MonitorFactoryInterfacepublic FactoryEnabled copy()
copy in interface MonitorFactoryInterfacepublic void setMaxSqlSize(int size)
MonitorFactoryInterfacesetMaxSqlSize in interface MonitorFactoryInterfaceCopyright © 2015. All rights reserved.