dk.netarkivet.harvester.harvesting.monitor
Class StartedJobHistoryChartGen

java.lang.Object
  extended by dk.netarkivet.harvester.harvesting.monitor.StartedJobHistoryChartGen

 class StartedJobHistoryChartGen
extends java.lang.Object

This class implements a generator for an history chart of a running job. The chart traces the progress percentage and the queued URI count over the crawl time. Charts are rendered in a PNG image file, generated in the webapp directory.


Nested Class Summary
protected static class StartedJobHistoryChartGen.TimeAxisResolution
          Time units used to scale the crawl time values and generate the chart's time axis ticks.
 
Field Summary
(package private) static org.apache.commons.logging.Log LOG
          The class logger.
 
Constructor Summary
StartedJobHistoryChartGen(long jobId)
           
 
Method Summary
 void cleanup()
          Deletes the chart image if it exists and stops the generation schedule.
(package private)  void generatePngChart(java.io.File outputFile, int pxWidth, int pxHeight, java.lang.String chartTitle, java.lang.String xAxisTitle, java.lang.String[] yDataSeriesTitles, double[] timeValuesInSeconds, double[][] yDataSeriesRange, double[][] yDataSeries, java.awt.Color[] yDataSeriesColors, java.lang.String[] yDataSeriesTickSuffix, boolean drawBorder, java.awt.Color backgroundColor)
          Generates a chart in PNG format.
 java.io.File getChartFile()
          Returns the image file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

static final org.apache.commons.logging.Log LOG
The class logger.

Constructor Detail

StartedJobHistoryChartGen

StartedJobHistoryChartGen(long jobId)
Method Detail

getChartFile

public java.io.File getChartFile()
Returns the image file.

Returns:
the image file. Might return null if no file is currently available.

cleanup

public void cleanup()
Deletes the chart image if it exists and stops the generation schedule.


generatePngChart

final void generatePngChart(java.io.File outputFile,
                            int pxWidth,
                            int pxHeight,
                            java.lang.String chartTitle,
                            java.lang.String xAxisTitle,
                            java.lang.String[] yDataSeriesTitles,
                            double[] timeValuesInSeconds,
                            double[][] yDataSeriesRange,
                            double[][] yDataSeries,
                            java.awt.Color[] yDataSeriesColors,
                            java.lang.String[] yDataSeriesTickSuffix,
                            boolean drawBorder,
                            java.awt.Color backgroundColor)
Generates a chart in PNG format.

Parameters:
outputFile - the output file, it should exist.
pxWidth - the image width in pixels.
pxHeight - the image height in pixels.
chartTitle - the chart title, may be null.
xAxisTitle - the x axis title
yDataSeriesRange - the axis range (null for auto)
yDataSeriesTitles - the Y axis titles.
timeValuesInSeconds - the time values in seconds
yDataSeries - the Y axis value series.
yDataSeriesColors - the Y axis value series drawing colors.
drawBorder - draw, or not, the border.
backgroundColor - the chart background color.