From: Marek P. <ma...@us...> - 2002-03-04 23:57:11
|
Update of /cvsroot/javaprofiler/library/demo/06 In directory usw-pr-cvs1:/tmp/cvs-serv14047/demo/07 Modified Files: README Test.java Log Message: small changes new example Index: README =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/06/README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** README 31 Jan 2002 12:31:03 -0000 1.1 --- README 4 Mar 2002 23:57:08 -0000 1.2 *************** *** 1 **** ! This example show how to gain a calltree from the library. --- 1,2 ---- ! This example show how to gain a calltree from the library ! using the getCallTreeThruIterator() method. Index: Test.java =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/06/Test.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Test.java 28 Feb 2002 10:19:50 -0000 1.2 --- Test.java 4 Mar 2002 23:57:08 -0000 1.3 *************** *** 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(); --- 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(); |