This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
i m doing my final project and my title is to create a java metric analyzer.. it is using to analyze a java source code and understand the particular code, then give the result like the code performance, usage time, and how many method it was used, so anyone who r expert, or genious , can u guys please do me a favour, give me some clues to me so that i can complete my final project. thx a lot too all ur helps..........
If you look at the documentation for the J2SE, you will see two command line parameters to the java command, -Xprof and -Xrunhprof, which will give you information about various aspects of a running program. One could monitor this input and create metrics from it. . . [ December 10, 2003: Message edited by: Joe Ess ]
Alternately, if you want metrics that can't be obtained from runtime profiling, but can be obtained from parsing source code, then you may want to look at tools like ANTLR or JavaCC to get you started. There's a bit of a learning curve here I think, so if you only want simple metrics like LOC you might just do simple parsing yourself. But for serious parsing to get mroe complex metrics, tools like ANTLR or JavaCC will probably be quite useful, and worth your while to learn how to use. You might want to think more about just what sort of metrics you want to include.