26.12. Eclipse

26.12.1. Overview

The Eclipse sensor collects data regarding developer activities using the Eclipse editor. The Eclipse sensor represents this data using a variety of sensor data types. The Activity SDT (documented in Section 25.2, “Activity”) represents editing actions and the "state change" event used to generate the Active Time abstraction. The UnitTest SDT (documented in Section 25.16, “UnitTest”) represents invocations of JUnit using the JUnit plug-in for Eclipse. The BuffTrans SDT (documented in Section 25.3, “BuffTrans”) represents the sequence of files visited by the developer during editing.

Eclipse is "a kind of universal tool platform - an open extensible IDE for anything and nothing in particular."

26.12.2. Installation

26.12.2.1. Prerequisites

The Eclipse sensor requires Eclipse 3.2 and Java 1.5.0 or later.

26.12.2.2. Download HackyInstaller and set your Hackystat Host and User Key

Follow the instructions in Chapter 2, Client-side configuration: Tool sensor installation to set your Hackystat host and user key.

26.12.2.3. Configure and install the Eclipse sensor

In the HackyInstaller main window, select the Eclipse sensor and press "Configure Selected Sensor". Figure 26.18, “ Eclipse sensor installer configuration window ” shows what the configuration window should look like after the path to Eclipse is set, the sensor is enabled, and the "Install" button has been pressed to install the sensor.

Figure 26.18.  Eclipse sensor installer configuration window


Eclipse sensor installer configuration window

This sensor supports the following properties and paths:

  • Enable Eclipse Sensor: This property controls whether the sensor is active or not. If not checked, the sensor will not collect or send data even if installed. If checked, then Activity and UnitTest sensor data will be collected.

  • Enable Buffer Transition sensor data collection: If checked, then Buffer Transition sensor data will be collected. Note that the "Enable Eclipse Sensor" property serves as a "master switch": if it is not enabled, then no sensor data (including Buffer Transition sensor data) will be collected. Note that the interval in seconds between buffer transition checks is set as a "Common Property" in the HackyInstaller main window.

  • Enable Status Line Monitoring: If checked, then a message will be printed to the Eclipse status line whenever sensor data is collected.

  • Eclipse home directory: This path specifies the top-level directory for Eclipse. The Eclipse sensor requires the placement of a sensor executable into the Eclipse plugin directory.

26.12.2.4. Restart Eclipse

Restart Eclipse to see these changes.

26.12.3. Installation verification

26.12.3.1. Check for status line messages

The first step in verifying your Hackystat sensor installation is to make sure that ENABLE_ECLIPSE_MONITOR_SENSOR is set to true in your sensor.properties file, then begin editing a file in Eclipse. Within a minute, you should see at least one message from the Hackystat sensor appear in the status line at the bottom of the Eclipse window. Figure 26.19, “ Status line message from the Hackystat sensor for Eclipse ” illustrates this status line message.

Figure 26.19.  Status line message from the Hackystat sensor for Eclipse


Status line message from the Hackystat sensor for Eclipse

26.12.3.2. List Sensor Data

If you see messages appearing in the status line, then the next step is to exit Eclipse (which will trigger a send of the data to the server). Then login to your account on the Hackystat server, and use the "List Sensor Data" command on the Extras page to verify that Activity data for today's date was received by the server for the "Eclipse" tool, as illustrated in Figure 26.20, “ List Sensor Data with Eclipse data ”.

Figure 26.20.  List Sensor Data with Eclipse data


List Sensor Data with Eclipse data

26.12.3.3. Daily Diary

If the List Sensor Data command verifies that you are receiving data at the server, then the final check is to use the Daily Diary command to verify that state change events are being sent and abstracted into the Most Active File, as illustrated in Figure 26.21, “ Daily Diary with Eclipse data ”.

Figure 26.21.  Daily Diary with Eclipse data


Daily Diary with Eclipse data

Once you have successfully edited a file, verified that it was sent to the server, and found it listed as the Most Active File in the Daily Diary, you can feel confident that the Eclipse sensor is installed correctly and that basic data is being sent to the server.

26.12.4. Installation troubleshooting

26.12.4.1. Troubleshooting general client-server problems

The first step in troubleshooting your sensor installation is to verify that your Hackystat host and key settings are valid and that you can contact the Hackystat server, as described in Section 2.4, “HackyInstaller GUI: Setting and verifying the Hackystat host and user key”

26.12.4.2. Using an incorrect version of Eclipse or Java

A common installation problem is attempting to install the sensor with an unsupported version of Eclipse or Java. Make sure you are using Eclipse 3.2 and Java 1.5.0 or later.

26.12.4.3. Using mixed versions of Hackystat sensors for Eclipse

If you have installed multiple Hackystat sensors for Eclipse (such as this sensor as well as the one for the Jupiter code review plugin), then you must always update all of the sensors at the same time. If you only upgrade one sensor and not all, Eclipse may generate "Error" dialog boxes for Outline mode or produce other anomalous behaviors

