DocumentationAeminiumRuntimeProfiler

From Aeminium
Revision as of 17:25, 12 February 2012 by Aeminium (Talk | contribs) (DataCollection)

Jump to: navigation, search

Preparing the ground

Downloads

The Profiler uses the JProfiler framework to collect and manage all the information concerning the performance of the Æminium Runtime.

Also, considering consulting the JProfiler documentation whenever you have a doubt which isn't covered in this page.

Running an Application

To run an application along with the JProfiler, you must add a few flags before executing the 'java' command, namely the '-agentpath' and '-Djprofiler.probeProvider', as described in the example bellow for Linux 32-bit:

java -agentpath:/home/alcides/Tools/jprofiler7/bin/linux-x64/libjprofilerti.so=port=8849 -Djprofiler.probeProvider=aeminium.runtime.profiler.AeminiumProbeProvider -jar Fibonnaci.jar
  • The '-agentpath' flags tells the JVM the location of the 'jprofilerti library', which is usually located the folder where JProfiler was installed.
  • In Windows 32-bit, you can try '-agentpath:"C:\Program Files\jprofiler7\bin\windows\jprofilerti.dll=port=8849"'. For more information, look in the section 'B.3.10 Starting Remote Sessions' of the JProfiler documentation.
  • The '-Djprofiler.probeProvider' will tell the JVM the class path to the probe provider, a class whose contents are discussed below.

The profiler package

The first two classes are regular Java classes, which were created just to make easier the process of collecting the profiling information.

AeminiumProfiler

This class was created so we could have a static location where references to the scheduler and the graph could be fetched. This is necessary because the JProfiler classes must follow a strict constructor and are initialized by the JProfiler itself. Therefore, we couldn't pass, for the example, the Runtime as an argument to the probe providers. Therefore, the class AeminiumProfiler is initialized by the Runtime itself and whenever JProfiler needs to collect data from the scheduler or the graph, it simply has to pick the references of the AeminiumProfiler.

DataCollection

The DataCollection works like a structure that will hold all the variables to profile. At each time of the sampling, the JProfiler passes it to the scheduler and then to the graph, and each of these components has the job of filling with values the variables that are concerned with them. Therefore, it contains the following variables:

Scheduler variables
  • public int noOccupiedQueues;
  • public int [] taskInNonBlockingQueue;
  • public int taskInBlockingQueue;
  • public int [][] tasksHandled;
Graph variables
  • public int noTasksCompleted[];
  • public int noUnscheduledTasks;
  • public int noWaitingForChildrenTasks;
  • public int noWaitingForDependenciesTasks;
  • public int noTasksWaitingInQueue;
  • public int noRunningTasks;
  • public int noCompletedTasks;

JProfiler Classes

The three other classes that also belong to the profiler package are the ones which are required by JProfiler to collect telemetries information, as well as handle method interception.

AeminiumProbeProvider

The class

CountersProbe

The class

TaskDetailsProbe

The class