Java Doc for MonitorFactory.java in  » Profiler » JAMon » com » jamonapi » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Profiler » JAMon » com.jamonapi 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jamonapi.MonitorFactory

MonitorFactory
public class MonitorFactory (Code)


Field Summary
final public static  StringEXCEPTIONS_LABEL
    


Method Summary
public static  Monitoradd(String label, String units, double value)
    

Aggregate the passed in value with the monitor associated with the label, and the units.

public static  Monitoradd(MonKey key, double value)
     Used when you want to create your own key for the monitor.
public static  voiddisable()
     Disable MonitorFactory.
public static  voidenable()
     Enable MonitorFactory.
public static  voidenableGlobalActive(boolean enable)
    
public static  booleanexists(String label, String units)
    

Determine if the monitor associated with the label, and the units currently exists.

public static  booleanexists(MonKey key)
    
public static  MonitorCompositegetComposite(String units)
    

Return the composite monitor (a collection of monitors) associated with the passed in units.

public static  Object[][]getData()
     This returns the data for basic data with no range info.
public static  MonitorFactoryInterfacegetDebugFactory()
     Returns the factory for creating debug monitors.
public static  MonitorFactoryInterfacegetFactory()
    
public static  String[]getHeader()
     This returns the header for basic data with no range info in the header. This method is deprecated.
public static  MonitorgetMonitor()
    
public static  MonitorgetMonitor(String label, String units)
    

Return the monitor associated with the label, and units.

public static  MonitorgetMonitor(MonKey key)
     Get the monitor associated with the passed in key.
public static  intgetNumRows()
     This returns the number of monitors in this factory.
public static  String[]getRangeHeader()
     Return the header for displaying what ranges are available.
public static  Object[][]getRangeNames()
     Return the ranges in this factory.
public static  StringgetReport()
     This returns an HTML report for basic data with no range info in the header.
public static  StringgetReport(String units)
     This returns an HTML report for basic data with no range info in the header for the past in units.
public static  MonitorCompositegetRootMonitor()
    
public static  MonitorgetTimeMonitor(String label)
    

Return the time monitor associated with the label.

public static  MonitorgetTimeMonitor(MonKey key)
     Get the time monitor associated with the passed in key.
public static  StringgetVersion()
    
public static  booleanisDebugEnabled()
    
public static  booleanisEnabled()
    
public static  booleanisGlobalActiveEnabled()
    
public  Iteratoriterator()
    
public static  voidmain(String[] args)
    
public static  voidremove(String label, String units)
    
public static  voidremove(MonKey key)
    
public static  voidreset()
     Reset/remove all monitors.
public static  voidsetDebugEnabled(boolean enable)
     Enable or disable the debug factory.
public static  voidsetEnabled(boolean enable)
     Enable/Disable MonitorFactory.
public static  voidsetMap(Map map)
     Use the specified map to hold the monitors.
public static  voidsetRangeDefault(String key, RangeHolder rangeHolder)
     Associate a range with a key/unit.
public static  Monitorstart(String label)
    

Return a timing monitor with units in milliseconds.

public static  Monitorstart()
    

Return a timing monitor with units in milliseconds, that is not aggregated into the jamon stats.

public static  Monitorstart(MonKey key)
     Start using the passed in key.
public static  MonitorstartPrimary(String label)
    

Return a timing monitor with units in milliseconds, that is not aggregated into the jamon stats.

public static  MonitorstartPrimary(MonKey key)
    

Field Detail
EXCEPTIONS_LABEL
final public static String EXCEPTIONS_LABEL(Code)





Method Detail
add
public static Monitor add(String label, String units, double value)(Code)

