26.28. SCLC

26.28.1. Overview

The sensor for SCLC is implemented using the XmlData sensor, and sends FileMetric data (documented in Section 25.11, “FileMetric”) to the Hackystat server.

26.28.2. Installation

26.28.2.1. Prerequisites

The SCLC sensor requires Java 1.5.0 or later and the XmlData sensor.

26.28.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.28.2.3. Configure and install the XmlData sensor

Follow the instructions for installation of either the Ant or command-line interfaces in Section 26.34, “XmlData”.

26.28.2.4. Invoke SCLC, followed by the XmlData sensor

To run the sensor, invoke SCLC with the -xml_output option, which produces an XML file in a format compatible with the XmlData sensor. Then, invoke the XmlData sensor to send that data to the Hackystat server. Example 26.67, “An Ant task for generating SCLC size data and sending it via the XmlData sensor” illustrates this two step process.

Example 26.67. An Ant task for generating SCLC size data and sending it via the XmlData sensor

<target name="runSclc">
  <!-- Run SCLC. -->
  <exec executable="perl">
    <arg line="${env.SCLC_HOME}/src/sclc -ignore -default_exclude -xml_output ${build.dir}/size.xml -recurse ${src.dir}" />
  </exec> 

  <!-- Send SCLC size data to Hackystat via XmlData sensor. -->
  <taskdef name="hacky-xmldata" classname="org.hackystat.sensor.xmldata.XmlDataSensor" />
  <hacky-xmldata verbose="true" createRunTime="runTime">
      <fileset file="${build.dir}/size.xml"/>
  </hacky-xmldata>
</target>

A more detailed example of using Ant to invoke SCLC and the XmlData is provided in Section 4.6, “Measurement: System size with SCLC”.

Although Ant is a convenient way to glue together the calls to SCLC and the XmlData sensor, you can also invoke both tools at the command line, as illustrated in Example 26.68, “Command line invocations to generate SCLC size data and send it via the XmlData sensor”.

Example 26.68. Command line invocations to generate SCLC size data and send it via the XmlData sensor

C:\> perl sclc -default_exclude -xml_output size.xml -recurse src
 Lines  Blank  Cmnts   NCSL TPtoks
====== ====== ====== ====== ====== ============================================
  2618    222    979   1494   8052 src\sclc  (Perl)

C:\> java -jar sensor.xmldata-cli.jar -file size.xml -createRunTime runTime
Hackystat data from 1 entries sent to http://hackystat.ics.hawaii.edu/ (0 secs.)

In this case, you can see that SCLC was invoked at the command line on the files in the src/ directory, and placed the resulting size data in a file called size.xml. (The size data was also written out to the command line.) Next, the CLI interface to the XmlData sensor was invoked on the size.xml file, which resulted in the FileMetric data being sent to the Hackystat server.

In both of these cases, the "runTime" attribute was added to the data with a common timestamp. This attribute is used by higher level Hackystat analyses, such as Daily Project Summary and Telemetry, to "batch" together SCLC data that was generated at the same time.

26.28.3. Installation troubleshooting

26.28.3.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.28.3.2. Checking client-side logging

The XmlData sensor writes out a file called toolName.0.log, where toolName is the name of the tool that generated data, to the .hackystat/logs directory that can be useful in debugging your installation. In the case of SCLC, the log file would be called sclc.0.log.

26.28.3.3. 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 'java -jar sensorshell.jar -verify'.

  • The contents of your sensor.properties file.

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

  • A description of the problem you are having.

26.28.4. Uninstallation

To disable XmlData sensor data collection temporarily from Ant or the command-line, invoke HackyInstaller, bring up the XmlData-Ant or XmlData-Cli configuration window, and uncheck the "Enable XmlData sensor" property, and apply the setting. To permanently uninstall the XmlData sensor, press the "Uninstall" button.