26.12.4.4. Checking client-side logging

The Eclipse sensor writes out a file called eclipse.0.log to the .hackystat/logs directory that can be useful in debugging your installation. Under normal conditions, this file should look similar to Example 26.31, “eclipse.0.log file”.

Example 26.31. eclipse.0.log file

Hackystat Version: 6.3.1124 (November 24 2004 12:05:38)
SensorShell started at: 12/07/2004 11:05:13
Type 'help' for a list of commands.
Host: http://hackystat.ics.hawaii.edu/ is available and key is valid.
Defined shell command: Dependency
Defined shell command: Issue
Defined shell command: Perf
Defined shell command: FileMetric
Defined shell command: ReviewIssue
Defined shell command: Activity
Defined shell command: Cli
Defined shell command: ReviewActivity
Defined shell command: Coverage
Defined shell command: UnitTest
Defined shell command: BuffTrans
Defined shell command: Commit
Defined shell command: Build
#> AutoSend [10]
AutoSend OK (set to 10 minutes)
AutoSend enabled every 10 minutes.
Checking for offline data to recover.
No offline data found.
#> Activity [setTool, Eclipse]
setTool OK
#> Activity [add, Open File, C:/cvs413/stack/build.xml]
Activity add OK (1 total)
#> Activity [statechange, C:/cvs413/stack/build.xml, 15382]
Activity statechange OK (initial file name and buffer size)
#> send
Sending sensor data (12/07 11:15:14)
  Ping: Ping OK (contacted server http://hackystat.ics.hawaii.edu/ with valid key.)
  Dependency: Send OK (No entries to send.)
  AutoSend: AutoSend OK ('send' command ignored)
  Issue: Send OK (No entries to send.)
  Perf: Send OK (No entries to send.)
  FileMetric: Send OK (No entries to send.)
  ReviewIssue: Send OK (No entries to send.)
  Activity: Send OK (1 entries)
  Cli: Send OK (No entries to send.)
  ReviewActivity: Send OK (No entries to send.)
  Coverage: Send OK (No entries to send.)
  Commit: Send OK (No entries to send.)
  UnitTest: Send OK (No entries to send.)
  BuffTrans: Send OK (No entries to send.)
  Build: Send OK (No entries to send.)

26.12.4.5. Checking Eclipse startup logging

If you do not have messages in the status line, and if you do not find an eclipse.0.log file in the .hackystat/logs directory, then the most likely reason is that the plugin was not installed successfully. To troubleshoot this situation, change directories to the eclipse installation directory and invoke Eclipse manually with the -debug option as follows:

c:\eclipse> eclipse -debug

This will start up Eclipse and also print out some debugging information. Under normal circumstances, the information should look as follows:

Install location:
    file:/c:/eclipse/
Configuration file:
    file:/c:/eclipse/configuration/config.ini loaded
Configuration location:
    file:/c:/eclipse/configuration/
Configuration file:
    file:/c:/eclipse/configuration/config.ini loaded
Framework located:
    file:/c:/eclipse/plugins/org.eclipse.osgi_3.0.0/
Loading framework classpath from:
    file:/c:/eclipse/plugins/org.eclipse.osgi_3.0.0/eclipse.properties
Framework classpath:
    file:/c:/eclipse/plugins/org.eclipse.osgi_3.0.0/core.jar
    file:/c:/eclipse/plugins/org.eclipse.osgi_3.0.0/console.jar
    file:/c:/eclipse/plugins/org.eclipse.osgi_3.0.0/osgi.jar
    file:/c:/eclipse/plugins/org.eclipse.osgi_3.0.0/resolver.jar
    file:/c:/eclipse/plugins/org.eclipse.osgi_3.0.0/defaultAdaptor.jar
    file:/c:/eclipse/plugins/org.eclipse.osgi_3.0.0/eclipseAdaptor.jar
Splash location:
    c:\eclipse\plugins\org.eclipse.platform_3.0.0\splash.bmp
Debug options:
    file:/C:/eclipse/.options not found
Time to load bundles: 15
Starting application: 547

Check to see if errors are reported in this output.

26.12.4.6. Submit a trouble report

If none of the above troubleshooting activities solves your problem, then you should send an email to your Hackystat Administrator to request help. Please include in your email the following information:

  • The output from 'java -version'.

  • The output from 'eclipse -version'.

  • The output from 'java -jar sensorshell.jar -verify'.

  • The contents of your sensor.properties file.

  • The contents of the eclipse.0.log file.

  • The output from invoking eclipse from the command line with the '-debug' option.

  • A description of the problem you are having.

26.12.5. Uninstallation

To disable Eclipse sensor data collection temporarily, invoke HackyInstaller, bring up the Eclipse configuration window, and uncheck the "Enable Eclipse sensor" property, and apply the setting. To permanently uninstall the Eclipse sensor, press the "Uninstall" button.