Aggregate the passed in value with the monitor associated with the label, and the units. The aggregation tracks hits, avg, total, min, max and more. Note the monitor returned is threadsafe. However, it is best to get a monitor vi this method and not reuse the handle as TimeMonitors are not thread safe (see the getTimeMonitor method.

Sample call:
 Monitor mon=MonitorFactory.add("bytes.sent","MB", 1024);
 





add
public static Monitor add(MonKey key, double value)(Code)
Used when you want to create your own key for the monitor. This works similarly to a group by clause where the key is any columns used after the group by clause.



disable
public static void disable()(Code)
Disable MonitorFactory. When disabled the factory returns null/noop monitors. This method has the same effect as calling MonitorFactor.setEnabled(true).



enable
public static void enable()(Code)
Enable MonitorFactory. When enabled the factory returns monitors that store aggregate stats. This method has the same effect as calling MonitorFactor.setEnabled(true).



enableGlobalActive
public static void enableGlobalActive(boolean enable)(Code)



exists
public static boolean exists(String label, String units)(Code)

Determine if the monitor associated with the label, and the units currently exists.

Sample call:
 Monitor mon=MonitorFactory.getTimeMonitor("myPrimaryMonitor");





exists
public static boolean exists(MonKey key)(Code)
Return true if the monitor associated with the passed in key exists



getComposite
public static MonitorComposite getComposite(String units)(Code)

Return the composite monitor (a collection of monitors) associated with the passed in units. Note in JAMon 1.0 this method would take a lable and would return all monitors that matched that criterion. This ability is now better performed using ArraySQL from the FormattedDataSet API. See JAMonAdmin.jsp for an example.

Sample call:
 Monitor mon=MonitorFactory.getComposite("ms.");
mon=MonitorFactory.getComposite("allMonitors");





getData
public static Object[][] getData()(Code)
This returns the data for basic data with no range info. The various getXXXData() methods of CompositeMonitors can return this information and more.



getDebugFactory
public static MonitorFactoryInterface getDebugFactory()(Code)
Returns the factory for creating debug monitors. The debug factory can be disabled independently from the regular factory. Debug monitors are no different than monitors returned by the regular monitor factory. However the debug factory can be used to monitor items in a test environment and disable them in production. Sample Call: MonitorFactory.getDebugFactory().start();



getFactory
public static MonitorFactoryInterface getFactory()(Code)
Get the current Factory (could be the enabled or disabled factory depending on what is enabled)



getHeader
public static String[] getHeader()(Code)
This returns the header for basic data with no range info in the header. This method is deprecated. use the methods associated with the CompositeMonitor. The various getXXXHeader() methods of CompositeMonitors can return this information and more.



getMonitor
public static Monitor getMonitor()(Code)



getMonitor
public static Monitor getMonitor(String label, String units)(Code)

Return the monitor associated with the label, and units. All statistics associated with the monitor can then be accessed such as hits, total, avg, min, and max. If the monitor does not exist it will be created.

Sample call:
 Monitor mon=MonitorFactory.getMonitor("myPrimaryMonitor");





getMonitor
public static Monitor getMonitor(MonKey key)(Code)
Get the monitor associated with the passed in key. It will be created if it doesn't exist



getNumRows
public static int getNumRows()(Code)
This returns the number of monitors in this factory.



getRangeHeader
public static String[] getRangeHeader()(Code)
Return the header for displaying what ranges are available.



getRangeNames
public static Object[][] getRangeNames()(Code)
Return the ranges in this factory.



getReport
public static String getReport()(Code)
This returns an HTML report for basic data with no range info in the header.



getReport
public static String getReport(String units)(Code)
This returns an HTML report for basic data with no range info in the header for the past in units. This method will be removed in the next release.



getRootMonitor
public static MonitorComposite getRootMonitor()(Code)
Return the composite monitor of all monitors for this factory



getTimeMonitor
public static Monitor getTimeMonitor(String label)(Code)

Return the time monitor associated with the label. All statistics associated with the monitor can then be accessed such as hits, total, avg, min, and max. If the monitor does not exist it will be created.

Sample call:
 Monitor mon=MonitorFactory.getTimeMonitor("myPrimaryMonitor");





getTimeMonitor
public static Monitor getTimeMonitor(MonKey key)(Code)
Get the time monitor associated with the passed in key. It will be created if it doesn't exist. The units are in ms.



getVersion
public static String getVersion()(Code)
Return the version of JAMon



isDebugEnabled
public static boolean isDebugEnabled()(Code)
Is the Debug Monitor Factory currently enabled?



isEnabled
public static boolean isEnabled()(Code)
Is the MonitorFactory currently enabled?



isGlobalActiveEnabled
public static boolean isGlobalActiveEnabled()(Code)



iterator
public Iterator iterator()(Code)
Iterator that contains Monitor's that are in this factory



main
public static void main(String[] args)(Code)



remove
public static void remove(String label, String units)(Code)
Remove/delete the specified monitor



remove
public static void remove(MonKey key)(Code)
Remove the monitor associated with the passed in key



reset
public static void reset()(Code)
Reset/remove all monitors. If the factory is disabled this method has no action.



setDebugEnabled
public static void setDebugEnabled(boolean enable)(Code)
Enable or disable the debug factory. The debug factory can be enabled/disabled at runtime. Calling this method with a false also disables calls to MonitorFactory.getDebugFactory(int debugPriorityLevel) Sample Call: MonitorFactory.setDebugEnabled(false); MonitorFactory.getDebugFactory().start(); // no stats are gathered.



setEnabled
public static void setEnabled(boolean enable)(Code)
Enable/Disable MonitorFactory. When enabled (true) the factory returns monitors that store aggregate stats. When disabled (false) null/noop monitors are returned. enable()/disable() can also be used to perform the same function



setMap
public static void setMap(Map map)(Code)
Use the specified map to hold the monitors. This map should be threadsafe. This allows for the use of a faster map than the default synchronzied HashMap()



setRangeDefault
public static void setRangeDefault(String key, RangeHolder rangeHolder)(Code)
Associate a range with a key/unit. Any monitor with the given unit will have this range. Any monitor with no range associated with its unit will have no range.



start
public static Monitor start(String label)(Code)

Return a timing monitor with units in milliseconds. stop() should be called on the returned monitor to indicate the time that the process took. Note time monitors keep the starttime as an instance variable and so every time you want to use a TimeMonitor you should get a new instance.

Sample call:
 Monitor mon=MonitorFactory.start("pageHits");
...code being timed...
mon.stop();





start
public static Monitor start()(Code)

Return a timing monitor with units in milliseconds, that is not aggregated into the jamon stats. stop() should be called on the returned monitor to indicate the time that the process took. Note time monitors keep the starttime as an instance variable and so every time you want to use a TimeMonitor you should get a new instance.

Sample call:
 Monitor mon=MonitorFactory.start();
...code being timed...
mon.stop();





start
public static Monitor start(MonKey key)(Code)
Start using the passed in key. Note activity stats are incremented



startPrimary
public static Monitor startPrimary(String label)(Code)

Return a timing monitor with units in milliseconds, that is not aggregated into the jamon stats. The concept of primary allows you to correlate performance of all monitors with the most resource intensive things the app does which helps you determine scalability.

Sample call:
 Monitor mon=MonitorFactory.startPrimary("myPrimaryMonitor");
...code being timed...
mon.stop();





startPrimary
public static Monitor startPrimary(MonKey key)(Code)
Start a monitor with the specified key and mark it as primary



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.