hudson.util.ChartUtil.NumberOnlyBuildLabel Java Examples
The following examples show how to use
hudson.util.ChartUtil.NumberOnlyBuildLabel.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AWSDeviceFarmGraph.java From aws-device-farm-jenkins-plugin with Apache License 2.0 | 6 votes |
/** * Generate a duration trend graph for device minutes used for recent results. * * @param owner The build which owns the latest result. * @param isCompleted The flag to denote if the result is completed which determines our caching. * @param results The list of previous to latest results which generate the trend. * @return The duration trend graph. */ public static Graph createDurationTrendGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, List<AWSDeviceFarmTestResult> results) { DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>(); for (AWSDeviceFarmTestResult result : results) { // Create label for this result using its Jenkins build number. Run<?, ?> build = result.getOwner(); NumberOnlyBuildLabel label = new NumberOnlyBuildLabel(build); // Attach duration value for all results in our trend. builder.add(result.getDuration(), "Minutes", label); } CategoryDataset dataset = builder.build(); Color[] colors = new Color[]{AWSDeviceFarmGraph.DurationColor}; return new AWSDeviceFarmGraph(owner, isCompleted, getGraphSize(), dataset, "Build #", "Device Minutes Used", colors); }
Example #2
Source File: AbstractTestResultAction.java From junit-plugin with MIT License | 6 votes |
private CategoryDataset buildDataSet(StaplerRequest req) { boolean failureOnly = Boolean.valueOf(req.getParameter("failureOnly")); DataSetBuilder<String,NumberOnlyBuildLabel> dsb = new DataSetBuilder<String,NumberOnlyBuildLabel>(); int cap = Integer.getInteger(AbstractTestResultAction.class.getName() + ".test.trend.max", Integer.MAX_VALUE); int count = 0; for (AbstractTestResultAction<?> a = this; a != null; a = a.getPreviousResult(AbstractTestResultAction.class, false)) { if (++count > cap) { LOGGER.log(Level.FINE, "capping test trend for {0} at {1}", new Object[] {run, cap}); break; } dsb.add( a.getFailCount(), "failed", new NumberOnlyBuildLabel(a.run)); if(!failureOnly) { dsb.add( a.getSkipCount(), "skipped", new NumberOnlyBuildLabel(a.run)); dsb.add( a.getTotalCount()-a.getFailCount()-a.getSkipCount(),"total", new NumberOnlyBuildLabel(a.run)); } } LOGGER.log(Level.FINER, "total test trend count for {0}: {1}", new Object[] {run, count}); return dsb.build(); }
Example #3
Source File: AnchoreProjectAction.java From anchore-container-scanner-plugin with Apache License 2.0 | 5 votes |
private CategoryDataset buildDataSet() { DataSetBuilder<String, NumberOnlyBuildLabel> dsb = new DataSetBuilder<>(); int cap = Integer.getInteger(AnchoreAction.class.getName() + ".anchore.trend.max", AnchoreTrendGraph.MAX_HISTORY_DEFAULT); int count = 0; for (AnchoreAction a = this.base; a != null; a = a.getPreviousResult()) { if (++count > cap) { break; } dsb.add(a.getGoActionCount(), "0_go", new NumberOnlyBuildLabel(a.getBuild())); dsb.add(a.getWarnActionCount(), "1_warn", new NumberOnlyBuildLabel(a.getBuild())); dsb.add(a.getStopActionCount(), "2_stop", new NumberOnlyBuildLabel(a.getBuild())); } return dsb.build(); }
Example #4
Source File: AWSDeviceFarmGraph.java From aws-device-farm-jenkins-plugin with Apache License 2.0 | 5 votes |
/** * Generate a results (pass/warn/fail) trend graph for recent results. * * @param owner The build which owns the latest result. * @param isCompleted The flag to denote if the result is completed which determines our caching. * @param results The list of previous to latest results which generate the trend. * @return The result trend graph. */ public static Graph createResultTrendGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, List<AWSDeviceFarmTestResult> results) { List<String> rows = new ArrayList<String>(); List<Number> vals = new ArrayList<Number>(); List<NumberOnlyBuildLabel> cols = new ArrayList<NumberOnlyBuildLabel>(); for (AWSDeviceFarmTestResult result : results) { Run<?, ?> build = result.getOwner(); // Create label for this result using its Jenkins build number. NumberOnlyBuildLabel label = new NumberOnlyBuildLabel(build); // Add 'pass' results rows.add("Pass"); cols.add(label); vals.add(result.getPassCount()); // Add 'warn' results rows.add("Warn"); cols.add(label); vals.add(result.getWarnCount()); // Add 'fail' results. rows.add("Fail"); cols.add(label); vals.add(result.getFailCount()); } CategoryDataset dataset = createDataset(vals, rows, cols); Color[] colors = new Color[]{AWSDeviceFarmGraph.PassColor, AWSDeviceFarmGraph.WarnColor, AWSDeviceFarmGraph.FailColor}; return new AWSDeviceFarmGraph(owner, isCompleted, getGraphSize(), dataset, "Build #", "# of tests", colors); }
Example #5
Source File: AWSDeviceFarmGraph.java From aws-device-farm-jenkins-plugin with Apache License 2.0 | 3 votes |
/** * Generate a category dataset. * * @param values The values in the dataset. * @param rows The names of the rows in the dataset. * @param columns The columns in the the dataset. * @return The category dataset. */ private static CategoryDataset createDataset(List<Number> values, List<String> rows, List<NumberOnlyBuildLabel> columns) { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); for (int i = 0; i < values.size(); i++) { dataset.addValue(values.get(i), rows.get(i), columns.get(i)); } return dataset; }