import compbio.beans.DateBean;
import compbio.beans.TotalJobsStatisticBean;
import compbio.cassandra.DateFormatter;
+
+import compbio.beans.Total;
import compbio.cassandra.readers.CassandraReader;
import compbio.cassandra.readers.DailyStatisticsReader;
-import compbio.cassandra.readers.ProteoDAO;
+
/**
* @author Alexander Sherstnev
* the final date for the report (if option is set, date2 =
* today)
* @param option
- * defined whether the whole time range of jobs is reported
- * (null means date1 and date2 are used)
+ * defined whether the whole time range of jobs is reported (null
+ * means date1 and date2 are used)
* @return link to the report JSP page
*/
@RequestMapping(value = "/stat/jobsdaily/results", method = RequestMethod.GET)
model.put("date2", date2);
TotalJobsStatisticBean res = reader.query(longDate1, longDate2);
model.put("result", res);
+ Map<String, Total> results = res.getDateTotal();
+ String csvline = "\'Date\',\'Total\',\'OK\',\'Stopped\',\'Error\',\'Timeout\'%0A";
+ for (Map.Entry<String, Total> entry : results.entrySet()) {
+ csvline += "\'" + entry.getKey() + "\',\'" + entry.getValue().getTotal() + "\',\'" + entry.getValue().getTotalOK() + "\',\'"
+ + entry.getValue().getTotalStopped() + "\',\'" + entry.getValue().getTotalError() + "\',\'"
+ + entry.getValue().getTotalTimeOut() + "\'%0A";
+ }
+ model.put("csvfile", csvline);
model.put("ndays", res.getDateTotal().size());
final long endTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));