Category Archives: NetBeans

Even better than NetBeans, HProf comes with the JVM in 1.5 and 1.6…


Bingo! NetBeans’ profiler is very nice, thank you, and WAY easier to get started with than Eclipse, but its a GUI and you run it interactivly- good for some things, not for automated performance testing, which is what I’m trying to set up. Well, turns out HProf (Heap Profile) is a tool built into the Java Virtual Machine and available as a launch-time option whenever you run a Java program. The example on Sun’s web page profiles “javac”- pretty confident there. So I tried it on Mac OS-X and Win XP and it works just fine on both. You get percentages, not absolute times, but it gives you the total time and you can multiply out the absolute time if that’s what you really want. I must say I’m enjoying this again. Trying to get JMeter and TPTP running under Mac OS wasn’t any actual fun, since they didn’t work. In fact, having put TPTP into Ecipse, I can’t use Eclipse anymore… that’s a useful definition of software that’s not quite ready for prime time- it installs successfully, then tells you it doesn’t support your platform when you try to run with it, and it prevents your IDE from working until you figure out how to remove it. Joke’s on me, eh?

Anyone have expereince running NetBeans’ Profiler from command line?


Just found the following about running the NetBeans Profiler with Eclipse…  not command line but headed that way, maybe…

http://www.jroller.com/ortegon/entry/on_profiling_eclipse_rcp_applications

I left the following comment for Mario and I wouldn’t mind answere from anyone who reads this plea anywhere!
I’m trying to find a platform neutral profiling tool for Java- I need to support *nux, Windows and Mac OSX (yeah, BSD, but…) and I need to run from a command line so I can automate it. The Java library I’m testing is a thin client that talks TCP/IP to a server, all I care about is the client library performance, but I care on all three major platforms.

I tried to get JMeter going and realized it wasn’t aimed at what I was doing. I installed TPTP and was really hoping it would do the job but then discovered it has NO agent for Mac OSX and hasn’t for years. Phoey!  So I got NetBeans, imported my code (trivial, why can’t Eclipse be this easy?) and happily profiled on my Mac. Good so far.

Does anyone have experience running the NetBeans Profiler from Solaris, Linux, Mac OSX and/or Windows command lines?

Other all-platform Java profilers?

Many thanks for any help!!!

Bill

SPOILER ALERT! More about the NetBeans Anagram game


If you want to read about the NetBeans Anagram.java program but do NOT want a hint, just scroll down past this post to the one below.

So you’ve guessed by main force or cheated any number of ways and answered one or two of the anagrams that the Anagram program that comes with NetBeans has. You’ve worked out the plain text for

maibuguos

for sure.

You only need one answer to work out the rule to use, but with the first answer and the answer to this question, you can easily work out how the scramble works- you aren’t s’pozed to just sit there and cheat, there’s an algorithm. Find it and you can just type back the answers, one after another. Makes the program far more entertaining to use than having to look stuff up.

Bill

Java run-time Profiling. NetBeans seems to run, Eclipse TPTP won’t, (!) on a Mac…


Here’s some hard-won wisdom that I’ll gladly share with others

1) If you’ve got a Java library that forms an API to some other thing, and you want to test it, JMeter may not be the best vehicle. This is because JMeter wants to get between the client and server… at which point, how you test the client becomes a bit of a mystery to me! I’ll revisit this when I’ve got a bit more experience, but I have a running program, no UI but works creat from a command line or inside Eclipse. JMeter wants me to add stuff  before it will profile it. Hmm. Next.

2) TPTP sure looked good when I was reading the description and I got to be a bit more mindful in downloading and adding it- copied its jars, etc, from where it unzipped its …/features and ../plugins directories. (NOTE: cp -rp : you need this to be recursive !) into …/eclipse/features and …/eclipse.plugins. I did NOT copy any file with the same name and time stamp as was already present. All looked good, there was the test and profile icon in the menu bar and everything. But there’s no Agent for Mac OS X, just Windows and *nix. There’s an open bug with 70+ responses to it in the Eclipse bug tool, nobody has come forward with a complete, working, version and the project management (this is open source freeware…) says they’d like to deliver the Mac OS X version but hasn’t got the resources… I can’t figure whether to laugh or cry! Maybe I should put my old shoulder to this wheel, when I am competent enough. Crazy making. Its like flying into 1995 and being told that professional programmers don’t use Macs. Malarkey, but there were planty of people saying it. If doing Java development, compile once, run on all platforms, blah blah, can’t be made to work on a Mac at this point in history, there’s something very odd. How the heck to developers using Eclipse work on their shiny new Macs? Without profiling or testing? Hard to believe.

3) SO, now I’m running NetBeans and I have to say it downloads and installs pretty quick, and appears to have a testing tool-kit built in, not a secondary download, which is nice. Here’s what I’ve learned about it:

NetBeans has an Anagram example program. Of course, you have to build it, and when you bring up the sources, you are offered a panel layout tool where you could pick additional events or add stuff or mess up the demo 100 different ways in 5 minutes or less. Don’t! Don’t add anything.  Just save and build. It runs and now you’ve got a NEW problem- you’ve created an anagram game with complex words and you aren’t thinking anagrams and haven’t got a clue what the plain text for

“batsartcoin”,
“maibuguos”,
“ratimhteci”,

should be.  Or maybe you do. Think about Java the language and the conceptual space it exists in.  I won’t spoil it by giving the plain text here or any complete solution. You can exercise your creativity, just like you should, do a search for “batsartcoin” and follow the hints you find.

Of Course you should learn how to find things like constant strings with the NetBeans IDE, and you should probably learn how to do it from a command prompt (or cygwin on Windows) too. And you can exercise your clever muscles looking on the web, where you can find the plain text, as a literal, or as a result from the anagram breaking tool(s) that exist out there.

BUT let me just say, after you’ve cheated for an answer or two, or racked your brain and gotten an answer or two just take a look at the anagrams and plain texts.

Bill