|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jamonapi.MonitorFactory
public class MonitorFactory
Static MonitorFactory that is good to use in most cases. In the situation when you want a different factory then instanciated FactoryEnabled directly. Note this is mostly a wrapper for FactoryEnabled and FactoryDisabled. You can also get the underlying factory with a call to getFactory()
Field Summary | |
---|---|
static java.lang.String |
EXCEPTIONS_LABEL
|
Constructor Summary | |
---|---|
MonitorFactory()
|
Method Summary | |
---|---|
static Monitor |
add(MonKey key,
double value)
Used when you want to create your own key for the monitor. |
static Monitor |
add(java.lang.String label,
java.lang.String units,
double value)
Aggregate the passed in value with the monitor associated with the label, and the units. |
static void |
disable()
Disable MonitorFactory. |
static void |
disableTotalKeySizeTracking()
Call this method if you want to disable key size tracking. |
static void |
enable()
Enable MonitorFactory. |
static void |
enableActivityTracking(boolean enable)
|
static void |
enableGlobalActive(boolean enable)
|
static void |
enableTotalKeySizeTracking()
Call this method if you want to be able to call MonitorFactory.getTotalKeySize() to determine the size of all labels/keys in JAMon. |
static boolean |
exists(MonKey key)
Return true if the monitor associated with the passed in key exists |
static boolean |
exists(java.lang.String label,
java.lang.String units)
Determine if the monitor associated with the label, and the units currently exists. |
static MonitorComposite |
getComposite(java.lang.String units)
Return the composite monitor (a collection of monitors) associated with the passed in units. |
static java.lang.Object[][] |
getData()
This returns the data for basic data with no range info. |
static MonitorFactoryInterface |
getDebugFactory()
Returns the factory for creating debug monitors. |
static MonitorFactoryInterface |
getFactory()
Get the current Factory (could be the enabled or disabled factory depending on what is enabled) |
static java.lang.String[] |
getHeader()
Deprecated. |
static java.util.Map |
getMap()
|
static int |
getMaxNumMonitors()
Get the maximum number of monitors that JAMon can store. |
static int |
getMaxSqlSize()
Return the size that sql statements can be before truncating them. |
static Monitor |
getMonitor()
|
static Monitor |
getMonitor(MonKey key)
Get the monitor associated with the passed in key. |
static Monitor |
getMonitor(java.lang.String label,
java.lang.String units)
Return the monitor associated with the label, and units. |
static int |
getNumRows()
This returns the number of monitors in this factory. |
static java.lang.String[] |
getRangeHeader()
Return the header for displaying what ranges are available. |
static java.lang.Object[][] |
getRangeNames()
Return the ranges in this factory. |
static java.lang.String |
getReport()
This returns an HTML report for basic data with no range info in the header. |
static java.lang.String |
getReport(java.lang.String units)
This returns an HTML report for basic data with no range info in the header for the past in units. |
static MonitorComposite |
getRootMonitor()
Return the composite monitor of all monitors for this factory |
static Monitor |
getTimeMonitor(MonKey key)
Get the time monitor associated with the passed in key. |
static Monitor |
getTimeMonitor(java.lang.String label)
Return the time monitor associated with the label. |
static long |
getTotalKeySize()
Returns the total key sizes which is the size of all String lables stored in JAMon. |
static java.lang.String |
getVersion()
Return the version of JAMon |
static boolean |
isActivityTrackingEnabled()
|
static boolean |
isDebugEnabled()
Is the Debug Monitor Factory currently enabled? |
static boolean |
isEnabled()
Is the MonitorFactory currently enabled? |
static boolean |
isGlobalActiveEnabled()
|
static boolean |
isTotalKeySizeTrackingEnabled()
|
static java.util.Iterator |
iterator()
Deprecated. |
static void |
remove(MonKey key)
Remove the monitor associated with the passed in key |
static void |
remove(java.lang.String label,
java.lang.String units)
Remove/delete the specified monitor |
static void |
reset()
Reset/remove all monitors. |
static void |
setDebugEnabled(boolean enable)
Enable or disable the debug factory. |
static void |
setEnabled(boolean enable)
Enable/Disable MonitorFactory. |
static void |
setMap(java.util.Map map)
Use the specified map to hold the monitors. |
static void |
setMaxNumMonitors(int maxMonitors)
Set the maximum number of monitors that JAMon can store. |
static void |
setMaxSqlSize(int size)
Set the maximum size for a sql statement. |
static void |
setRangeDefault(java.lang.String key,
RangeHolder rangeHolder)
Associate a range with a key/unit. |
static Monitor |
start()
Return a timing monitor with units in milliseconds, that is not aggregated into the jamon stats. |
static Monitor |
start(MonKey key)
Start using the passed in key. |
static Monitor |
start(java.lang.String label)
Return a timing monitor with units in milliseconds. |
static Monitor |
startPrimary(MonKey key)
Start a monitor with the specified key and mark it as primary |
static Monitor |
startPrimary(java.lang.String label)
Return a timing monitor with units in milliseconds, that is not aggregated into the jamon stats. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String EXCEPTIONS_LABEL
Constructor Detail |
---|
public MonitorFactory()
Method Detail |
---|
public static MonitorFactoryInterface getFactory()
public static MonitorFactoryInterface getDebugFactory()
Sample Call: MonitorFactory.getDebugFactory().start();
public static Monitor add(java.lang.String label, java.lang.String units, double value)
Sample call:
Monitor mon=MonitorFactory.add("bytes.sent","MB", 1024);
public static Monitor add(MonKey key, double value)
public static Monitor start(java.lang.String label)
Sample call:
Monitor mon=MonitorFactory.start("pageHits");
...code being timed...
mon.stop();
public static Monitor start()
Sample call:
Monitor mon=MonitorFactory.start();
...code being timed...
mon.stop();
public static Monitor getMonitor()
public static Monitor startPrimary(java.lang.String label)
Sample call:
Monitor mon=MonitorFactory.startPrimary("myPrimaryMonitor");
...code being timed...
mon.stop();
public static Monitor startPrimary(MonKey key)
public static Monitor start(MonKey key)
public static Monitor getMonitor(java.lang.String label, java.lang.String units)
Sample call:
Monitor mon=MonitorFactory.getMonitor("myPrimaryMonitor");
public static Monitor getMonitor(MonKey key)
public static Monitor getTimeMonitor(java.lang.String label)
Sample call:
Monitor mon=MonitorFactory.getTimeMonitor("myPrimaryMonitor");
public static Monitor getTimeMonitor(MonKey key)
public static boolean exists(java.lang.String label, java.lang.String units)
Sample call:
Monitor mon=MonitorFactory.getTimeMonitor("myPrimaryMonitor");
public static boolean exists(MonKey key)
public static MonitorComposite getComposite(java.lang.String units)
Sample call:
Monitor mon=MonitorFactory.getComposite("ms.");
mon=MonitorFactory.getComposite("allMonitors");
public static int getNumRows()
public static java.lang.String[] getRangeHeader()
public static java.lang.Object[][] getRangeNames()
public static MonitorComposite getRootMonitor()
public static java.lang.String getVersion()
public static void remove(java.lang.String label, java.lang.String units)
public static void remove(MonKey key)
public static void setMap(java.util.Map map)
public static java.util.Map getMap()
public static void setRangeDefault(java.lang.String key, RangeHolder rangeHolder)
public static void setEnabled(boolean enable)
public static void setDebugEnabled(boolean enable)
Sample Call:
MonitorFactory.setDebugEnabled(false);
MonitorFactory.getDebugFactory().start(); // no stats are gathered.
public static void enable()
public static void disable()
public static boolean isEnabled()
public static boolean isDebugEnabled()
public static boolean isGlobalActiveEnabled()
public static void enableGlobalActive(boolean enable)
public static void reset()
@Deprecated public static java.lang.String[] getHeader()
public static java.lang.Object[][] getData()
public static java.lang.String getReport()
public static java.lang.String getReport(java.lang.String units)
@Deprecated public static java.util.Iterator iterator()
public static void enableActivityTracking(boolean enable)
public static boolean isActivityTrackingEnabled()
public static void setMaxNumMonitors(int maxMonitors)
maxMonitors
- maximum number of monitors that JAMon can store.public static int getMaxNumMonitors()
public static void enableTotalKeySizeTracking()
public static void disableTotalKeySizeTracking()
public static boolean isTotalKeySizeTrackingEnabled()
public static long getTotalKeySize()
public static void setMaxSqlSize(int size)
size
- public static int getMaxSqlSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |