Once you have a qalab.xml file, it is possible to extract some useful information. Feel free to develop your own mechanism, However, the most potent way to analyse it is probably via a chart. There are 2 types of charts:
Both charts are time-series charts (x-axis is a date). You can also select:
At the moment, it seems that jFreeChart 1.0.1 does not seem to work with Maven 1.x but it is ok with ant. It is your choice, we show both examples below.
Here is the ant call, we have not described how or where you generate the checkstyle xml file:
<taskdef name="buildchart" classname="net.objectlab.qalab.ant.BuildStatChartTask"> <classpath> <pathelement location="${lib}/qalab-1.0.jar" /> <pathelement location="${lib}/xercesImpl-2.6.2.jar" /> <pathelement location="${lib}/jcommon-1.0.5.jar" /> <pathelement location="${lib}/jfreechart-1.0.2.jar" /> <pathelement location="${lib}/log4j.jar" /> </classpath> </taskdef> <buildchart inputFile="qalab.xml" toDir="${doc}/style/charts" movingAverage="10" width="500" height="333" summaryOnly="false" summaryType="checkstyle,pmd" type="checkstyle" quiet="true"/>
Parameter | Mandatory | Description |
---|---|---|
inputFile | Yes | The input file, in this case the qalab.xml, the consolidated statistics file. |
toDir | Yes | The output directory as there will be multiple charts (one per file in qalabs.xml). |
movingAverage | Yes | if value > 0, it will draw a moving average based of the given number of runs. In this example
it will be based on the last 10 runs. The value put in movingaverage is the number of points used to calculate an average. say we have;
|
width | Yes | chart width in pixels. |
height | Yes | chart height in pixels. |
summaryOnly | Yes | if 'true' or 'yes', only draw one chart for the summary section in qalab.xml. |
summaryType | Yes | select the types that one wants to appear on the summary chart. |
type | Yes | any combination of 'checkstyle','pmd','pmd-cpd', 'simian','findbugs','cobertura-branch', 'cobertura-line' comma-separated. The chart will contain one serie (line) for each style; eg 'checkstyle' will only display checkstyle. 'checkstyle,pmd' will display both checkstyle and pmd. |
quiet | Yes | (default true), if false logs debug information on the console. |
the summary chart will be called:
Here is the ant call:
<taskdef name="buildchart" classname="net.objectlab.qalab.ant.BuildStatChartTask"> <classpath> <pathelement location="${lib}/qalab-1.0.jar" /> <pathelement location="${lib}/jcommon-1.0.5.jar" /> <pathelement location="${lib}/jfreechart-1.0.2.jar" /> <pathelement location="${lib}/log4j.jar" /> </classpath> </taskdef> <buildchart inputFile="qalab.xml" toDir="${doc}/style/charts" movingAverage="10" width="500" height="333" summaryOnly="false" summaryType="pmd" type="pmd" quiet="true"/>
We have also created an XSL stylesheet to generate an html file that displays all these charts. Here is how it is called from ant, in this instance for 'checkstyle'. Please ensure that the TIME is defined using the same pattern as below!
<tstamp> <format property="TIME" pattern="yyyy-MM-dd" offset="-48" unit="hour"/> </tstamp> <style in="qalab.xml" out="hist.html" style="qalab-chart-html.xsl"> <param name="targetdir" expression="target/docs/qalab"/> <param name="type" expression="checkstyle"/> <param name="offset" expression="${TIME}"/> </style>
This then generates a series of html files in a frame like this: