Documentation > Debugging > Profiling H-Store using JProfiler

These instructions are for profiling the H-Store execution front-end using JProfiler and Eclipse. The following steps are an adaption of the instructions on how Debug H-Store in Eclipse. This has been tested on Eclipse 3.5 and 3.7.

  1. Install and Configure the JProfiler plug-in in Eclipse.
    • You need to replace the libstdc++ library that is included with the JProfiler distribution with the library that is installed on your workstation.
      cd ${JPROFILER_HOME}/bin/linux-x64
      mv libstdc++.so.6 ORIG-libstdc++.so.6
      ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6
      
  2. After starting Eclipse, right click on HStore.java and select Profile As → Profile Configurations. Create a new profile configuration for HStore with the following parameters:
    • Program Arguments:
      catalog.jar=tpcc.jar
      site.id=0
      conf=${HSTORE_HOME}/properties/default.properties
      
    • VM Arguments:
      -ea
      -server
      -Xmx2048m
      -Xcheck:jni
      -Djava.library.path=${HSTORE_HOME}/obj/release/nativelibs:\
                          ${JPROFILER_HOME}/bin/linux-x64:/usr/lib
      
    • Working Directory:
      ${HSTORE_HOME}
    • Environment Variables:
      LD_LIBRARY_PATH → /usr/lib:${env_var:LD_LIBRARY_PATH}
  3. Build H-Store and create the TPC-C project catalog:
    ant build hstore-prepare -Dproject=tpcc
  4. Execute the HStoreSite profile target in Eclipse. Once it looks like the process is running (if you enable debugging in log4j, you will see a message that says “Starting HStoreSite [site=0]“).
    Wait just a few seconds and then launch the hstore-benchmark command shown below. The nostart option is a comma-separated list of the sites that will be started externally from the BenchmarkController framework:

    ant hstore-benchmark -Dproject=tpcc -Dnostart=0

Adding Triggers

You can add a trigger that causes JProfiler to only start collecting profile information when the first transaction request arrives from a client. This will avoid adding a lot of additional data just data loading portion of a benchmark run.

  1. After starting JProfiler, go to the Trigger Settings panel in the Session Settings. Click on the + to add a new trigger.
  2. In the Trigger Type dropdown menu, choose Method Invocation. Click Next.
  3. Click on the + and select Search in Configured Class Path. This will bring up a tree menu of all of the different packages within H-Store. Navigate to edu → brown → hstore and select HStoreSite. Click OK. In the next window, select the method notifyStartWorkload(...). Click OK. When you return back to the original Trigger Wizard window, click Next.
  4. Under Configure Actions, click on the + and enable whatever options you would. For example, to record the relevant information for the internal operations of H-Store, select Start Recording and then choose all of the options in the next window. You can also choose to reset all of the profiling data as well. Click Finished to save the trigger.