[Mc4j-cvs] mc4j/src/org/mc4j/chires/components/flow FlowModelProfilerViewComponent.java,1.1,1.2 Prof
Brought to you by:
ghinkl
From: Greg H. <gh...@us...> - 2006-04-12 19:14:11
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/chires/components/flow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/chires/components/flow Added Files: FlowModelProfilerViewComponent.java ProfilerViewComponent.java ProfilerModel.java FlowModelTreeTableModel.java Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: FlowModelTreeTableModel.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.mc4j.console.swing.treetable.AbstractTreeTableModel; import org.mc4j.console.swing.treetable.TreeTableModel; import org.jfree.data.statistics.Statistics; import javax.management.j2ee.statistics.CountStatistic; import javax.management.j2ee.statistics.TimeStatistic; import javax.management.j2ee.statistics.Stats; import javax.management.j2ee.statistics.Statistic; import java.util.Arrays; /** * @author Greg Hinkle (gh...@us...), Nov 18, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:00 $) */ public class FlowModelTreeTableModel extends AbstractTreeTableModel { // Names of the columns. static protected String[] cNames = {"Name", "Calls", "Time", "Throws"}; static protected int[] cWidth = { 250, 40, 80, 40 }; // Types of the columns. static protected Class[] cTypes = { TreeTableModel.class, Long.class, String.class, String.class }; public FlowModelTreeTableModel(FlowEntryStats root) { super(root); } public void updateRoot(FlowEntryStats newRoot) { // TODO GH: Support the update of the stats (ugh) FlowEntryStats oldRoot = (FlowEntryStats) super.root; Statistic[] oldMethodStatistics = oldRoot.getStatistics(); Statistic[] newMethodStatistics = newRoot.getStatistics(); /*if (!Arrays.equals(oldMethodStatistics, newMethodStatistics)) { fireTreeNodesChanged(this,); }*/ super.root = newRoot; fireTreeStructureChanged(this, new Object[] { super.root }, null,null); } public Class getColumnClass(int column) { return cTypes[column]; } public int getColumnCount() { return cNames.length; } public String getColumnName(int column) { return cNames[column]; } public int getColumnWidth(int column) { return cWidth[column]; } public Object getValueAt(Object node, int column) { FlowEntryStats stat = (FlowEntryStats) node; Object value = null; TimeStatistic timeStatistic = (TimeStatistic) stat.getStatistic("Execution Time"); CountStatistic failureStatistic = (CountStatistic) stat.getStatistic("Execution Failures"); switch(column) { case 0: value = stat.toString(); break; case 1: value = new Long(timeStatistic.getCount()); break; case 2: value = getTime(timeStatistic.getTotalTime()); break; case 3: value = new Long(failureStatistic.getCount()); break; } return value; } public Object getChild(Object parent, int index) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); if (children.length > index) return children[index]; return null; } public int getChildCount(Object parent) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); return children!=null?children.length:0; } public String getTime(long ms) { long mins = ms / (1000*60); long secs = (ms - (mins * 1000 * 60)) / 1000; long millis = ms - (mins * 1000 * 60) - (secs * 1000); StringBuffer buf = new StringBuffer(); if (millis > 0) { buf.append(millis); buf.append(" ms"); } if (secs > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " secs"); buf.insert(0, secs); } if (mins > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " mins"); buf.insert(0, mins); } return buf.toString(); } } --- NEW FILE: ProfilerViewComponent.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.chires.model.history.flow.FlowStats; import org.chires.model.stack.BaseCallEntry; import org.mc4j.console.dashboard.components.BeanComponent; import org.mc4j.console.util.NodeUtil; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.jdesktop.swing.decorator.HighlighterPipeline; import org.jdesktop.swing.decorator.Highlighter; import org.jdesktop.swing.decorator.HierarchicalColumnHighlighter; import org.jdesktop.swing.decorator.AlternateRowHighlighter; import org.jdesktop.jdnc.JNTreeTable; import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; import javax.management.j2ee.statistics.TimeStatistic; import java.awt.*; import java.util.Map; /** * @author Greg Hinkle (gh...@us...), Sep 14, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:00 $) */ public class ProfilerViewComponent extends JPanel implements BeanComponent { EmsBean emsBean; EmsAttribute statsAttribute; FlowStats stats; // private JScrollPane jScrollPane; // private JXTreeTable treeTable; private JNTreeTable treeTableView; private ProfilerModel treeTableModel; /** Creates new form ObjectFrame */ public ProfilerViewComponent() { // initComponents(); //this.setName("Flow Model Profiler"); } public static void main(String[] args) { ProfilerViewComponent view = new ProfilerViewComponent(); view.stats = new FlowStats(); BaseCallEntry a = new BaseCallEntry("A", "Class1", "method1"); BaseCallEntry b,c,d; b = new BaseCallEntry("A", "Class2", "method2"); b.addChildEntry(new BaseCallEntry("A","Class3","method4")); a.addChildEntry(b); a.addChildEntry(new BaseCallEntry("A","Class2", "method3")); view.stats.registerCallStack(a); view.stats.registerCallStack(new BaseCallEntry("A", "Class1", "method2")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method3")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method4")); view.loadTree(); JFrame frame = new JFrame(); frame.getContentPane().add(view); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400,400); frame.setVisible(true); } public void setBean(EmsBean emsBean) { this.emsBean = emsBean; } public void setContext(Map context) { if (this.emsBean == null) { throw new IllegalStateException( "FlowModelProfilerViewComponent: attribute [emsBean] must be set with a Flow Model bean"); } statsAttribute = emsBean.getAttribute("stats"); retrieveData(); loadTree(); expandAll(); } private void retrieveData() { statsAttribute.refresh(); stats = (FlowStats) statsAttribute.getValue(); } public void refresh() { retrieveData(); treeTableModel.updateRoot(stats.getFlowEntryStats()[0]); repaint(); expandAll(); } private void expandAll() { treeTableView.expandAll(); } private void loadTree() { // TODO GH: Only loading the first child... not the root treeTableModel = new ProfilerModel(stats.getFlowEntryStats()[0]); this.treeTableView = new JNTreeTable(treeTableModel); this.treeTableView.setHasColumnControl(true); Highlighter alternateRowHighlighter = new AlternateRowHighlighter(); // Color fg = alternateRowHighlighter.getForeground(); // Color bg = alternateRowHighlighter.getBackground(); HierarchicalColumnHighlighter hierarchicalColumnHighlighter = new HierarchicalColumnHighlighter(/*fg, bg*/); HighlighterPipeline h = new HighlighterPipeline( new Highlighter[] { alternateRowHighlighter, hierarchicalColumnHighlighter}); this.treeTableView.setHighlighters(h); Icon icon = getIcon(); this.treeTableView.setOpenIcon(icon); // this.treeTableView.setClosedIcon(icon); // this.treeTableView.setCollapsedIcon(icon); // this.treeTableView.setLeafIcon(icon); this.treeTableView.getTreeTable().getColumnModel().getColumn(2).setCellRenderer(new TimeChartCellRenderer()); setLayout(new BorderLayout()); add(this.treeTableView,BorderLayout.CENTER); } public Icon getIcon() { return NodeUtil.getIcon("org/mc4j/console/mejb/img/Clock24.gif"); } public class TimeCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Long t = (Long) value; FlowEntryStats rootStats = (FlowEntryStats) treeTableModel.getRoot(); TimeStatistic totalTime = (TimeStatistic) rootStats.getStatistic("Execution Time"); double size = ((double)t.longValue()) / ((double)totalTime.getTotalTime()) ; setIcon(NodeUtil.scaleIcon("org/mc4j/console/mejb/img/Clock24.gif", size)); setHorizontalTextPosition(SwingConstants.LEFT); return this; } } public class TimeChartCellRenderer extends DefaultTableCellRenderer { TimeComponent timeComponent = new TimeComponent(); public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { //super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Long t = (Long) value; FlowEntryStats rootStats = (FlowEntryStats) treeTableModel.getRoot(); TimeStatistic totalTime = (TimeStatistic) rootStats.getStatistic("Execution Time"); double size = ((double)t.longValue()) / ((double)totalTime.getTotalTime()) ; timeComponent.setGraphLength(size); return timeComponent; } public class TimeComponent extends JComponent { double percentage; public void setGraphLength(double percentage) { this.percentage = percentage; } protected void paintComponent(Graphics g) { int a = (int) (percentage * getWidth()); g.setColor(Color.green); g.fillRect(0,0,a,getHeight()); g.setColor(Color.blue); g.fillRect(a,0,getWidth()-a,getHeight()); } } } /*public static class TimeHighlighter extends Highlighter { protected Component doHighlight(Component component, ComponentAdapter componentAdapter) { return component; } }*/ // TODO GH: When JDNC supports custom treetable tree column editors, support variable clock size on node } --- NEW FILE: FlowModelProfilerViewComponent.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.chires.model.history.flow.FlowStats; import org.chires.model.stack.BaseCallEntry; import org.mc4j.console.dashboard.components.BeanComponent; import org.mc4j.console.swing.treetable.JTreeTable; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import javax.swing.*; import javax.swing.table.TableColumn; import javax.swing.table.DefaultTableColumnModel; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Map; /** * @author Greg Hinkle (gh...@us...), Sep 14, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:00 $) */ public class FlowModelProfilerViewComponent extends JPanel implements BeanComponent { EmsBean emsBean; EmsAttribute statsAttribute; FlowStats stats; private javax.swing.JScrollPane jScrollPane; private JTreeTable treeTable; private FlowModelTreeTableModel treeTableModel; /** Creates new form ObjectFrame */ public FlowModelProfilerViewComponent() { initComponents(); //this.setName("Flow Model Profiler"); } public static void main(String[] args) { FlowModelProfilerViewComponent view = new FlowModelProfilerViewComponent(); view.stats = new FlowStats(); BaseCallEntry a = new BaseCallEntry("A", "Class1", "method1"); BaseCallEntry b,c,d; b = new BaseCallEntry("A", "Class2", "method2"); b.addChildEntry(new BaseCallEntry("A","Class3","method4")); a.addChildEntry(b); a.addChildEntry(new BaseCallEntry("A","Class2", "method3")); view.stats.registerCallStack(a); view.stats.registerCallStack(new BaseCallEntry("A", "Class1", "method2")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method3")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method4")); view.loadTree(); JFrame frame = new JFrame(); frame.getContentPane().add(view); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400,400); frame.setVisible(true); } public void setBean(EmsBean emsBean) { this.emsBean = emsBean; } public void setContext(Map context) { if (this.emsBean == null) { throw new IllegalStateException( "FlowModelProfilerViewComponent: attribute [emsBean] must be set with a Flow Model bean"); } statsAttribute = emsBean.getAttribute("stats"); retrieveData(); loadTree(); expandAll(); } private void retrieveData() { statsAttribute.refresh(); stats = (FlowStats) statsAttribute.getValue(); } public void refresh() { retrieveData(); treeTableModel.updateRoot(stats.getFlowEntryStats()[0]); repaint(); expandAll(); } private void expandAll() { JTree tree = treeTable.getTree(); int count = tree.getRowCount(); for (int i=0;i<count;i++) { tree.expandRow(i); count = tree.getRowCount(); } } private void loadTree() { // TODO GH: Only loading the first child... not the root treeTableModel = new FlowModelTreeTableModel(stats.getFlowEntryStats()[0]); this.treeTable = new JTreeTable(treeTableModel); //this.tree = new JTree(treeTableModel); this.jScrollPane.setViewportView(treeTable); DefaultTableColumnModel cm = new DefaultTableColumnModel(); for (int i = 0; i < treeTableModel.getColumnCount();i++) { TableColumn column = new TableColumn(i,treeTableModel.getColumnWidth(i)); if (i>0) column.setPreferredWidth(treeTableModel.getColumnWidth(i)); column.setHeaderValue(treeTableModel.getColumnName(i)); cm.addColumn(column); } this.treeTable.setColumnModel(cm); //this.treeTable.getColumnModel().getColumn(0).setCellRenderer(new DefaultT); //this.treeTable.getTree().setCellRenderer(new DefaultTreeCellRenderer()); // this.treeTable.getTree().setCellRenderer(new CustomTreeTableCellRenderer()); // this.treeTable.getTree().setRootVisible(true); // this.treeTable.addMouseListener(new MouseHandler()); // this.treeTable.setRowHeight(22); this.jScrollPane.getComponent(0).setBackground(Color.white); this.jScrollPane.repaint(); } // private static Icon folderIcon = createImageIcon("images/FolderIcon.gif"); public class CustomTreeTableCellRenderer extends DefaultTreeCellRenderer { public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); // TODO GH: Set icon return this; } } /** This method is called from within the constructor to * initialize the form. */ private void initComponents() { setLayout(new BorderLayout()); jScrollPane = new javax.swing.JScrollPane(); add(jScrollPane, BorderLayout.CENTER); } class MouseHandler extends MouseAdapter { public void mousePressed (MouseEvent e) { if (e.isPopupTrigger () && e.getClickCount () == 1) { doPopup (e.getX (), e.getY ()); } } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger () && e.getClickCount () == 1) { doPopup (e.getX (), e.getY ()); } } public void doPopup (int x, int y) { // Get the tree element under the mouse TreePath clickedElement = treeTable.getTree().getPathForLocation (x, y); // Update the selection if necessary updateSelection (clickedElement); // Display the name of the selected tree element in the selection field String clickedElementName; if (clickedElement != null) clickedElementName = clickedElement.getLastPathComponent ().toString (); else clickedElementName = "NONE"; //currentSelectionField.setText ("Display Popup for: " + clickedElementName); // Get the desired context menu and show it JPopupMenu contextMenu = retrieveContextMenu (clickedElement); contextMenu.show (treeTable, x, y); } private JPopupMenu retrieveContextMenu (TreePath clickedElement) { JPopupMenu contextMenu; if (clickedElement != null) contextMenu = retrieveElementContextMenu (clickedElement); else contextMenu = retrieveTreeContextMenu (); if (contextMenu != null) { // This is the code that attempts but fails to shrink the menu to fit the current commands // Make sure the size of the menu is uptodate with any chages made to its actions before display contextMenu.invalidate (); contextMenu.pack (); } return contextMenu; } private JPopupMenu retrieveElementContextMenu (TreePath clickedElement) { if (clickedElement == null) return null; final FlowEntryStats stats = (FlowEntryStats) clickedElement.getLastPathComponent(); JPopupMenu contextMenu = null; contextMenu = new JPopupMenu("Tree Actions"); /*if (!treeNode.isFolder()) { JMenuItem editItem = new JMenuItem("Edit configuration"); editItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { IOProvider.getDefault().getStdOut().println("Editing document: " + treeNode.getPath()); treeTableModel.loadConfigurationNode(treeNode); ConfigurationEditor ce = new ConfigurationEditor(treeNode.getConfig()); ce.open(); } }); contextMenu.add(editItem); } else { JMenuItem refreshItem = new JMenuItem("Refresh folder"); refreshItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); contextMenu.add(refreshItem); }*/ return contextMenu; } private JPopupMenu retrieveTreeContextMenu () { JPopupMenu treeMenu = new JPopupMenu ("Tree Context Menu"); return treeMenu; } private void updateSelection (TreePath clickedElement) { // Find out if the clicked on element is already selected boolean clickedElementSelected = false; TreePath[] selection = treeTable.getTree().getSelectionPaths (); if (clickedElement != null && selection != null) { // Determine if it one of the selected paths for (int index = 0; index < selection.length; ++index) { if (clickedElement.equals (selection[index])) { clickedElementSelected = true; break; } } } // Select the clicked on element or clear all selections if (!clickedElementSelected) { if (clickedElement != null) { // Clicked on unselected item - make it the selection treeTable.getTree().setSelectionPath (clickedElement); } else { // clicked over nothing clear the selection treeTable.getTree().clearSelection (); } } } } } --- NEW FILE: ProfilerModel.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.chires.stat.ChiresTimeStatistic; import org.jfree.data.statistics.Statistics; import org.jdesktop.swing.treetable.AbstractTreeTableModel; import org.jdesktop.swing.treetable.TreeTableModel; import javax.management.j2ee.statistics.CountStatistic; import javax.management.j2ee.statistics.TimeStatistic; import javax.management.j2ee.statistics.Stats; import javax.management.j2ee.statistics.Statistic; import java.util.Arrays; import java.util.List; /** * @author Greg Hinkle (gh...@us...), Nov 18, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:00 $) */ public class ProfilerModel extends AbstractTreeTableModel { // Names of the columns. static protected String[] cNames = {"Name", "Calls", "Time (ms)", "Throws"}; static protected int[] cWidth = { 250, 40, 80, 40 }; // Types of the columns. static protected Class[] cTypes = { TreeTableModel.class, Long.class, Long.class, String.class }; public ProfilerModel(FlowEntryStats root) { super(root); } public void updateRoot(FlowEntryStats newRoot) { // TODO GH: Support the update of the stats (ugh) FlowEntryStats oldRoot = (FlowEntryStats) super.root; Statistic[] oldMethodStatistics = oldRoot.getStatistics(); Statistic[] newMethodStatistics = newRoot.getStatistics(); /*if (!Arrays.equals(oldMethodStatistics, newMethodStatistics)) { fireTreeNodesChanged(this,); }*/ super.root = newRoot; fireTreeStructureChanged(this, new Object[] { super.root }, null,null); } private void updateNode(FlowEntryStats oldStats, FlowEntryStats newStats) { if (!Arrays.equals(oldStats.getStatistics(),newStats.getStatistics())) { } FlowEntryStats[] oldChildren = oldStats.getFlowEntryStats(); FlowEntryStats[] newChildren = newStats.getFlowEntryStats(); for (int i = 0; i < oldChildren.length; i++) { if (oldChildren[i].getClassName() != newChildren[i].getClassName() || oldChildren[i].getMethodName() != newChildren[i].getMethodName()) { } } } public Class getColumnClass(int column) { return cTypes[column]; } public int getColumnCount() { return cNames.length; } public String getColumnName(int column) { return cNames[column]; } public int getColumnWidth(int column) { return cWidth[column]; } public Object getValueAt(Object node, int column) { FlowEntryStats stat = (FlowEntryStats) node; Object value = null; TimeStatistic timeStatistic = (TimeStatistic) stat.getStatistic("Execution Time"); CountStatistic failureStatistic = (CountStatistic) stat.getStatistic("Execution Failures"); switch(column) { case 0: value = stat.toString(); break; case 1: value = new Long(timeStatistic.getCount()); break; case 2: value = new Long(timeStatistic.getTotalTime()); break; case 3: value = new Long(failureStatistic.getCount()); break; } return value; } public void setValueAt(Object o, Object o1, int i) { } public Object getChild(Object parent, int index) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); if (children.length > index) return children[index]; return null; } public int getChildCount(Object parent) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); return children!=null?children.length:0; } public String getTime(long ms) { long mins = ms / (1000*60); long secs = (ms - (mins * 1000 * 60)) / 1000; long millis = ms - (mins * 1000 * 60) - (secs * 1000); StringBuffer buf = new StringBuffer(); if (millis > 0) { buf.append(millis); buf.append(" ms"); } if (secs > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " secs"); buf.insert(0, secs); } if (mins > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " mins"); buf.insert(0, mins); } return buf.toString(); } public static class CallInfoNode { long totalExecutionCount; long totalExecutionTime; long failureCount; String className; String methodName; List<CallInfoNode> callInfoNodes; public CallInfoNode(FlowEntryStats stats) { TimeStatistic timeStatistic = (TimeStatistic) stats.getStatistic("Execution Time"); CountStatistic failureStatistic = (CountStatistic) stats.getStatistic("Execution Failures"); ChiresTimeStatistic ts = new ChiresTimeStatistic(timeStatistic); } } } |