getCompositeNode(String childNodeName) This is CompositeNode interface method that returns the child MonitorComposite identified by the given label or it creates a
new CompositeMonitor.
getCompositeNodeKey(String nodeName) getCompositeNodeKey(...) and getLeafNodeKey(...) are used to ensure that composite nodes are not replaced by leaf nodes
and vice versa.
getLeafNode(String childNodeName, String childNodeType) This is CompositeNode interface method that returns a leaf node identified by the given label or it creates a
new leaf node by calling the Leaf.
getLeafNodeKey(String nodeName) getCompositeNodeKey(...) and getLeafNodeKey(...) are used to ensure that composite nodes are not replaced by leaf nodes
and vice versa.
getReport(int sortCol, String sortOrder) Return the contents of this MonitorComposite as an HTML table sorted by the specified column number in ascending or descending order.
setDisplayDelimiter(String localDisplayDelimiter) Delimiter to be used when displaying the monitor label returned by the getReport() and getData() methods.
Add a LeafNode to the data structure if it doesn't exist. *
compositeNodeExists
public boolean compositeNodeExists(String childNodeName)(Code)
Does the passed in CompositeNode exist. Returns true if there has been a CompositeNode created with this label.
Sample Call:
monitorComposite.compositeNodeExists("myApp.jsp");
Returns the accrued value of all Monitors underneath this MonitorComposite. Note this method will recursively call
getAccrued() for any nested MonitorComposites. Note this method uses the Gang of 4's Command pattern.
This is CompositeNode interface method that returns the child MonitorComposite identified by the given label or it creates a
new CompositeMonitor. This method is used by the factory classes to create MonitorComposites.
Sample Call:
monitorComposite.getCompositeNode("myApp.jsp")
getCompositeNodeKey(...) and getLeafNodeKey(...) are used to ensure that composite nodes are not replaced by leaf nodes
and vice versa. For example the following 2 entries could both be simultaneously valid even though their labels are
identical.
Leaf Node: pages.homePage
Composite Node: pages.homePage
This is because leafs and composites have different keys behind the scenes. Using the example above the
keys may look something like:
Leaf Node Key: pagesC.homePageL
Composite Node: pagesC.homePageC
Return the contents of this MonitorComposite as a 2 dimensional array of Strings. This is the data minus the formatting of
what is returned by the getReport() method.
Return the contents of this MonitorComposite as a 2 dimensional array of Strings. The passed "label" will be prepended to the
first column in the array.
Sample Call:
String[][] arr=monitorComposite.getData("myLabel");
This is CompositeNode interface method that returns a leaf node identified by the given label or it creates a
new leaf node by calling the Leaf. This method is used by the factory classes to create TimingMonitors.
Sample Call:
monitorComposite.getCompositeNode("myApp.jsp");
getCompositeNodeKey(...) and getLeafNodeKey(...) are used to ensure that composite nodes are not replaced by leaf nodes
and vice versa. For example the following 2 entries could both be simultaneously valid even though their labels are
identical.
Leaf Node: pages.homePage
Composite Node: pages.homePage
This is because leafs and composites have different keys behind the scenes. Using the example above the
keys may look something like:
Leaf Node Key: pagesC.homePageL
Composite Node: pagesC.homePageC
Return the contents of this MonitorComposite as an HTML table. This method is called to display the data in a MonitorComposite
in a servlet or JSP. See www.jamonapi.com for a sample of what the report shoud look like.
Sample Call:
String html=monitorComposite.getReport();
Return the contents of this MonitorComposite as an HTML table sorted by the specified column number in ascending or descending order.
This method is called to display the data in a MonitorComposite in a servlet or JSP. See www.jamonapi.com for a sample of what
the report shoud look like.
Sample Call:
String html=monitorComposite.getReport(2, "asc"); // return the html report sorted by column 2 in ascending order
public boolean leafNodeExists(String childNodeName)(Code)
Does the passed in leaf node exist. Returns true if there has been a LeafNode created with this label.
Sample Call:
monitorComposite.leafNodeExists("myApp.jsp.homePage");
Call reset() on all Monitors that this MonitorComposite instance contains *
setDisplayDelimiter
public static void setDisplayDelimiter(String localDisplayDelimiter)(Code)
Delimiter to be used when displaying the monitor label returned by the getReport() and getData() methods. The default is a period.
A better approach would have been to simply display the delimeter that was used on the MonitorComposites creation