Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv26597 Added Files: MonTraceData.java MonThreadTraceData.java MonThreadMethodData.java MonStatIDObjectData.java MonStatData.java Log Message: Monitors data classes --- NEW FILE: MonTraceData.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.data; import java.util.*; import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Class with statistic data for monitors profiling. * * @author Pavel Vacha */ public class MonTraceData extends MonStatIDObjectData { /** * Frames that make up this trace. * List of {@link TraceFrameData} objects. */ private List frames; /** Profiling data for this method. */ private MethodData method; /** * Map of threads in which this trace appeared. * Mapping of {@link MonThreadTraceData} objects and thread IDs. */ private Map threads; /** * Creates new MonTraceData. * * @param ID unique ID of this object. * @param method profiling data for this method. * @param frames frames that make up this trace. It should be * <code>List</code> of {@link TraceFrameData} objects. */ MonTraceData(int ID, MethodData method, List frames) { super(ID); this.method=method; this.frames=frames; threads=new HashMap(); } /** * Creates new MonTraceData. * * @param sid data returned by communication layer * @param method profiling data for this method. */ MonTraceData( IProf.sID sid, MethodData method ) { this( sid.objId, method, null ); //sid...method ); //PENDING } /** * Returns frames that make up this trace. * * @return <code>List</code> of {@link TraceFrameData} objects. */ public List getFrames() { return frames; } /** * Returns profiling data for this method. * * @return profiling data for this method. */ public MethodData getMethod() { return method; } /** * Returns map of threads in which this trace appeared. * * @return mapping of {@link MonThreadTraceData} objects and thread IDs. */ public Map getThreads() { return threads; } /** * Adds thread in which this trace appeared. * * @param thread thread in which this trace appeared. */ void addThread(MonThreadTraceData thread) { threads.put(new Integer(thread.getThreadMethod().getThread().getID()), thread); } /** * Returns thread (with given ID) in which this trace appeared. * * @param ID ID of the thread. * @return thread (with given ID) in which this trace appeared * or <code>null</code> if such thread does not exist. */ public MonThreadTraceData getThread(int ID) { return (MonThreadTraceData)threads.get(new Integer(ID)); } } /* * $Log: MonTraceData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ --- NEW FILE: MonThreadTraceData.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.data; import java.util.*; import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Class with statistic data for monitors profiling. * * @author Pavel Vacha */ public class MonThreadTraceData extends MonStatIDObjectData { /** Profiling data for this thread and method. */ private MonThreadMethodData threadMethod; /** Profiling data for this trace. */ private MonTraceData trace; /** Creates new MonThreadTraceData */ /** * Creates new MonThreadTraceData. * * @param ID unique ID of this object. * @param threadMethod profiling data for this thread and method. * @param trace profiling data for this trace. */ MonThreadTraceData(int ID, MonThreadMethodData threadMethod, MonTraceData trace) { super(ID); this.threadMethod=threadMethod; this.trace=trace; } /** * Creates new MonThreadTraceData. * * @param sid data returned by communication layer * @param threadMethod profiling data for this thread and method. * @param trace profiling data for this trace. */ MonThreadTraceData( IProf.sID sid, MonThreadMethodData threadMethod, MonTraceData trace ) { this( sid.objId, threadMethod, trace ); //PENDING } /** * Returns profiling data for this thread and method. * * @return profiling data for this thread and method. */ public MonThreadMethodData getThreadMethod() { return threadMethod; } /** * Returns profiling data for this trace. * * @return profiling data for this trace. */ public MonTraceData getTrace() { return trace; } } /* * $Log: MonThreadTraceData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ --- NEW FILE: MonThreadMethodData.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.data; import java.util.*; import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Class with statistic data for monitors profiling. * * @author Pavel Vacha */ public class MonThreadMethodData extends MonStatIDObjectData { /** Profiling data for this thread. */ private ThreadData thread; /** Profiling data for this method. */ private MethodData method; /** * Map of traces of this method. * Mapping of {@link MonThreadTraceData} objects and trace IDs. */ private Map traces; /** Creates new MonThreadMethodData * * @param ID unique ID of this object. * @param thread profiling data for this thread. * @param method profiling data for this method. */ public MonThreadMethodData(int ID, ThreadData thread, MethodData method) { super(ID); this.thread=thread; this.method=method; traces=new HashMap(); } /** * Creates new MonThreadMethodData. * * @param sid data returned by communication layer * @param thread profiling data for this thread. * @param method profiling data for this method. */ MonThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { this( sid.objId, thread, method ); //PENDING } /** * Returns profiling data for this thread. * * @return profiling data for this thread. */ public ThreadData getThread() { return thread; } /** * Returns profiling data for this method. * * @return profiling data for this method. */ public MethodData getMethod() { return method; } /** * Returns map of traces of this method. * * @return mapping of {@link MonThreadTraceData} objects and trace IDs. */ public Map getTraces() { return traces; } /** * Adds trace of this method. * * @param trace trace of this method. */ void addTrace(MonThreadTraceData trace) { traces.put(new Integer(trace.getTrace().getID()), trace); } /** * Returns trace (with given ID) of this method. * * @param ID ID of the trace. * @return trace (with given ID) of this method or <code>null</code> * if such trace does not exist. */ public MonThreadTraceData getTrace(int ID) { return (MonThreadTraceData)traces.get(new Integer(ID)); } } /* * $Log: MonThreadMethodData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ --- NEW FILE: MonStatIDObjectData.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.data; /** * Class with statistic data for monitors profiling. * * @author Pavel Vacha */ public class MonStatIDObjectData extends IDObjectData implements MonStatData { /** Pure time spent by waiting for monitors. */ private long time; /** How many times waited this method */ private long hits; /** Creates new MonStatIDObjectData */ public MonStatIDObjectData(int ID) { super(ID); } /** * Adds given number of hits and time to the statistics. * * @param hits how many times waited this method * @param time pure time spent by waiting for monitors */ public void addToMonStat(long hits, long time) { this.hits+=hits; this.time+=time; } /** * Returns how many times waited this method * * @return how many times waited this method */ public long getMonHitCount() { return hits; } /** * Returns pure time spent by waiting for monitors * * @return pure time spent by waiting for monitors */ public long getMonTime() { return time; } } /* * $Log: MonStatIDObjectData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ --- NEW FILE: MonStatData.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.data; /** * Class that implements this inteface holds statistic data * for monitors profiling. * * @author Pavel Vacha */ public interface MonStatData { /** * Adds given number of hits and time to the statistics. * * @param hits how many times waited this method * @param time pure time spent by wating for monitors */ public void addToMonStat ( long hits, long time ); /** * Returns how many times waited this method * * @return how many times waited this method */ public long getMonHitCount(); /** * Returns pure time spent by waiting for monitors * * @return pure time spent by waiting for monitors */ public long getMonTime(); } /* * $Log: MonStatData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ |