use of hudson.util.DataSetBuilder in project hudson-2.x by hudson.
the class History method getDurationGraph.
/**
* Graph of duration of tests over time.
*/
public Graph getDurationGraph() {
return new GraphImpl("seconds") {
protected DataSetBuilder<String, ChartLabel> createDataSet() {
DataSetBuilder<String, ChartLabel> data = new DataSetBuilder<String, ChartLabel>();
List<TestResult> list;
try {
list = getList(Integer.parseInt(Stapler.getCurrentRequest().getParameter("start")), Integer.parseInt(Stapler.getCurrentRequest().getParameter("end")));
} catch (NumberFormatException e) {
list = getList();
}
for (hudson.tasks.test.TestResult o : list) {
data.add(((double) o.getDuration()) / (1000), "", new ChartLabel(o) {
@Override
public Color getColor() {
if (o.getFailCount() > 0)
return ColorPalette.RED;
else if (o.getSkipCount() > 0)
return ColorPalette.YELLOW;
else
return ColorPalette.BLUE;
}
});
}
return data;
}
};
}
use of hudson.util.DataSetBuilder in project violations-plugin by jenkinsci.
the class SeverityTypeDataSet method buildDataSet.
/**
* Build the data set.
*
* @return the dataset.
*/
public CategoryDataset buildDataSet() {
DataSetBuilder<Row, NumberOnlyBuildLabel> builder = new DataSetBuilder<Row, NumberOnlyBuildLabel>();
for (ViolationsReport r = report; r != null; r = r.previous()) {
if (r.getTypeSummaries() == null) {
continue;
}
TypeSummary t = r.getTypeSummaries().get(type);
if (t == null) {
// Old report
continue;
}
if (t.getSeverityArray() == null || t.getSeverityArray().length != Severity.NUMBER_SEVERITIES) {
// Old report
continue;
}
int[] nums = t.getSeverityArray();
builder.add(nums[Severity.MEDIUM_VALUE] + nums[Severity.MEDIUM_HIGH_VALUE] + nums[Severity.MEDIUM_LOW_VALUE], MEDIUM_ROW, new NumberOnlyBuildLabel((Run) r.getBuild()));
builder.add(nums[Severity.HIGH_VALUE], HIGH_ROW, new NumberOnlyBuildLabel((Run) r.getBuild()));
builder.add(nums[Severity.LOW_VALUE], LOW_ROW, new NumberOnlyBuildLabel((Run) r.getBuild()));
}
return builder.build();
}
use of hudson.util.DataSetBuilder in project evosuite by EvoSuite.
the class CoveragePlot method doStats.
private CategoryDataset doStats() {
DataSetBuilder<String, ChartUtil.NumberOnlyBuildLabel> coverageDataSetBuilder = new DataSetBuilder<String, ChartUtil.NumberOnlyBuildLabel>();
for (Run<?, ?> build : this.project.getProject().getBuilds()) {
final BuildAction build_action = build.getAction(BuildAction.class);
if (build_action == null) {
// no build action is associated with this build, so skip it
continue;
}
Set<String> criteria = build_action.getProjectAction().getCriteria();
for (String criterion : criteria) {
double coverage = build_action.getProjectAction().getCriterionCoverage(criterion);
coverageDataSetBuilder.add(coverage, criterion, new ChartUtil.NumberOnlyBuildLabel(build));
}
}
return coverageDataSetBuilder.build();
}
Aggregations