public Object produceDataset(Map params) throws DatasetProduceException {
BuildInfoSummary summary = (BuildInfoSummary) params.get("buildInfo");
TimeSeries brokenSeries = new TimeSeries("Broken Builds", Minute.class);
TimeSeries goodSeries = new TimeSeries("Good Builds", Minute.class);
for (Iterator iter = summary.iterator(); iter.hasNext();) {
BuildInfo buildInfo = (BuildInfo) iter.next();
Date buildTime = buildInfo.getBuildDate();
double timeValue = extractTimeOfDay(buildTime);
Minute timePeriod = new Minute(buildTime);
TimeSeries seriesToAddTo = buildInfo.isSuccessful() ? goodSeries
: brokenSeries;
if (seriesToAddTo.getDataPair(timePeriod) == null) {
seriesToAddTo.add(timePeriod, timeValue);
} else {
System.err.println("multiple logs in the same minute; ignoring: " + buildInfo.getFileName());
}
}
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(brokenSeries);
dataset.addSeries(goodSeries);