nbprofiledirect

nbprofiledirect

Description

When run within the NetBeans IDE, launches the NetBeans Profiler. The profiler will start listening on a specific port to try to connect to an agent running in the profiled VM.

The task returns immediately and is not blocking. You typically should call this task before starting the VM with the profiler agent.

This task is typically not started by hand, but rather from the Profiler UI actions Profile Project or Profile File, however in some special circumstances in can be also called manually (but still within the context of NetBeans IDE).

If the task is called with insufficient context or the interactive attribute is specified, it will first display a dialog that will allow the user to select the type of profiling.

Parameters

Attribute Description Required
mainclass the Java class to execute. Either jar or classname
jvmargsproperty can be used to specify in which property the JVM argument for starting profiler agent should be stored. Default value is profiler.info.jvmargs.agent. Upon successful completion of the nbprofiledirect, this property will contain the JVM argument that should be passed to the profiled JVM. No
jvmargsprefix can be used to instruct the profiler to use certain prefix when creating the profiler agent JVM argument. This is useful for example for NetBeans IDE profiling, where arguments that should be passed to the VM are prefixed with -J No
jvmproperty can be used to specify in which property the JVM to use for profiling should be stored. Default value is profiler.info.jvm. Upon successful completion of the nbprofiledirect, this property will contain the path to JVM that should be used for profiling. No
interactive auto, true or false. Controls whether the Select Profiling Task is displayed when this task is called. The default value is auto, which means that the nbprofiledirect should only display the dialog when it is called with insufficient properties context. Under normal circumstances, when the task is correctly called as a result of Profile Project or Profile File action, the dialog would not be displayed. No

Parameters specified as nested elements

classpath

Java's classpath attribute is a PATH like structure and can also be set via a nested classpath element.

rootspath

A PATH like structure that allows you to specify which packages the profiler should treat as belonging to the project. If this is used, CPU profiling would only profile code invoked from methods in those packages. This is especially useful in the case of application servers, where specifying which packages contain the user code that should be profiled can lead to a much smaller profiling overhead.

Errors and return codes

None

Examples

A typical way to use nbprofiledirect in a freeform project:

        <nbprofiledirect>
          <classpath>
            <pathelement location="dist/test.jar"/>
            <pathelement path="${java.class.path}"/>
          </classpath>
        </nbprofiledirect>

        <java classname="org.mytest.Main" jvm="${profiler.info.jvm}">
          <classpath>
            <pathelement location="dist/test.jar"/>
            <pathelement path="${java.class.path}"/>
          </classpath>
          <jvmarg value="${profiler.info.jvmargs.agent}"/>
        </java>

Using nbprofiledirect in the interactive mode.

        <nbprofiledirect interactive="true" jvmargsproperty="my.agent.property">
          <classpath>
            <pathelement location="dist/test.jar"/>
            <pathelement path="${java.class.path}"/>
          </classpath>
        </nbprofiledirect>
        <java classname="org.mytest.Main" jvm="${profiler.info.jvm}">
         <classpath>
           <pathelement location="dist/test.jar"/>
           <pathelement path="${java.class.path}"/>
         </classpath>
         <jvmarg value="${my.agent.property}"/>
        </java>

 

 

Project Features

About this Project

Profiler was started in November 2009, is owned by Tomas Hurka, and has 58 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close