+ /**
+ * collect job execution statiustics for the last 7 days.
+ *
+ * @param model
+ * MVC model object
+ *
+ * @return the the same model, but with additional parameters with the job
+ * statistics
+ */
+ private ModelMap getStatistics(ModelMap model) {
+ int ndays = 7;
+ model.addAttribute("ndays", ndays);
+
+ Calendar cal = Calendar.getInstance();
+ String date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
+ long longDate2 = DateFormatter.DateParsing(date2, formaterYYMMDD);
+ cal.add(Calendar.DATE, -ndays);
+ String date1 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
+ long longDate1 = DateFormatter.DateParsing(date1, formaterYYMMDD);
+
+ DailyStatisticsReader reader = new DailyStatisticsReader();
+ TotalJobsStatisticBean res = reader.query(longDate1, longDate2);
+ Total total = res.getWholeTotal();
+ model.addAttribute("total", total.getTotal());
+ model.addAttribute("totalOK", total.getTotalOK());
+ model.addAttribute("totalTimeout", total.getTotalOK());
+ model.addAttribute("totalError", total.getTotalError());
+ model.addAttribute("totalStopped", total.getTotalStopped());
+ return model;
+ }
+