コード例 #1
0
 /** Called by Jenkins when a build is finishing. */
 @Override
 public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
     throws IOException, InterruptedException {
   listener.getLogger().println("Recording plot data");
   // add the build to each plot
   for (Plot plot : getPlots()) {
     plot.addBuild(build, listener.getLogger());
   }
   // misconfigured plots will not fail a build so always return true
   return true;
 }
コード例 #2
0
 /**
  * Adds the new plot to the plot data structures managed by this object.
  *
  * @param plot the new plot
  */
 public void addPlot(Plot plot) {
   // update the plot list
   plots.add(plot);
   // update the group-to-plot map
   String urlGroup = originalGroupToUrlEncodedGroup(plot.getGroup());
   if (groupMap.containsKey(urlGroup)) {
     ArrayList<Plot> list = groupMap.get(urlGroup);
     list.add(plot);
   } else {
     ArrayList<Plot> list = new ArrayList<Plot>();
     list.add(plot);
     groupMap.put(urlGroup, list);
   }
 }
コード例 #3
0
 private static Plot bindPlot(JSONObject data, StaplerRequest req) {
   Plot p = req.bindJSON(Plot.class, data);
   p.series = SeriesFactory.createSeriesList(data.get("series"), req);
   return p;
 }