FitnessViaCLITimeLine

(Difference between revisions)
(Sample any Java Application)
 
(6 intermediate revisions not shown)
Line 3: Line 3:
== Sample any Java Application ==
== Sample any Java Application ==
-
Since build from Aug 28, 2010 you can use command line tool to attach to any Java application via [[JMX]] and generate <code>.npss</code> profile snapshot file:
+
[[NetBeans]] 7.0 and 7.1 provide command line tool to attach to any Java application via [[JMX]] and generate <code>.npss</code> profile snapshot file:
<source lang="bash">
<source lang="bash">
Line 13: Line 13:
   -Dcom.sun.management.jmxremote.ssl=false
   -Dcom.sun.management.jmxremote.ssl=false
   -Dcom.sun.management.jmxremote.port=<port>
   -Dcom.sun.management.jmxremote.port=<port>
-
Then you can start this sampler with correct port and file to write snapshot to.
+
 
</source>
</source>
-
When the file is ready, use [[NetBeans]] IDE 6.10 and open it from profile menu. You'll see a timeline!  
+
For [[NetBeans]] 7.2 dev. builds use:
 +
 
 +
<source lang="bash">
 +
$ cd nbinstall/platform
 +
$ java -jar modules/org-netbeans-modules-sampler.jar
 +
Usage: <port> <snapshot.npss>
 +
First of all start your application with following parameters:
 +
  -Dcom.sun.management.jmxremote.authenticate=false
 +
  -Dcom.sun.management.jmxremote.ssl=false
 +
  -Dcom.sun.management.jmxremote.port=<port>
 +
 
 +
</source>
 +
 
 +
Then you can start the sampler with correct port and file to write snapshot to.
 +
Wait for the amount of time you want the sampler to collect data and then press enter to write the collected data to the file.
 +
 
 +
The generated file can be loaded and analysed in the [[NetBeans]] IDE. Use File/Open and you'll see a timeline!  
[[Category:Performance]] [[Category:Performance:ToolsAndTests]]
[[Category:Performance]] [[Category:Performance:ToolsAndTests]]

Current revision as of 14:34, 16 April 2012

The work on InstantFitness is so nice and tempting, that I could not wait to use it on another application I am trying to profile. However alas, right now the .npss sample is generated only internally for the benefit of NetBeans applications. What can you do if you want to profile other application?

Sample any Java Application

NetBeans 7.0 and 7.1 provide command line tool to attach to any Java application via JMX and generate .npss profile snapshot file:

$ cd nbinstall/platform
$ java -cp modules/org-netbeans-core-ui.jar org.netbeans.core.ui.sampler.Sampler
Usage: <port> <snapshot.npss>
First of all start your application with following parameters:
  -Dcom.sun.management.jmxremote.authenticate=false
  -Dcom.sun.management.jmxremote.ssl=false
  -Dcom.sun.management.jmxremote.port=<port>

For NetBeans 7.2 dev. builds use:

$ cd nbinstall/platform
$ java -jar modules/org-netbeans-modules-sampler.jar
Usage: <port> <snapshot.npss>
First of all start your application with following parameters:
  -Dcom.sun.management.jmxremote.authenticate=false
  -Dcom.sun.management.jmxremote.ssl=false
  -Dcom.sun.management.jmxremote.port=<port>

Then you can start the sampler with correct port and file to write snapshot to. Wait for the amount of time you want the sampler to collect data and then press enter to write the collected data to the file.

The generated file can be loaded and analysed in the NetBeans IDE. Use File/Open and you'll see a timeline!

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo