|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jamonapi.MonitorFactory
MonitorFactory - Class that controls monitors including creating, starting, enabling, disabling and resetting them. This class uses the Gang of 4's creational patterns. Monitors returned by MonitorFactory are thread safe.
Constructor Summary | |
MonitorFactory()
|
Method Summary | |
static MonitorComposite |
getComposite(java.lang.String locator)
Returns the composite monitor specified in the argument. |
static MonitorFactoryInterface |
getDebugFactory()
Returns the factory for creating debug monitors. |
static MonitorFactoryInterface |
getDebugFactory(int _debugPriorityLevel)
Returns the factory for creating debug monitors. |
static java.lang.String |
getReport()
Returns all gathered statistics as an HTML table as a String. |
static java.lang.String |
getReport(java.lang.String locator)
Returns gathered statistics underneath lower in the heirarchy than the locator string. |
static MonitorComposite |
getRootMonitor()
Returns the topmost Composite Monitor |
static void |
main(java.lang.String[] args)
Test code for the MonitorFactory class. |
static void |
reset()
Wipes out all statistics that have been gathered. |
static void |
setDebugEnabled(boolean _debugEnabled)
Enable or disable the debug factory. |
static void |
setDebugPriorityLevel(int _debugPriorityLevel)
Enable or disable the priority driven debug factory. |
static void |
setEnabled(boolean _enabled)
Enable or disable the factory. |
static void |
setJAMonAdminPage(java.lang.String JAMonAdminPage)
Call this method if you don't want to use the default name or location for JAMonAdmin.jsp that is returned in the JAMon report. |
static Monitor |
start()
Return a Monitor and begin gathering timing statistics for it. |
static Monitor |
start(java.lang.String locator)
Return a Monitor and begin gathering timing statistics for it. |
static Monitor |
startPrimary(java.lang.String locator)
Return a Monitor and begin gathering timing statistics for it. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MonitorFactory()
Method Detail |
public static MonitorComposite getComposite(java.lang.String locator)
Sample Call: String html=MonitorFactory.getComposite("pages").getReport();
locator
- A string that locates the Composite Monitor.
public static MonitorFactoryInterface getDebugFactory()
Sample Call: MonitorFactory.getDebugFactory().start();
public static MonitorFactoryInterface getDebugFactory(int _debugPriorityLevel)
Sample Call: MonitorFactory.getDebugFactory(20).start();
if MonitorFactory debug priority level is 10 then a non null Monitor will be returned
public static java.lang.String getReport() throws java.lang.Exception
Sample Call: String html=MonitorFactory.getReport();
java.lang.Exception
public static java.lang.String getReport(java.lang.String locator) throws java.lang.Exception
Sample Call: String html=MonitorFactory.getReport("MyApplication.DataAccess");
This would return statistics for MyApplication.DataAccess.open(), MyApplication.DataAccess.close(),...
java.lang.Exception
public static MonitorComposite getRootMonitor()
public static void reset()
Sample Call: MonitorFactory.reset();
public static void setDebugEnabled(boolean _debugEnabled)
Sample Call:
MonitorFactory.setDebugEnabled(false);
MonitorFactory.getDebugFactory().start(); // no stats are gathered.
MonitorFactory.getDebugFactory(20).start(); // no stats are gathered.
public static void setDebugPriorityLevel(int _debugPriorityLevel)
Sample Call:
MonitorFactory.setDebugEnabled(false);
MonitorFactory.getDebugFactory(20).start(); // no stats are gathered.
public static void setEnabled(boolean _enabled)
Sample Call:
MonitorFactory.setEnabled(false);
MonitorFactory.start(); // no stats are gathered.
MonitorFactory.start("MyApp.DataAccess.open()"); // no stats are gathered.
MonitorFactory.getDebugFactory().start(); // no stats are gathered.
MonitorFactory.getDebugFactory(20).start(); // no stats are gathered.
public static void setJAMonAdminPage(java.lang.String JAMonAdminPage)
public static Monitor start(java.lang.String locator)
Sample Call:
Monitor mon=MonitorFactory.start("MyApp.DataAccess.open()");
...code being monitored...
System.out.println(mon.stop());
public static Monitor start()
Sample Call:
Monitor mon=MonitorFactory.start();
...code being monitored...
System.out.println(mon.stop());
public static Monitor startPrimary(java.lang.String locator)
Sample Call:
Monitor mon=MonitorFactory.startPrimary("MyApp.jsp.HomePage");
...code being monitored...
System.out.println(mon.stop());
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |