You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(73) |
Sep
(92) |
Oct
(9) |
Nov
(80) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(92) |
Feb
(52) |
Mar
(71) |
Apr
(64) |
May
(53) |
Jun
(10) |
Jul
(111) |
Aug
(93) |
Sep
(134) |
Oct
|
Nov
|
Dec
|
From: Lukas P. <pe...@us...> - 2002-09-03 17:50:49
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv16002 Modified Files: Bundle.properties Added Files: ShowHistogram.java Log Message: Show Histogram --- NEW FILE: ShowHistogram.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.actions; import org.openide.util.actions.NodeAction; import org.openide.util.HelpCtx; import org.openide.nodes.Node; import org.openide.windows.TopComponent; import java.awt.BorderLayout; import java.awt.Dimension; import net.sourceforge.javaprofiler.module.nodes.*; import net.sourceforge.javaprofiler.module.views.*; import net.sourceforge.javaprofiler.jpi.Snapshot; import net.sourceforge.javaprofiler.jpi.Constants; import javax.swing.JTable; import javax.swing.JScrollPane; import java.util.ResourceBundle; import org.openide.util.NbBundle; public class ShowHistogram extends NodeAction { private static ResourceBundle bundle=NbBundle.getBundle(ShowHistogram.class ); protected boolean enable(Node[] activatedNodes) { if (activatedNodes.length!=1 || !(activatedNodes[0] instanceof PSelectorNode)) return false; return (activatedNodes[0].getParentNode() instanceof SnapshotNode2); } protected void performAction(Node[] activatedNodes) { if (activatedNodes.length!=1 || !(activatedNodes[0] instanceof PSelectorNode)) return; if (!(activatedNodes[0].getParentNode() instanceof SnapshotNode2)) return; final Snapshot sn=((SnapshotNode2) activatedNodes[0].getParentNode()) .getSnapshot().getSnapshot(); class HistogramTopComponent extends TopComponent { HistogramTopComponent() { setName("Histogram"); setToolTipText("Histogram of Allocation"); setLayout(new BorderLayout()); //when you stop using model call model.dispose() TableClickSorter sortedModel = new AllocTableClickSorter( new AllocHistogramTableModel(sn.getTypes(), sn, Constants.TYPE)); JTable table = new AllocHistogramTable( sortedModel ); sortedModel.addMouseListenerToHeaderInTable(table); table.setPreferredScrollableViewportSize(new Dimension(400, 400) ); JScrollPane scrollPane = new JScrollPane( table ); add( scrollPane, BorderLayout.CENTER); } } TopComponent panel=new HistogramTopComponent(); panel.open(); } public String getName() { return bundle.getString("LBL_ShowHistogram"); } public HelpCtx getHelpCtx() { return new HelpCtx(getClass()); } } /* * $Log: ShowHistogram.java,v $ * Revision 1.1 2002/09/03 17:50:46 petrul * Show Histogram * */ Index: Bundle.properties =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions/Bundle.properties,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** Bundle.properties 31 Aug 2002 08:39:41 -0000 1.7 --- Bundle.properties 3 Sep 2002 17:50:46 -0000 1.8 *************** *** 61,65 **** LBL_terminateAction=Terminate HINT_terminateAction=Terminates listening for the connection from the profiled process. ! LBL_CTAction=Open Call Tree ! LBL_BTAction=Open Backtrace ! LBL_ShowTable=Show Table \ No newline at end of file --- 61,64 ---- LBL_terminateAction=Terminate HINT_terminateAction=Terminates listening for the connection from the profiled process. ! LBL_ShowTable=Show Table ! LBL_ShowHistogram=Show Histogram |
From: Lukas P. <pe...@us...> - 2002-09-03 17:50:22
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv15796 Modified Files: ShowTable.java Log Message: changed column size Index: ShowTable.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions/ShowTable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** ShowTable.java 31 Aug 2002 08:39:41 -0000 1.1 --- ShowTable.java 3 Sep 2002 17:50:18 -0000 1.2 *************** *** 46,49 **** --- 46,50 ---- import java.util.ResourceBundle; import org.openide.util.NbBundle; + import javax.swing.JTable; public class ShowTable extends NodeAction { *************** *** 55,60 **** return false; int type=((PSelectorNode) activatedNodes[0]).getType(); ! return InterfaceRepository.hasAlloc(type) || ! InterfaceRepository.hasCPU(type)||InterfaceRepository.hasMon(type); } --- 56,64 ---- return false; int type=((PSelectorNode) activatedNodes[0]).getType(); ! if (! (InterfaceRepository.hasAlloc(type) || ! InterfaceRepository.hasCPU(type) || ! InterfaceRepository.hasMon(type)) ) ! return false; ! return ! activatedNodes[0].isLeaf(); } *************** *** 77,80 **** --- 81,88 ---- MonStatProperty.addProperties(set, null); view.setProperties(set.getProperties()); + int colCount=set.getProperties().length; + if (colCount<5) + for (int i=0; i<colCount; i++) + view.setTableColumnPreferredWidth(i, 80); } } *************** *** 95,98 **** --- 103,109 ---- /* * $Log$ + * Revision 1.2 2002/09/03 17:50:18 petrul + * changed column size + * * Revision 1.1 2002/08/31 08:39:41 petrul * action Show Table |
From: Lukas P. <pe...@us...> - 2002-09-03 17:48:54
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl In directory usw-pr-cvs1:/tmp/cvs-serv15162 Modified Files: VirtualMachineImpl.java Log Message: changed constructor code Index: VirtualMachineImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/VirtualMachineImpl.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** VirtualMachineImpl.java 23 Aug 2002 18:07:29 -0000 1.13 --- VirtualMachineImpl.java 3 Sep 2002 17:48:50 -0000 1.14 *************** *** 47,54 **** */ public VirtualMachineImpl(IProf iprof) { ! this.iprof=iprof; ! ImageR rt = new ImageR( iprof, false ); ! realtime = rt; ! rt.getTimer().schedule(rt.getTimerTask(), 1000, 1000); } --- 47,51 ---- */ public VirtualMachineImpl(IProf iprof) { ! this(iprof, null); } *************** *** 62,65 **** --- 59,65 ---- this.iprof=iprof; this.process=process; + ImageR rt = new ImageR( iprof, false ); + realtime = rt; + rt.getTimer().schedule(rt.getTimerTask(), 1000, 1000); } *************** *** 281,284 **** --- 281,287 ---- /* * $Log$ + * Revision 1.14 2002/09/03 17:48:50 petrul + * changed constructor code + * * Revision 1.13 2002/08/23 18:07:29 petrul * Refreshing thread scheduling and cancelling. |
From: Lukas P. <pe...@us...> - 2002-09-03 17:48:11
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime In directory usw-pr-cvs1:/tmp/cvs-serv14848 Modified Files: ImageR.java Log Message: changed thrown exceptions Index: ImageR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/ImageR.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** ImageR.java 20 Aug 2002 18:59:19 -0000 1.14 --- ImageR.java 3 Sep 2002 17:48:08 -0000 1.15 *************** *** 255,260 **** ).getDeclaredConstructor(mrParameterTypes); } catch (ClassNotFoundException e) { ! // PENDING ! throw new RuntimeException(e.getMessage()); } catch (NoSuchMethodException e) { // PENDING --- 255,259 ---- ).getDeclaredConstructor(mrParameterTypes); } catch (ClassNotFoundException e) { ! throw new LinkageError(e.getMessage()); } catch (NoSuchMethodException e) { // PENDING *************** *** 310,316 **** itChildren = wrappedGetChangedThruIterator(parentId.intValue(), direction, true, true, IProf.NO_OPTIONAL_ARG, true); } catch (IProfException e) { ! // PENDING ! throw new RuntimeException(e.getMessage()); } int old=list.size(); --- 309,316 ---- itChildren = wrappedGetChangedThruIterator(parentId.intValue(), direction, true, true, IProf.NO_OPTIONAL_ARG, true); + } catch (COMMUN_Exception e) { + throw new VMDisconnectedException(e.toString()); } catch (IProfException e) { ! throw new RuntimeException(e.toString()); } int old=list.size(); |
From: Lukas P. <pe...@us...> - 2002-09-03 17:47:08
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv14534 Modified Files: TypeData.java Log Message: name of type changed Index: TypeData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/TypeData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** TypeData.java 2 Sep 2002 15:25:47 -0000 1.6 --- TypeData.java 3 Sep 2002 17:47:05 -0000 1.7 *************** *** 82,110 **** break; case IProf.JVMPI_CLASS: ! name = "[" + componentClass.getName(); break; case IProf.JVMPI_BOOLEAN: ! name = "[Z"; break; case IProf.JVMPI_BYTE: ! name = "[B"; break; case IProf.JVMPI_CHAR: ! name = "[C"; break; case IProf.JVMPI_SHORT: ! name = "[S"; break; case IProf.JVMPI_INT: ! name = "[I"; break; case IProf.JVMPI_LONG: ! name = "[J"; break; case IProf.JVMPI_FLOAT: ! name = "[F"; break; case IProf.JVMPI_DOUBLE: ! name = "[D"; break; default: --- 82,110 ---- break; case IProf.JVMPI_CLASS: ! name = componentClass.getName() + "[]"; break; case IProf.JVMPI_BOOLEAN: ! name = "boolean[]"; //[Z break; case IProf.JVMPI_BYTE: ! name = "byte[]"; //[B break; case IProf.JVMPI_CHAR: ! name = "char[]"; //[C break; case IProf.JVMPI_SHORT: ! name = "short[]"; //[S break; case IProf.JVMPI_INT: ! name = "int[]"; //[I break; case IProf.JVMPI_LONG: ! name = "long[]";//[J break; case IProf.JVMPI_FLOAT: ! name = "float[]"; //[F break; case IProf.JVMPI_DOUBLE: ! name = "double[]"; //[D break; default: *************** *** 313,316 **** --- 313,319 ---- /* * $Log$ + * Revision 1.7 2002/09/03 17:47:05 petrul + * name of type changed + * * Revision 1.6 2002/09/02 15:25:47 vachis * copy contrcutors for difference of snapshot |
From: Lukas P. <pe...@us...> - 2002-09-03 17:45:14
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect In directory usw-pr-cvs1:/tmp/cvs-serv13878 Added Files: LibrarySettings.java Log Message: library settings --- NEW FILE: LibrarySettings.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License Version * 1.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is available at http://www.sun.com/ * * The Original Code is the Java Profiler module. * The Initial Developers of the Original Code are Jan Stola, Pavel Vacha, * Michal Pise, Petr Luner, Lukas Petru and Marek Przeczek. * Portions created by Jan Stola are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Pavel Vacha are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Michal Pise are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Petr Luner are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Lukas Petru are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Marek Przeczek are Copyright (C) 2000-2001. All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.jpiimpl.connect; public class LibrarySettings { public final int ALLOC=1; public final int ALLOC_LEVEL=2; public final int ALLOC_LEVEL_OBJECT=26; public final int ALLOC_LEVEL_METHOD=27; public final int ALLOC_LEVEL_TRACE=28; public final int ALLOC_TRACE_DEPTH=3; public final int ALLOC_THREAD=4; public final int ALLOC_LINE=5; public final int CPU=6; public final int CPU_METHOD=7; public final int CPU_METHOD_EXACT=29; public final int CPU_METHOD_SAMPLING=30; public final int CPU_LEVEL=8; public final int CPU_LEVEL_METHOD=31; public final int CPU_LEVEL_TRACE=32; public final int CPU_TRACE_DEPTH=9; public final int CPU_THREAD=10; public final int CPU_LINE=11; public final int CPU_CALLTREE=12; public final int CPU_CALLTREE_LINE=13; public final int MON=14; public final int MON_LEVEL=15; public final int MON_LEVEL_METHOD=33; public final int MON_LEVEL_TRACE=34; public final int MON_TRACE_DEPTH=16; public final int MON_THREAD=17; public final int MON_LINE=18; public final int COMMUN_TYPE=19; public final int COMMUN_TYPE_SOCKET=35; public final int COMMUN_TYPE_SHMEM=36; public final int COMMUN_HOST=20; public final int COMMUN_PORT=21; public final int COMMUN_SHMEM_ID=22; public final int COMMUN_SHMEM_SIZE=23; public final int CONNECT_MODE=24; public final int CONNECT_MODE_SERVER=37; public final int CONNECT_MODE_CLIENT=38; public final int VERBOSE=25; private Object[] properties; LibrarySettings() { // all is disabled after constructor is called properties=new Object[26]; properties[ALLOC]=new Boolean(false); properties[ALLOC_THREAD]=new Boolean(true); properties[ALLOC_LINE]=new Boolean(true); properties[CPU]=new Boolean(false); properties[CPU_THREAD]=new Boolean(true); properties[CPU_LINE]=new Boolean(true); properties[CPU_CALLTREE]=new Boolean(false); properties[CPU_CALLTREE_LINE]=new Boolean(false); properties[MON]=new Boolean(false); properties[MON_THREAD]=new Boolean(true); properties[MON_LINE]=new Boolean(true); properties[VERBOSE]=new Boolean(true); properties[ALLOC_LEVEL]=new Integer(ALLOC_LEVEL_TRACE); properties[ALLOC_TRACE_DEPTH]=new Integer(2); properties[CPU_METHOD]=new Integer(CPU_METHOD_SAMPLING); properties[CPU_LEVEL]=new Integer(CPU_LEVEL_TRACE); properties[CPU_TRACE_DEPTH]=new Integer(2); properties[MON_LEVEL]=new Integer(MON_LEVEL_TRACE); properties[MON_TRACE_DEPTH]=new Integer(2); properties[COMMUN_TYPE]=new Integer(COMMUN_TYPE_SOCKET); properties[COMMUN_PORT]=new Integer(25595); properties[COMMUN_SHMEM_SIZE]=new Integer(262144); properties[CONNECT_MODE]=new Integer(CONNECT_MODE_SERVER); properties[COMMUN_HOST]="127.0.0.1"; properties[COMMUN_SHMEM_ID]="com"; } public void enableProperty(int prop) { enableProperty(prop, true); } public void enableProperty(int prop, boolean enable) { Object val=getProperty(prop); if (val instanceof Boolean) properties[prop]=new Boolean(enable); else throw new IllegalArgumentException("Not a boolean property."); } public void setProperty(int prop, int val) { Object old=getProperty(prop); if (old instanceof Integer) { checkConstrained(prop, val); properties[prop]=new Integer(val); } else throw new IllegalArgumentException("Not an int property."); } public void setProperty(int prop, String val) { Object old=getProperty(prop); if (old instanceof String) properties[prop]=val; else throw new IllegalArgumentException("Not a String property."); } private void checkConstrained(int prop, int val) throws IllegalArgumentException { boolean valid=false; switch (prop) { case ALLOC_LEVEL: valid = val==ALLOC_LEVEL_OBJECT || val==ALLOC_LEVEL_METHOD || val==ALLOC_LEVEL_TRACE; break; case CPU_METHOD: valid = val==CPU_METHOD_EXACT || val==CPU_METHOD_SAMPLING; break; case CPU_LEVEL: valid = val==CPU_LEVEL_METHOD || val==CPU_LEVEL_TRACE; break; case MON_LEVEL: valid = val==MON_LEVEL_METHOD || val==MON_LEVEL_TRACE; break; case COMMUN_TYPE: valid = val==COMMUN_TYPE_SOCKET || val==COMMUN_TYPE_SHMEM; break; case CONNECT_MODE: checkConstrained(prop, val); valid = val==CONNECT_MODE_SERVER || val==CONNECT_MODE_CLIENT; break; default: valid=true; break; } if (!valid) throw new IllegalArgumentException("Constrained property."); } public boolean getBooleanProperty(int prop) { Object val=getProperty(prop); if (val instanceof Boolean) return ((Boolean) val).booleanValue(); throw new IllegalArgumentException("Not a boolean property."); } public int getIntProperty (int prop) { Object val=getProperty(prop); if (val instanceof Integer) return ((Integer) val).intValue(); throw new IllegalArgumentException("Not an int property."); } public String getStringProperty (int prop) { Object val=getProperty(prop); if (val instanceof String) return (String) val; throw new IllegalArgumentException("Not a String property."); } public Object getProperty(int prop) { if (prop < properties.length) { Object val=properties[prop]; if (val!=null) return val; } throw new IllegalArgumentException(); } public Class getPropertyType(int prop) { return getProperty(prop).getClass(); } public String getAsText(int prop) { Class type=getPropertyType(prop); if (type==Boolean.class) return getBooleanProperty(prop) ? "on" : "off"; else if (type==int.class) { int val=getIntProperty(prop); switch (prop) { case ALLOC_LEVEL_OBJECT: return "object"; case ALLOC_LEVEL_METHOD: return "method"; case ALLOC_LEVEL_TRACE: return "trace"; case CPU_METHOD_EXACT: return "exact"; case CPU_METHOD_SAMPLING: return "sampling"; case CPU_LEVEL_METHOD: return "method"; case CPU_LEVEL_TRACE: return "trace"; case MON_LEVEL_METHOD: return "method"; case MON_LEVEL_TRACE: return "trace"; case COMMUN_TYPE_SOCKET: return "socket"; case COMMUN_TYPE_SHMEM: return "shmem"; case CONNECT_MODE_SERVER: return "server"; case CONNECT_MODE_CLIENT: return "client"; } return String.valueOf(val); } else return getStringProperty(prop); } public String toString() { StringBuffer buf=new StringBuffer(); if (getBooleanProperty(ALLOC)!=true) buf.append("alloc=off,"); else { if (getIntProperty(ALLOC_LEVEL)!=ALLOC_LEVEL_TRACE) buf.append("alloc_level="+getAsText(ALLOC_LEVEL)+","); if (getIntProperty(ALLOC_TRACE_DEPTH)!=2) buf.append("alloc_trace_depth="+getAsText(ALLOC_TRACE_DEPTH)+ ","); if (getBooleanProperty(ALLOC_THREAD)!=true) buf.append("alloc_thread=off,"); if (getBooleanProperty(ALLOC_LINE)!=true) buf.append("alloc_line=off,"); } if (getBooleanProperty(CPU)!=true) buf.append("cpu=off,"); else { if (getIntProperty(CPU_METHOD)!=CPU_METHOD_SAMPLING) buf.append("cpu_method="+getAsText(CPU_METHOD)+","); if (getIntProperty(CPU_LEVEL)!=CPU_LEVEL_TRACE) buf.append("cpu_level="+getAsText(CPU_LEVEL)+","); if (getIntProperty(CPU_TRACE_DEPTH)!=2) buf.append("cpu_trace_depth="+getAsText(CPU_TRACE_DEPTH)+ ","); if (getBooleanProperty(CPU_THREAD)!=true) buf.append("cpu_thread=off,"); if (getBooleanProperty(CPU_LINE)!=true) buf.append("cpu_line=off,"); if (getBooleanProperty(CPU_CALLTREE)!=true) buf.append("cpu_calltree=off,"); if (getBooleanProperty(CPU_CALLTREE_LINE)!=false) buf.append("cpu_calltree_line=on,"); } if (getBooleanProperty(MON)!=true) buf.append("mon=off,"); else { if (getIntProperty(MON_LEVEL)!=MON_LEVEL_TRACE) buf.append("mon_level="+getAsText(MON_LEVEL)+","); if (getIntProperty(MON_TRACE_DEPTH)!=2) buf.append("mon_trace_depth="+getAsText(MON_TRACE_DEPTH)+ ","); if (getBooleanProperty(MON_THREAD)!=true) buf.append("mon_thread=off,"); if (getBooleanProperty(MON_LINE)!=true) buf.append("mon_line=off,"); } if (getIntProperty(COMMUN_TYPE)!=COMMUN_TYPE_SOCKET) buf.append("commun_type="+getAsText(COMMUN_TYPE)+","); buf.append("commun_shmem_id="+getAsText(COMMUN_SHMEM_ID)+","); if (getIntProperty(COMMUN_SHMEM_SIZE)!=262144) buf.append("commun_shmem_size="+getAsText(COMMUN_SHMEM_SIZE)+"," ); else { buf.append("commun_host="+getAsText(COMMUN_HOST)+","); if (getIntProperty(COMMUN_PORT)!=25595) buf.append("commun_port="+getAsText(COMMUN_PORT)+","); if (getIntProperty(CONNECT_MODE)!=CONNECT_MODE_SERVER) buf.append("connect_mode="+getAsText(CONNECT_MODE)+","); } if (getBooleanProperty(VERBOSE)!=true) buf.append("verbose=off,"); return buf.toString(); } } /* * $Log: LibrarySettings.java,v $ * Revision 1.1 2002/09/03 17:45:11 petrul * library settings * */ |
From: Pavel V. <va...@us...> - 2002-09-02 15:28:56
|
Update of /cvsroot/javaprofiler/jpi/net/sourceforge/javaprofiler/jpi In directory usw-pr-cvs1:/tmp/cvs-serv4158 Modified Files: Snapshot.java Log Message: difference of snapshot Index: Snapshot.java =================================================================== RCS file: /cvsroot/javaprofiler/jpi/net/sourceforge/javaprofiler/jpi/Snapshot.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Snapshot.java 15 Jul 2002 21:40:58 -0000 1.2 --- Snapshot.java 2 Sep 2002 15:28:53 -0000 1.3 *************** *** 96,103 **** --- 96,118 ---- public String getName(); + /** + *Creates new snapshot that contains <code>this - B </code> and than restiction to + *configuration conf. Difference means that result contains all objects that + *are in <code>this</code> and are not in <code> B </code>. Restriction means + *that result contains objects that types are specified in configuration. + * + *@param B secand operand in substraction + *@param conf determines restriction, result contains only objects that types + * are specified here. + */ + public Snapshot differenceTo(Snapshot B, Snapshot.Configuration conf); + } /* * $Log$ + * Revision 1.3 2002/09/02 15:28:53 vachis + * difference of snapshot + * * Revision 1.2 2002/07/15 21:40:58 vachis * Configuration class added |
From: Pavel V. <va...@us...> - 2002-09-02 15:28:05
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv3812 Modified Files: SnapshotImpl.java Log Message: difference of snapshot very poor ipmplementation Index: SnapshotImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** SnapshotImpl.java 28 Aug 2002 17:55:54 -0000 1.32 --- SnapshotImpl.java 2 Sep 2002 15:28:02 -0000 1.33 *************** *** 169,173 **** * *@param iprof Communacation object (you have to be connected to profiled VM). ! *@param conf Configuration object, you can tune you snaphot content */ //maybe use some configuration object --- 169,173 ---- * *@param iprof Communacation object (you have to be connected to profiled VM). ! *@param conf Configuration object, you can tune content of your snaphot */ //maybe use some configuration object *************** *** 184,188 **** } ! ////////////////////////////////////////////////////////////////////////// // implementation of Snapshot interface --- 184,197 ---- } ! /** ! *Creates completely empty snapshot, only configuration is stored. You ! * can fill snapshot with whatever you want. ! * It's used by {@link #diffenceTo } ! * ! *@param conf determines the types of object that will be included in this snapshot ! */ ! private SnapshotImpl( Configuration conf ) { ! this.conf = conf; ! } ////////////////////////////////////////////////////////////////////////// // implementation of Snapshot interface *************** *** 1135,1138 **** --- 1144,1242 ---- } + /** Creates new snapshot that contains <code>this - B </code> and than restiction to + * configuration conf. Difference means that result contains all objects that + * are in <code>this</code> and are not in <code> B </code>. Restriction means + * that result contains objects that types are specified in configuration. + * Confiduration object also defines what infomation are significan for + * defenition of equality. + * + * + * @param b secand operand in substraction + * @param conf determines restriction, result contains only objects that types + * are specified here. + */ + public Snapshot differenceTo(Snapshot b, Snapshot.Configuration conf) { + //TODO: all, now it contains only ALLOC_TYPES + Configuration confA = new Configuration(); + confA.withAlloc = true; + confA.withTypes = true; + + confA.withArenas = false; + confA.withAllocThreads = false; + confA.withAllocTraces = false; + confA.withCPU = false; + confA.withCPUThreads = false; + confA.withCPUTraces = false; + confA.withCallTree = false; + confA.withFields = false; + confA.withGC = false; + confA.withMon = false; + confA.withMonThreads = false; + confA.withMonTraces = false; + + SnapshotImpl snap = new SnapshotImpl( confA ); + Map objMap = new HashMap(); //mapping objects from source (this) to + // its copies in result + Object obj = null; + + //problem with definition //FIXME + /* It's not clear what means difference on root objects, that + * can contains information reletad to ALLOC, CPU, MON together + * Probably equals operation depends on Configuration. + */ + + //FIXME + /*Problem if i want to trac memory leacks, I need equlity defined + *by liveInstacesCount method, I don't care about care about + * totalInstacesCount. I did it so. + */ + + boolean eqL; + //temporary solution //FIXME + if ( confA.withAlloc ) { + ListIterator it1, it2; + + TypeData type1; + TypeRef type2; + TypeData typeA; + ClassData classA; + ClassRef class1; + + + it1 = this.types.listIterator(); + it2 = b.getTypes().listIterator(); + while( it1.hasNext() ) { + type1 = (TypeData) it1.next(); + while ( it2.hasNext() ) { + type2 = (TypeRef) it2.next(); + eqL = false; + //test of equality + eqL = (type1.getLiveInstancesCount() == type2.getLiveInstancesCount()); + //creation + if ( eqL ) { + class1 = type1.getComponentClass(); + obj = objMap.get( class1 ); + if ( obj == null ) { + classA = new ClassData( (ClassData) class1 ); + objMap.put( class1, classA ); + snap.classes.add( classA ); + } + else { + classA = (ClassData) obj; + } + typeA = new TypeData( type1, classA, this ); + snap.types.add( typeA ); + } + } + } + + //reletad work TODO: + //copy constructor to toher objects not only TypaData + //copy stat method to CPU, MON id objects + + } + return snap; + } + } *************** *** 1146,1149 **** --- 1250,1257 ---- /* * $Log$ + * Revision 1.33 2002/09/02 15:28:02 vachis + * difference of snapshot + * very poor ipmplementation + * * Revision 1.32 2002/08/28 17:55:54 petrul * fixed children adding to parents' lists |
From: Pavel V. <va...@us...> - 2002-09-02 15:25:54
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv2767 Modified Files: AllocStatData.java AllocStatIDObjectData.java AllStatIDObjectData.java ClassData.java CPUStatData.java CPUStatIDObjectData.java MonStatData.java MonStatIDObjectData.java TypeData.java Log Message: copy contrcutors for difference of snapshot Index: AllocStatData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocStatData.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** AllocStatData.java 30 May 2002 22:38:17 -0000 1.5 --- AllocStatData.java 2 Sep 2002 15:25:46 -0000 1.6 *************** *** 80,87 **** --- 80,97 ---- public void setStat(IProf.sAllocStatData stat); + /** + * Fills statistics on instances. + * + * @param stat Object with statistics on instances. + */ + public void setStat( AllocStatData stat); + } /* * $Log$ + * Revision 1.6 2002/09/02 15:25:46 vachis + * copy contrcutors for difference of snapshot + * * Revision 1.5 2002/05/30 22:38:17 vachis * changed interface to jpi Index: AllocStatIDObjectData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocStatIDObjectData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** AllocStatIDObjectData.java 30 May 2002 22:38:17 -0000 1.6 --- AllocStatIDObjectData.java 2 Sep 2002 15:25:47 -0000 1.7 *************** *** 58,63 **** sizeTotalInstances=stat.allocSizeInstancesTotal; } ! /** * Returns number of live instances. * --- 58,75 ---- sizeTotalInstances=stat.allocSizeInstancesTotal; } ! /** + * Fills statistics on instances. + * + * @param stat Object with statistics on instances. + */ + public void setStat( AllocStatData stat) { + numLiveInstances = stat.getLiveInstancesCount(); + numTotalInstances = stat.getTotalInstancesCount(); + sizeLiveInstances = stat.getLiveInstancesSize(); + sizeTotalInstances = stat.getTotalInstancesSize(); + } + + /** * Returns number of live instances. * *************** *** 132,139 **** --- 144,156 ---- public void removeAllocStatListener( AllocStatListener listener) { } + + } /* * $Log$ + * Revision 1.7 2002/09/02 15:25:47 vachis + * copy contrcutors for difference of snapshot + * * Revision 1.6 2002/05/30 22:38:17 vachis * changed interface to jpi Index: AllStatIDObjectData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllStatIDObjectData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AllStatIDObjectData.java 30 May 2002 22:38:17 -0000 1.2 --- AllStatIDObjectData.java 2 Sep 2002 15:25:47 -0000 1.3 *************** *** 273,275 **** --- 273,306 ---- public void removeMonStatListener( MonStatListener listener) { } + + + /** + * Fills statistics on instances. + * + * @param stat Object with statistics on instances. + */ + public void setStat( AllocStatData stat) { + numLiveInstances = stat.getLiveInstancesCount(); + numTotalInstances = stat.getTotalInstancesCount(); + sizeLiveInstances = stat.getLiveInstancesSize(); + sizeTotalInstances = stat.getTotalInstancesSize(); + } + + /** Fills statistics on instances. + * + * @param stat Object with statistics on instances. + */ + public void setStat( CPUStatData stat) { + cpuPureTime=stat.getCPUPureTime(); + cpuHits=stat.getCPUHitsCount(); + } + + /** Fills statistics on instances. + * + * @param stat Object with statistics on instances. + */ + public void setStat( MonStatData stat) { + monPureTime=stat.getMonPureTime(); + monHits=stat.getMonHitsCount(); + } } Index: ClassData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ClassData.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** ClassData.java 30 May 2002 22:38:17 -0000 1.14 --- ClassData.java 2 Sep 2002 15:25:47 -0000 1.15 *************** *** 98,101 **** --- 98,112 ---- /** + * Creates new ClassData, analogy of copy constructor, don't copy fields or any other + * lists. + * + * @param source copy data from this source + */ + ClassData( ClassData source ) { + this( source.getID(), source.getName(), source.getSourceFileName(), + new ArrayList(0), source.isActive()); + } + + /** * Adds new method defined in this class. * *************** *** 190,193 **** --- 201,207 ---- /* * $Log$ + * Revision 1.15 2002/09/02 15:25:47 vachis + * copy contrcutors for difference of snapshot + * * Revision 1.14 2002/05/30 22:38:17 vachis * changed interface to jpi Index: CPUStatData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUStatData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** CPUStatData.java 6 May 2002 17:32:13 -0000 1.4 --- CPUStatData.java 2 Sep 2002 15:25:47 -0000 1.5 *************** *** 58,65 **** --- 58,74 ---- */ void setStat(IProf.sCpuStatData stat); + + /** Fills statistics on instances. + * + * @param stat Object with statistics on instances. + */ + public void setStat( CPUStatData stat); } /* * $Log$ + * Revision 1.5 2002/09/02 15:25:47 vachis + * copy contrcutors for difference of snapshot + * * Revision 1.4 2002/05/06 17:32:13 vachis * new api implemention Index: CPUStatIDObjectData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUStatIDObjectData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** CPUStatIDObjectData.java 30 May 2002 22:38:17 -0000 1.6 --- CPUStatIDObjectData.java 2 Sep 2002 15:25:47 -0000 1.7 *************** *** 83,86 **** --- 83,95 ---- } + /** Fills statistics on instances. + * + * @param stat Object with statistics on instances. + */ + public void setStat( CPUStatData stat) { + pureTime=stat.getCPUPureTime(); + hits=stat.getCPUHitsCount(); + } + /** * Adds listener to changes in CPU data *************** *** 102,105 **** --- 111,117 ---- /* * $Log$ + * Revision 1.7 2002/09/02 15:25:47 vachis + * copy contrcutors for difference of snapshot + * * Revision 1.6 2002/05/30 22:38:17 vachis * changed interface to jpi Index: MonStatData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MonStatData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MonStatData.java 6 May 2002 17:32:13 -0000 1.2 --- MonStatData.java 2 Sep 2002 15:25:47 -0000 1.3 *************** *** 59,62 **** --- 59,68 ---- */ void setStat(IProf.sMonStatData stat); + + /** Fills statistics on instances. + * + * @param stat Object with statistics on instances. + */ + public void setStat( MonStatData stat); } *************** *** 65,68 **** --- 71,77 ---- /* * $Log$ + * Revision 1.3 2002/09/02 15:25:47 vachis + * copy contrcutors for difference of snapshot + * * Revision 1.2 2002/05/06 17:32:13 vachis * new api implemention Index: MonStatIDObjectData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MonStatIDObjectData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** MonStatIDObjectData.java 30 May 2002 22:38:17 -0000 1.4 --- MonStatIDObjectData.java 2 Sep 2002 15:25:47 -0000 1.5 *************** *** 79,82 **** --- 79,92 ---- } + /** Fills statistics on instances. + * + * @param stat Object with statistics on instances. + */ + public void setStat( MonStatData stat) { + pureTime=stat.getMonPureTime(); + hits=stat.getMonHitsCount(); + } + + /** * Adds listener to changes in Monitor data *************** *** 98,101 **** --- 108,114 ---- /* * $Log$ + * Revision 1.5 2002/09/02 15:25:47 vachis + * copy contrcutors for difference of snapshot + * * Revision 1.4 2002/05/30 22:38:17 vachis * changed interface to jpi Index: TypeData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/TypeData.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** TypeData.java 24 Jul 2002 22:29:22 -0000 1.5 --- TypeData.java 2 Sep 2002 15:25:47 -0000 1.6 *************** *** 130,133 **** --- 130,147 ---- /** + * Creates new TypeData, anlogy of copy constructor. + * @param source copy data from this source + * @param componentClass class related to this type (class or array of classes), may be NULL for arrays of ints,bytes,etc.. + * @param virtualMachineImage VirtualMachineImage this method belongs to. The VirtualMachineImage could be live + * (realtime implementation) or static (snaphshot). + */ + TypeData(TypeData source, ClassData componentClass, + VirtualMachineImageRef vmImage) { + this( source.getID(), componentClass, source.arrayType, vmImage ); + + this.setStat( source ); + } + + /** * Adds method where instance of this type (class or array of classes) was allocated. * *************** *** 299,302 **** --- 313,319 ---- /* * $Log$ + * Revision 1.6 2002/09/02 15:25:47 vachis + * copy contrcutors for difference of snapshot + * * Revision 1.5 2002/07/24 22:29:22 vachis * implements new interfaces for getting roots and info |
From: Lukas P. <pe...@us...> - 2002-08-31 08:50:10
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets In directory usw-pr-cvs1:/tmp/cvs-serv4864 Removed Files: AllocSheet.java CPUSheet.java MonSheet.java Log Message: replaced by MultiRootSheet.java --- AllocSheet.java DELETED --- --- CPUSheet.java DELETED --- --- MonSheet.java DELETED --- |
From: Lukas P. <pe...@us...> - 2002-08-31 08:48:26
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets In directory usw-pr-cvs1:/tmp/cvs-serv4555 Added Files: Bundle.properties Log Message: items added --- NEW FILE: Bundle.properties --- ## ## Sun Public License Notice ## ## The contents of this file are subject to the Sun Public License Version ## 1.0 (the "License"). You may not use this file except in compliance with ## the License. A copy of the License is available at http://www.sun.com/ ## ## The Original Code is the Java Profiler module. ## The Initial Developers of the Original Code are Jan Stola, Pavel Vacha, ## Michal Pise, Petr Luner, Lukas Petru and Marek Przeczek. ## Portions created by Jan Stola are Copyright (C) 2000-2001. All Rights Reserved. ## Portions created by Pavel Vacha are Copyright (C) 2000-2001. All Rights Reserved. ## Portions created by Michal Pise are Copyright (C) 2000-2001. All Rights Reserved. ## Portions created by Petr Luner are Copyright (C) 2000-2001. All Rights Reserved. ## Portions created by Lukas Petru are Copyright (C) 2000-2001. All Rights Reserved. ## Portions created by Marek Przeczek are Copyright (C) 2000-2001. All Rights Reserved. ## ## Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, ## Lukas Petru and Marek Przeczek. ## LBL_Name=Name LBL_ComponentClass=Component Class LBL_isArray=Array LBL_isArrayOfPrimitives=Array Of Primitives LBL_ParentThread=Parent Thread LBL_StartTime=Start Time LBL_EndTime=End Time LBL_SourceFile=Source File LBL_ParentClass=Defining Class LBL_Signature=Signature LBL_StartLineNo=Start Line No LBL_EndLineNo=End Line No LBL_isStatic=Static LBL_CTItemLineNo=Line Number LBL_CTItemCumulativeTime=Cumulative Time LBL_CTItemPureTime=Pure Time LBL_CTItemHits=Hits Count LBL_BTItemClass=Class LBL_BTItemMethodName=Method Name LBL_BTItemMethodSignature=Method Signature LBL_Frames=Frames LBL_Description=Description |
From: Lukas P. <pe...@us...> - 2002-08-31 08:47:39
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets In directory usw-pr-cvs1:/tmp/cvs-serv4438 Added Files: TraceSheet.java Log Message: added Frames property --- NEW FILE: TraceSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import java.util.*; import java.lang.reflect.InvocationTargetException; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.jpi.TraceRef; import net.sourceforge.javaprofiler.jpi.AllocStat; import net.sourceforge.javaprofiler.jpi.CPUStat; import net.sourceforge.javaprofiler.jpi.MonStat; import net.sourceforge.javaprofiler.module.nodes.*; public class TraceSheet implements SheetFactory { private final TraceRef ref; public TraceSheet(TraceRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(this, String.class, "getFramesString", null); pr.setName("Frames"); pr.setDisplayName(bundle.getString("LBL_Frames")); set.put(pr); if (ref instanceof AllocStat) AllocStatProperty.addProperties(set, (AllocStat) ref); if (ref instanceof CPUStat) CPUStatProperty.addProperties(set, (CPUStat) ref); if (ref instanceof MonStat) MonStatProperty.addProperties(set, (MonStat) ref); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } public String getFramesString() { StringBuffer buff=new StringBuffer(); Iterator it=ref.getFrames().iterator(); while (it.hasNext()) { Object o=it.next(); buff.append(o.toString()); buff.append("\n"); } return buff.toString(); } } /* * $Log: TraceSheet.java,v $ * Revision 1.1 2002/08/31 08:47:36 petrul * added Frames property * */ |
From: Lukas P. <pe...@us...> - 2002-08-31 08:47:08
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets In directory usw-pr-cvs1:/tmp/cvs-serv4351 Added Files: PSelectorSheet.java Log Message: 'Sort by' property --- NEW FILE: PSelectorSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.module.nodes.PDataChildren; import net.sourceforge.javaprofiler.module.nodes.InterfaceRepository; import java.beans.PropertyEditor; import java.beans.PropertyEditorSupport; public class PSelectorSheet implements SheetFactory { private final PDataChildren children; private final int type; public PSelectorSheet(PDataChildren reference, int childType) { children=reference; type=childType; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); Node.Property pr; pr=new PropertySupport.ReadWrite("sorting", Integer.class, "Sort by", "What criterion to sort by") { public Object getValue() throws IllegalAccessException, InvocationTargetException { return children.getSortMode(); } public void setValue(Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { children.setSortMode((Integer) val); } public PropertyEditor getPropertyEditor() { return new DataSortEditor(type); } }; set.put(pr); sh.put(set); return sh; } } class DataSortEditor extends PropertyEditorSupport { private static String[] texts={"(unsorted)", "Name", "Alloc", "CPU", "Mon"}; private final int type; public DataSortEditor(int childType) { type=childType; } public String getAsText() { return texts[((Integer) getValue()).intValue()]; } public void setAsText(String text) throws IllegalArgumentException { for (int i=0; i<texts.length; i++) { if (text.compareTo(texts[i])==0) { setValue(new Integer(i)); return; } } throw new IllegalArgumentException("DataSort mode"); } public String[] getTags() { String[] res=new String[5]; int i=0; res[i++]=texts[0]; res[i++]=texts[1]; if (InterfaceRepository.hasAlloc(type)) res[i++]=texts[2]; if (InterfaceRepository.hasCPU(type)) res[i++]=texts[3]; if (InterfaceRepository.hasMon(type)) res[i++]=texts[4]; String[] res2=new String[i]; System.arraycopy(res, 0, res2, 0, i); return res2; } } /* * $Log: PSelectorSheet.java,v $ * Revision 1.1 2002/08/31 08:47:05 petrul * 'Sort by' property * */ |
From: Lukas P. <pe...@us...> - 2002-08-31 08:46:37
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets In directory usw-pr-cvs1:/tmp/cvs-serv4206 Added Files: MultiRootSheet.java Log Message: automatically adds Alloc/CPU/Mon --- NEW FILE: MultiRootSheet.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.sheets; import java.util.*; import java.lang.reflect.InvocationTargetException; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.jpi.AllocStat; import net.sourceforge.javaprofiler.jpi.CPUStat; import net.sourceforge.javaprofiler.jpi.MonStat; import net.sourceforge.javaprofiler.module.nodes.*; public class MultiRootSheet implements SheetFactory { private final Object ref; public MultiRootSheet(Object reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref, String.class, "toString", null); pr.setName("Description"); pr.setDisplayName(bundle.getString("LBL_Description")); set.put(pr); if (ref instanceof AllocStat) AllocStatProperty.addProperties(set, (AllocStat) ref); if (ref instanceof CPUStat) CPUStatProperty.addProperties(set, (CPUStat) ref); if (ref instanceof MonStat) MonStatProperty.addProperties(set, (MonStat) ref); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: MultiRootSheet.java,v $ * Revision 1.1 2002/08/31 08:46:34 petrul * automatically adds Alloc/CPU/Mon * */ |
From: Lukas P. <pe...@us...> - 2002-08-31 08:46:05
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets In directory usw-pr-cvs1:/tmp/cvs-serv4047 Modified Files: CallTreeItemSheet.java Log Message: added Class property Index: CallTreeItemSheet.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets/CallTreeItemSheet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CallTreeItemSheet.java 28 Aug 2002 18:06:27 -0000 1.1 --- CallTreeItemSheet.java 31 Aug 2002 08:46:02 -0000 1.2 *************** *** 62,69 **** try { Node.Property pr=new PropertySupport.Reflection(ctRef.getFrame() ! .getMethod(), String.class, "toString", null); pr.setName("Method"); ! pr.setDisplayName(bundle.getString("LBL_CTItemMethod")); set.put(pr); pr=new PropertySupport.Reflection(ctRef.getFrame(), int.class, "getLineNo", null); --- 62,76 ---- try { Node.Property pr=new PropertySupport.Reflection(ctRef.getFrame() ! .getMethod().getParentClass(), String.class, "getName", null); ! pr.setName("Class"); ! pr.setDisplayName(bundle.getString("LBL_BTItemClass")); ! set.put(pr); ! ! pr=new PropertySupport.Reflection(ctRef.getFrame().getMethod(), ! String.class, "getName", null); pr.setName("Method"); ! pr.setDisplayName(bundle.getString("LBL_BTItemMethodName")); set.put(pr); + pr=new PropertySupport.Reflection(ctRef.getFrame(), int.class, "getLineNo", null); *************** *** 96,99 **** --- 103,109 ---- /* * $Log$ + * Revision 1.2 2002/08/31 08:46:02 petrul + * added Class property + * * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 |
From: Lukas P. <pe...@us...> - 2002-08-31 08:45:26
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/resources In directory usw-pr-cvs1:/tmp/cvs-serv3867 Added Files: PSelectorIcon.gif Log Message: icon --- NEW FILE: PSelectorIcon.gif --- GIF89a % |
From: Lukas P. <pe...@us...> - 2002-08-31 08:44:36
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv3633 Modified Files: SessionsNode.java Log Message: shows only SnapshotNode2 Index: SessionsNode.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/SessionsNode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** SessionsNode.java 28 Aug 2002 18:03:26 -0000 1.5 --- SessionsNode.java 31 Aug 2002 08:44:33 -0000 1.6 *************** *** 81,86 **** } else if (key instanceof Snapshot) { // key is Snapshot ! return new Node[]{new SnapshotNode2((Snapshot)key), ! new SnapshotNode((Snapshot)key)}; } else { // key is ConListener --- 81,85 ---- } else if (key instanceof Snapshot) { // key is Snapshot ! return new Node[]{new SnapshotNode2((Snapshot)key)}; } else { // key is ConListener *************** *** 103,106 **** --- 102,108 ---- /* * $Log$ + * Revision 1.6 2002/08/31 08:44:33 petrul + * shows only SnapshotNode2 + * * Revision 1.5 2002/08/28 18:03:26 petrul * temporary change, shows two nodes per one snapshot |
From: Lukas P. <pe...@us...> - 2002-08-31 08:44:20
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv3557 Added Files: PSelectorNode.java Log Message: added context action Show Table --- NEW FILE: PSelectorNode.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Sheet; import org.openide.util.HelpCtx; import org.openide.actions.PropertiesAction; import org.openide.util.actions.SystemAction; import net.sourceforge.javaprofiler.module.sheets.SheetFactory; import net.sourceforge.javaprofiler.module.actions.ShowTable; /** An enhancement to <code>AbstractNode</code> adding support for <code> * SheetFactory</code>. It disables copy action. Instance holds a reference to * some JPI object to enable comparison using the JPI object data. * @author Lukas Petru */ public class PSelectorNode extends AbstractNode { private SheetFactory sheet; private final int type; public PSelectorNode(Children children, SheetFactory shFactory, int childType) { super(children); sheet=shFactory; type=childType; } public Sheet createSheet() { Sheet res=(sheet!=null) ? sheet.create() : super.createSheet(); sheet=null; return res; } public boolean canCopy() { return false; } public HelpCtx getHelpCtx() { return new HelpCtx(getClass()); } protected SystemAction[] createActions() { return new SystemAction[] { SystemAction.get(ShowTable.class), SystemAction.get(PropertiesAction.class) }; } public int getType() { return type; } } /* * $Log: PSelectorNode.java,v $ * Revision 1.1 2002/08/31 08:44:17 petrul * added context action Show Table * */ |
From: Lukas P. <pe...@us...> - 2002-08-31 08:43:47
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv3425 Modified Files: PSelectorChildren.java Log Message: added 'Sort by' property Index: PSelectorChildren.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/PSelectorChildren.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** PSelectorChildren.java 28 Aug 2002 18:02:38 -0000 1.1 --- PSelectorChildren.java 31 Aug 2002 08:43:42 -0000 1.2 *************** *** 41,47 **** --- 41,53 ---- import org.openide.nodes.AbstractNode; import org.openide.nodes.PropertySupport; + import net.sourceforge.javaprofiler.module.sheets.*; import net.sourceforge.javaprofiler.jpi.VirtualMachineImageRef; + /** This class creates selector Nodes, one for each children list that is + * provided by a specified JPI object. The available children lists are queried * for using <code>InterfaceRepository</code> class. + * <p>Most of the Nodes will have the capability of sorting their children. + * @author Lukas Petru + */ class PSelectorChildren extends Children.Array { private final Object source; *************** *** 64,72 **** Children children; ! if (childrenList.size()==0) children=Children.LEAF; ! else ! children=new PDataChildren(childrenList); ! AbstractNode node=new AbstractNode(children); node.setName(listName); node.setDisplayName(listName); --- 70,84 ---- Children children; ! SheetFactory sheet=null; ! if (childrenList.size()==0) { children=Children.LEAF; ! sheet=null; ! } else { ! PDataChildren pChildren=new PDataChildren(childrenList); ! children=pChildren; ! if (InterfaceRepository.canSort(childTypes[i])) ! sheet=new PSelectorSheet(pChildren, childTypes[i]); ! } ! AbstractNode node=new PSelectorNode(children, sheet, childTypes[i]); node.setName(listName); node.setDisplayName(listName); *************** *** 91,94 **** --- 103,108 ---- } + /** Special Nodes for which there is no information in InterfaceRepository. + */ List getSpecialNodes() { int type=InterfaceRepository.objectType(source); *************** *** 105,110 **** nodeList.add(node); ! node=new CallTreeNode(new BacktraceChildren( ! ref.getCPUTraces(), 1)); node.setName("Backtrace"); node.setDisplayName("Merg CPUTraces"); --- 119,128 ---- nodeList.add(node); ! Children children; ! if (ref.getCPUTraces().size()!=0) ! children=new BacktraceChildren(ref.getCPUTraces(), 1); ! else ! children=Children.LEAF; ! node=new CallTreeNode(children); node.setName("Backtrace"); node.setDisplayName("Merg CPUTraces"); *************** *** 121,126 **** /* * $Log$ ! * Revision 1.1 2002/08/28 18:02:38 petrul ! * nodes, version 2 * */ --- 139,144 ---- /* * $Log$ ! * Revision 1.2 2002/08/31 08:43:42 petrul ! * added 'Sort by' property * */ |
From: Lukas P. <pe...@us...> - 2002-08-31 08:43:27
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv3347 Modified Files: ProfilerView.java Log Message: disabled title updating Index: ProfilerView.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/ProfilerView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ProfilerView.java 20 Apr 2002 10:34:58 -0000 1.2 --- ProfilerView.java 31 Aug 2002 08:43:24 -0000 1.3 *************** *** 59,63 **** return new HelpCtx(ProfilerView.class); } ! public static ProfilerView create(boolean tree, Node rc) { ProfilerView view=new ProfilerView(); --- 59,65 ---- return new HelpCtx(ProfilerView.class); } ! ! protected void updateTitle() {} ! public static ProfilerView create(boolean tree, Node rc) { ProfilerView view=new ProfilerView(); *************** *** 100,103 **** --- 102,108 ---- /* * $Log$ + * Revision 1.3 2002/08/31 08:43:24 petrul + * disabled title updating + * * Revision 1.2 2002/04/20 10:34:58 stolis * Refinement of the window openning. |
From: Lukas P. <pe...@us...> - 2002-08-31 08:43:03
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv3203 Modified Files: PDataNode.java Log Message: provides data object Index: PDataNode.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/PDataNode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** PDataNode.java 28 Aug 2002 18:02:38 -0000 1.1 --- PDataNode.java 31 Aug 2002 08:43:00 -0000 1.2 *************** *** 39,50 **** import org.openide.nodes.Sheet; import org.openide.util.HelpCtx; import net.sourceforge.javaprofiler.module.sheets.SheetFactory; /** An enhancement to <code>AbstractNode</code> adding support for <code> ! * SheetFactory</code>. It also disables copy action. * @author Lukas Petru */ public class PDataNode extends AbstractNode { private SheetFactory sheet; public PDataNode(Children children) { --- 39,55 ---- import org.openide.nodes.Sheet; import org.openide.util.HelpCtx; + import org.openide.actions.PropertiesAction; + import org.openide.util.actions.SystemAction; import net.sourceforge.javaprofiler.module.sheets.SheetFactory; + import net.sourceforge.javaprofiler.module.actions.ShowTable; + /** An enhancement to <code>AbstractNode</code> adding support for <code> ! * SheetFactory</code>. It disables copy action. Instance holds a reference to * some JPI object to enable comparison using the JPI object data. * @author Lukas Petru */ public class PDataNode extends AbstractNode { private SheetFactory sheet; + private Object data; public PDataNode(Children children) { *************** *** 57,60 **** --- 62,72 ---- } + public PDataNode(Children children, SheetFactory shFactory, Object + profilerData) { + super(children); + sheet=shFactory; + data=profilerData; + } + public Sheet createSheet() { Sheet res=(sheet!=null) ? sheet.create() : super.createSheet(); *************** *** 70,72 **** --- 82,95 ---- return new HelpCtx(getClass()); } + + public Object getDataObject() { + return data; + } } + + /* + * $Log$ + * Revision 1.2 2002/08/31 08:43:00 petrul + * provides data object + * + */ \ No newline at end of file |
From: Lukas P. <pe...@us...> - 2002-08-31 08:42:42
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv3102 Modified Files: PDataChildren.java Log Message: now extends SortedArray Index: PDataChildren.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/PDataChildren.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** PDataChildren.java 28 Aug 2002 18:02:38 -0000 1.1 --- PDataChildren.java 31 Aug 2002 08:42:39 -0000 1.2 *************** *** 42,50 **** import net.sourceforge.javaprofiler.module.sheets.*; ! class PDataChildren extends Children.Array { ! private final List data; PDataChildren(List list) { data=list; } --- 42,59 ---- import net.sourceforge.javaprofiler.module.sheets.*; ! /** Objects of this class are constructed with list of JPI objects, and provide * a <code>Node</code> for each of the objects in the list. It handles all ! * objects except for CallTreeRef, for which there is special Children ! * implementation. Sort mode can be set at runtime. ! * @author Lukas Petru ! */ ! public class PDataChildren extends Children.SortedArray { ! /** List of some JPI objects. Will be released after Nodes are created. */ ! private List data; ! /** For valid values see PDataComparator. */ ! private Integer sortMode=new Integer(0); PDataChildren(List list) { data=list; + setComparator(new PDataComparator(PDataComparator.ZERO)); } *************** *** 61,64 **** --- 70,76 ---- nodeList.add(node); } + // release data + data=null; + return nodeList; } *************** *** 66,70 **** private Node createThreadRef(ThreadRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new ThreadSheet(oo)); node.setDisplayName(oo.getName()); node.setIconBase("/org/openide/resources/beans"); --- 78,82 ---- private Node createThreadRef(ThreadRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new ThreadSheet(oo), oo); node.setDisplayName(oo.getName()); node.setIconBase("/org/openide/resources/beans"); *************** *** 74,78 **** private Node createCPUTraceRef(CPUTraceRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new CPUSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); --- 86,90 ---- private Node createCPUTraceRef(CPUTraceRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new TraceSheet(oo), oo); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); *************** *** 81,85 **** private Node createCPUThreadTraceRef(CPUThreadTraceRef oo) { ! AbstractNode node=new PDataNode(Children.LEAF, new CPUSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); --- 93,98 ---- private Node createCPUThreadTraceRef(CPUThreadTraceRef oo) { ! AbstractNode node=new PDataNode(Children.LEAF, new MultiRootSheet(oo), ! oo); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); *************** *** 89,93 **** private Node createMonTraceRef(MonTraceRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new MonSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); --- 102,106 ---- private Node createMonTraceRef(MonTraceRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new TraceSheet(oo), oo); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); *************** *** 96,100 **** private Node createMonThreadTraceRef(MonThreadTraceRef oo) { ! AbstractNode node=new PDataNode(Children.LEAF, new MonSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); --- 109,114 ---- private Node createMonThreadTraceRef(MonThreadTraceRef oo) { ! AbstractNode node=new PDataNode(Children.LEAF, new MultiRootSheet(oo), ! oo); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); *************** *** 104,108 **** private Node createTypeRef(TypeRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new TypeSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); --- 118,122 ---- private Node createTypeRef(TypeRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new TypeSheet(oo), oo); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); *************** *** 112,116 **** private Node createAllocTraceRef(AllocTraceRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new AllocSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); --- 126,130 ---- private Node createAllocTraceRef(AllocTraceRef oo) { AbstractNode node=new PDataNode(new PSelectorChildren(oo), ! new TraceSheet(oo), oo); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); *************** *** 119,123 **** private Node createAllocTypeTraceRef(AllocTypeTraceRef oo) { ! AbstractNode node=new PDataNode(Children.LEAF, new AllocSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); --- 133,138 ---- private Node createAllocTypeTraceRef(AllocTypeTraceRef oo) { ! AbstractNode node=new PDataNode(Children.LEAF, new MultiRootSheet(oo), ! oo); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); *************** *** 150,154 **** private Node createMethodRef(MethodRef oo) { AbstractNode node=new PDataNode(Children.LEAF, ! new MethodSheet(oo)); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); --- 165,169 ---- private Node createMethodRef(MethodRef oo) { AbstractNode node=new PDataNode(Children.LEAF, ! new MethodSheet(oo), oo); node.setDisplayName(oo.toString()); node.setIconBase("/org/openide/resources/beans"); *************** *** 199,206 **** --- 214,233 ---- } } + + public Integer getSortMode() { + return sortMode; + } + + public void setSortMode(Integer val) { + sortMode=val; + setComparator(new PDataComparator(val.intValue())); + } } /* * $Log$ + * Revision 1.2 2002/08/31 08:42:39 petrul + * now extends SortedArray + * * Revision 1.1 2002/08/28 18:02:38 petrul * nodes, version 2 |
From: Lukas P. <pe...@us...> - 2002-08-31 08:42:22
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv3041 Added Files: PDataComparator.java Log Message: comparator of PDataNode --- NEW FILE: PDataComparator.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.nodes; import java.util.*; import net.sourceforge.javaprofiler.jpi.AllocStat; import net.sourceforge.javaprofiler.jpi.CPUStat; import net.sourceforge.javaprofiler.jpi.MonStat; /** This class provides five different comparators of <code>PDataNode</code> * objects. The first is zero comparator which treats all objects equal, the * next comparator types order by: Name, Alloc, CPU and Mon. * @author Lukas Petru */ class PDataComparator implements Comparator { /** Compare all objects as equal. */ public static final int ZERO=0; /** Compare objects by name. */ public static final int NAME=1; /** Compare objects by Alloc. */ public static final int ALLOC=2; /** Compare objects by CPU. */ public static final int CPU=3; /** Compare objects by Mon. */ public static final int MON=4; private int type; /** Constructs a comparator of selected type. Use constants defined in this * class. */ PDataComparator(int compType) { type=compType; } public int compare(Object o1, Object o2) { if (type==ZERO) return 0; if ((o1 instanceof PDataNode) && (o2 instanceof PDataNode)) { switch(type) { case NAME: return nameCompare((PDataNode) o1, (PDataNode) o2); case ALLOC: return allocCompare((PDataNode) o1, (PDataNode) o2); case CPU: return cpuCompare((PDataNode) o1, (PDataNode) o2); case MON: return monCompare((PDataNode) o1, (PDataNode) o2); } throw new IllegalArgumentException("Comparator type"); } else throw new IllegalArgumentException("types:"+o1.getClass()+","+ o2.getClass()); } private int nameCompare(PDataNode n1, PDataNode n2) { return n1.getDisplayName().compareTo(n2.getDisplayName()); } /** Compares by Alloc in descending order. */ private int allocCompare(PDataNode n1, PDataNode n2) { AllocStat a1=(AllocStat) n1.getDataObject(); AllocStat a2=(AllocStat) n2.getDataObject(); long d=a1.getLiveInstancesSize() - a2.getLiveInstancesSize(); if (d!=0) return (-d>0) ? 1 : -1; d=a1.getTotalInstancesSize() - a2.getTotalInstancesSize(); if (d!=0) return (-d>0) ? 1 : -1; else return 0; } /** Compares by CPU in descending order. */ private int cpuCompare(PDataNode n1, PDataNode n2) { CPUStat a1=(CPUStat) n1.getDataObject(); CPUStat a2=(CPUStat) n2.getDataObject(); long d=a1.getCPUPureTime() - a2.getCPUPureTime(); if (d!=0) return (-d>0) ? 1 : -1; d=a1.getCPUHitsCount() - a2.getCPUHitsCount(); if (d!=0) return (-d>0) ? 1 : -1; else return 0; } /** Compares by Mon in descending order. */ private int monCompare(PDataNode n1, PDataNode n2) { MonStat a1=(MonStat) n1.getDataObject(); MonStat a2=(MonStat) n2.getDataObject(); long d=a1.getMonPureTime() - a2.getMonPureTime(); if (d!=0) return (-d>0) ? 1 : -1; d=a1.getMonHitsCount() - a2.getMonHitsCount(); if (d!=0) return (-d>0) ? 1 : -1; else return 0; } } /* * $Log: PDataComparator.java,v $ * Revision 1.1 2002/08/31 08:42:20 petrul * comparator of PDataNode * */ |
From: Lukas P. <pe...@us...> - 2002-08-31 08:41:45
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv2847 Modified Files: InterfaceRepository.java Log Message: hasAlloc, hasCPU and hasMon Index: InterfaceRepository.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/InterfaceRepository.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** InterfaceRepository.java 28 Aug 2002 18:02:38 -0000 1.1 --- InterfaceRepository.java 31 Aug 2002 08:41:42 -0000 1.2 *************** *** 38,45 **** import net.sourceforge.javaprofiler.jpi.*; ! class InterfaceRepository { private static boolean isInit=false; private static Map class2Type=null; public static int objectType(Object sample) { init(); --- 38,51 ---- import net.sourceforge.javaprofiler.jpi.*; ! /** This class provides static methods that describe JPI objects. It is used for ! * higher-order working with JPI objects and for presenting these objects to ! * end use. ! * @author Lukas Petru ! */ ! public class InterfaceRepository { private static boolean isInit=false; private static Map class2Type=null; + /** Returns a JPI constant which describes an object instance. */ public static int objectType(Object sample) { init(); *************** *** 54,57 **** --- 60,64 ---- } + /** Returns a list of child types which a selected object type provides. */ public static int[] getChildTypes(int type) { switch(type) { *************** *** 89,92 **** --- 96,102 ---- } + /** Returns a name of a list which holds children of selected method. The + * concrete getter method name is expressed as "get"+getListName(). + */ public static String getListName(int type) { switch(type) { *************** *** 121,124 **** --- 131,135 ---- } + /** Returns an icon base for graphical list selector. */ public static String getSelectorIconBase(int type) { switch(type) { *************** *** 127,132 **** "FramesNodeIcon"; default: ! return "/org/openide/resources/localFS"; } } --- 138,188 ---- "FramesNodeIcon"; default: ! return "/net/sourceforge/javaprofiler/module/resources/" + ! "PSelectorIcon"; ! } ! } ! ! /** Tells if it makes sense to sort children of this type. */ ! public static boolean canSort(int type) { ! switch(type) { ! case Constants.FRAME: ! return false; ! } ! return true; ! } ! ! /** Tells if a type provides Alloc statistic information. */ ! public static boolean hasAlloc(int type) { ! switch(type) { ! case Constants.THREAD: ! case Constants.TYPE: ! case Constants.ALLOC_TRACE: ! case Constants.ALLOC_TYPE_TRACE: ! case Constants.METHOD: ! return true; ! } ! return false; ! } ! ! /** Tells if a type provides CPU statistic information. */ ! public static boolean hasCPU(int type) { ! switch(type) { ! case Constants.CPU_TRACE: ! case Constants.CPU_THREAD_TRACE: ! case Constants.METHOD: ! return true; ! } ! return false; ! } ! ! /** Tells if a type provides Mon statistic information. */ ! public static boolean hasMon(int type) { ! switch(type) { ! case Constants.MON_TRACE: ! case Constants.MON_THREAD_TRACE: ! case Constants.METHOD: ! return true; } + return false; } *************** *** 166,169 **** --- 222,228 ---- /* * $Log$ + * Revision 1.2 2002/08/31 08:41:42 petrul + * hasAlloc, hasCPU and hasMon + * * Revision 1.1 2002/08/28 18:02:38 petrul * nodes, version 2 |
From: Lukas P. <pe...@us...> - 2002-08-31 08:41:24
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv2797 Modified Files: BacktraceChildren.java CallTreeChildren.java Log Message: shows percentage Index: BacktraceChildren.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/BacktraceChildren.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** BacktraceChildren.java 28 Aug 2002 18:00:05 -0000 1.2 --- BacktraceChildren.java 31 Aug 2002 08:41:21 -0000 1.3 *************** *** 42,54 **** import net.sourceforge.javaprofiler.module.nodes.CallTreeNode; import net.sourceforge.javaprofiler.module.data.BacktraceSupport; import net.sourceforge.javaprofiler.module.sheets.*; /** This children object is constructed from a list of <code>CPUTrace</code> ! * objects. Each child represents one FrameRef at a given level. * @author Lukas Petru */ ! public class BacktraceChildren extends Children.Array { private List traces; private int level; /** Constructs children. --- 42,58 ---- import net.sourceforge.javaprofiler.module.nodes.CallTreeNode; import net.sourceforge.javaprofiler.module.data.BacktraceSupport; + import net.sourceforge.javaprofiler.module.data.MergeFrameData; import net.sourceforge.javaprofiler.module.sheets.*; /** This children object is constructed from a list of <code>CPUTrace</code> ! * objects. These objects correspond to some <code>MergeFrameRef</code> object * of some level. The traces will be split by frame one level higher in the ! * stack, and children will represent the MergeFrameRef objects that will ! * result. * @author Lukas Petru */ ! public class BacktraceChildren extends Children.SortedArray { private List traces; private int level; + private long aggregate; /** Constructs children. *************** *** 58,63 **** --- 62,79 ---- */ public BacktraceChildren(List list, int frameLevel) { + this(list, frameLevel, 0); + } + + /** Constructs children. + * @param list List of <code>CPUTrace</code>. + * @param frameLevel Level of frame for which to create nodes. Level 1 is + * the last called method in a trace. + * @param aggregateTime Time that represents 100% in ratios. + */ + public BacktraceChildren(List list, int frameLevel, long aggregateTime) { traces=list; level=frameLevel; + aggregate=aggregateTime; + setComparator(new PDataComparator(PDataComparator.CPU)); } *************** *** 65,76 **** if (traces.size()==0) return Collections.EMPTY_LIST; ! java.util.Map map=BacktraceSupport.split(traces, level); traces=null; List nodeList=new ArrayList(); ! Iterator it=map.entrySet().iterator(); int i=1; while (it.hasNext()) { ! java.util.Map.Entry entry=(java.util.Map.Entry) it.next(); ! Node node=createBTNode(entry.getKey(), entry.getValue()); node.setName(String.valueOf(i++)); nodeList.add(node); --- 81,95 ---- if (traces.size()==0) return Collections.EMPTY_LIST; ! if (aggregate==0) ! setAggregate(); ! ! List list=BacktraceSupport.split(traces, level); traces=null; List nodeList=new ArrayList(); ! Iterator it=list.iterator(); int i=1; while (it.hasNext()) { ! MergeFrameData entry=(MergeFrameData) it.next(); ! Node node=createBTNode(entry.getFrame(), entry.getTraces()); node.setName(String.valueOf(i++)); nodeList.add(node); *************** *** 79,85 **** } ! private Node createBTNode(Object key, Object value) { ! FrameRef oo=(FrameRef) key; ! List bucket=(List) value; Children ch; if (bucket.size()==1 && ((TraceRef) bucket.get(0)).getFrames().size()<= --- 98,102 ---- } ! private Node createBTNode(FrameRef oo, List bucket) { Children ch; if (bucket.size()==1 && ((TraceRef) bucket.get(0)).getFrames().size()<= *************** *** 87,103 **** ch=Children.LEAF; else ! ch=new BacktraceChildren(bucket, level+1); ! AbstractNode node=new CallTreeNode(ch, new BacktraceItemSheet(oo, ! bucket)); ! node.setDisplayName(oo.getMethod().toString() + oo.getMethod() ! .getSignature()); node.setIconBase( "/net/sourceforge/javaprofiler/module/resources/BacktraceItemIcon"); return node; } } /* * $Log$ * Revision 1.2 2002/08/28 18:00:05 petrul * property sheets moved to sheets package --- 104,140 ---- ch=Children.LEAF; else ! ch=new BacktraceChildren(bucket, level+1, aggregate); ! CPUStat stat=BacktraceSupport.getSumOfCPUStat(bucket); ! AbstractNode node=new PDataNode(ch, new BacktraceItemSheet(oo, ! bucket), stat); ! ! String percentage=String.valueOf(getPercentage(stat))+"%"; ! node.setDisplayName(percentage+", "+oo.getMethod().toString()+ ! oo.getMethod().getSignature()); node.setIconBase( "/net/sourceforge/javaprofiler/module/resources/BacktraceItemIcon"); return node; } + + private void setAggregate() { + CPUStat stat=BacktraceSupport.getSumOfCPUStat(traces); + if (stat.getCPUPureTime() != 0) + aggregate=stat.getCPUPureTime(); + else + aggregate=stat.getCPUHitsCount(); + } + + private int getPercentage(CPUStat ref) { + if (ref.getCPUPureTime() != 0) + return (int) (ref.getCPUPureTime()*100/aggregate); + return (int) (ref.getCPUHitsCount()*100/aggregate); + } } /* * $Log$ + * Revision 1.3 2002/08/31 08:41:21 petrul + * shows percentage + * * Revision 1.2 2002/08/28 18:00:05 petrul * property sheets moved to sheets package Index: CallTreeChildren.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/CallTreeChildren.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** CallTreeChildren.java 28 Aug 2002 18:00:05 -0000 1.2 --- CallTreeChildren.java 31 Aug 2002 08:41:21 -0000 1.3 *************** *** 42,46 **** import net.sourceforge.javaprofiler.module.sheets.*; ! /** This class converts a list of JPI objects into <code>Node</code> objects. * Properly handled classes include <code>ThreadGroupRef</code>, * <code>ThreadRef</code>, <code>CallTreeRef</code>. The list is passed in a --- 42,48 ---- import net.sourceforge.javaprofiler.module.sheets.*; ! /** This class creates children for CallTree root selector and all other ! * children down the hierarchy. It converts a list of JPI objects into ! * <code>Node</code> objects. * Properly handled classes include <code>ThreadGroupRef</code>, * <code>ThreadRef</code>, <code>CallTreeRef</code>. The list is passed in a *************** *** 50,53 **** --- 52,56 ---- public class CallTreeChildren extends Children.Array { private List data; + private long aggregate; public CallTreeChildren(List list) { *************** *** 55,58 **** --- 58,66 ---- } + public CallTreeChildren(List list, long aggregateTime) { + data=list; + aggregate=aggregateTime; + } + public CallTreeChildren(Object o) { data=new ArrayList(1); *************** *** 63,66 **** --- 71,76 ---- if (data.size()==0) return Collections.EMPTY_LIST; + if (data.get(0) instanceof CallTreeRef) + return getCallTreeList(); List nodeList=new ArrayList(); Iterator it=data.iterator(); *************** *** 72,79 **** --- 82,121 ---- nodeList.add(node); } + // release resources + data=null; + return nodeList; } + /** Special function for CallTree, because we want to sort the Nodes. */ + private List getCallTreeList() { + List sorted=new ArrayList(data); + Collections.sort(sorted, new Comparator() { + public int compare(Object o1, Object o2) { + long d=getValue((CallTreeRef) o1)-getValue((CallTreeRef) o2); + if (d!=0) + return (-d>0) ? 1 : -1; + else + return 0; + } + }); + List nodeList=new ArrayList(); + Iterator it=sorted.iterator(); + int i=1; + while (it.hasNext()) { + Object o=it.next(); + Node node=createCTNode(o); + node.setName(String.valueOf(i++)); + nodeList.add(node); + } + // release resources + data=null; + + return nodeList; + } + private Node createCTItemNode(CallTreeRef oo) { + if (aggregate==0) + setAggregate(oo); List list=oo.getChildren(); AbstractNode node; *************** *** 81,92 **** node=new CallTreeNode(Children.LEAF, new CallTreeItemSheet(oo)); else ! node=new CallTreeNode(new CallTreeChildren(list), new CallTreeItemSheet(oo)); ! String time; ! if (oo.getCPUCumulativeTime() != 0) ! time=oo.getCPUCumulativeTime() + " ms"; ! else ! time=String.valueOf(oo.getCPUHitsCount()); ! node.setDisplayName(time+", "+oo.getFrame().getMethod().getName()+ ":"+oo.getFrame().getLineNo()); node.setShortDescription(oo.getFrame().getMethod().toString()); --- 123,131 ---- node=new CallTreeNode(Children.LEAF, new CallTreeItemSheet(oo)); else ! node=new CallTreeNode(new CallTreeChildren(list, aggregate), new CallTreeItemSheet(oo)); ! ! String percentage=String.valueOf(getPercentage(oo))+"%"; ! node.setDisplayName(percentage+", "+oo.getFrame().getMethod().getName()+ ":"+oo.getFrame().getLineNo()); node.setShortDescription(oo.getFrame().getMethod().toString()); *************** *** 102,106 **** CallTreeChildren(oo.getThreads())); node.setDisplayName("Group " + oo.getName()); ! node.setIconBase("/org/openide/resources/beans"); return node; } else if (o instanceof ThreadRef) { --- 141,145 ---- CallTreeChildren(oo.getThreads())); node.setDisplayName("Group " + oo.getName()); ! node.setIconBase("/org/netbeans/core/resources/arrowbottom"); return node; } else if (o instanceof ThreadRef) { *************** *** 113,117 **** node=new CallTreeNode(Children.LEAF); node.setDisplayName(oo.getName()); ! node.setIconBase("/org/openide/resources/beans"); return node; } else if (o instanceof CallTreeRef) { --- 152,156 ---- node=new CallTreeNode(Children.LEAF); node.setDisplayName(oo.getName()); ! node.setIconBase("/org/netbeans/core/resources/arrowbottom"); return node; } else if (o instanceof CallTreeRef) { *************** *** 125,127 **** } } ! } \ No newline at end of file --- 164,190 ---- } } ! ! private void setAggregate(CallTreeRef ref) { ! if (ref.getCPUCumulativeTime() != 0) ! aggregate=ref.getCPUCumulativeTime(); ! else ! aggregate=ref.getCPUHitsCount(); ! } ! ! private int getPercentage(CallTreeRef ref) { ! return (int) (getValue(ref)*100/aggregate); ! } ! ! private static long getValue(CallTreeRef ref) { ! if (ref.getCPUCumulativeTime() != 0) ! return ref.getCPUCumulativeTime(); ! return ref.getCPUHitsCount(); ! } ! } ! ! /* ! * $Log$ ! * Revision 1.3 2002/08/31 08:41:21 petrul ! * shows percentage ! * ! */ \ No newline at end of file |