There are two common approaches:
The first approach is preferred since it leaves your production code completely unchanged. However, this approach requires that you introduce Performance Monitor calls into your code so that you can capture performance metrics.
The second approach requires that your plug-in import the org.eclipse.perfmsr.core plug-in.
Typically you would configure the Performance Monitor via an environment variable or a properties file. (See Configuring the Performance Monitor for more information on how to do this). You would then add the following method call to the points in your test case where you would like to capture performance data:
The step parameter is an integer that ties the snapshot to a particular step in your test case.PerfMsrCorePlugin.getPerformanceMonitor(true).snapshot(step);
As a variation, if you require more control over the information that gets captured you can use the
snapshot(step,
type) method.
When the test case is finished you can either load the data
to the server programmatically (using the upload
method) or manually.