From: Marek P. <ma...@us...> - 2002-03-06 22:03:23
|
Update of /cvsroot/javaprofiler/library/demo/06 In directory usw-pr-cvs1:/tmp/cvs-serv25203/demo/06 Modified Files: README Test.java Log Message: examples Index: README =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/06/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** README 4 Mar 2002 23:57:08 -0000 1.2 --- README 6 Mar 2002 22:03:20 -0000 1.3 *************** *** 1,2 **** ! This example show how to gain a calltree from the library ! using the getCallTreeThruIterator() method. --- 1 ---- ! This example show how to gain a calltree from the library. Index: Test.java =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/06/Test.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Test.java 4 Mar 2002 23:57:08 -0000 1.3 --- Test.java 6 Mar 2002 22:03:20 -0000 1.4 *************** *** 70,93 **** System.out.println( "object ID: " + sid.objId); ! // now, ask for calltree iterator of this thread ! Iterator ct_iterator = ! iprof.getCallTreeThruIterator( sid.objId, true); ! if( ct_iterator == null) System.out.println( "calltree is empty !"); ! else { ! ! int numOfItems = 0; ! ! // count number of items in calltree ! while( ct_iterator.hasNext()) { ! ! numOfItems++; ! ct_iterator.next(); ! } ! ! System.out.println( "okay, #items = " ! + numOfItems); ! } System.out.println(); --- 70,82 ---- System.out.println( "object ID: " + sid.objId); ! // now, ask for calltree of this thread ! IProf.sCallTree ct = ! iprof.getCallTree( sid.objId); ! if( ct == null) System.out.println( "calltree is empty !"); ! else ! System.out.println( "okay, #items = " ! + ct.numOfItems); System.out.println(); |