X-Git-Url: http://source.jalview.org/gitweb/?p=proteocache.git;a=blobdiff_plain;f=server%2Fcompbio%2Fcontrollers%2FDailyStatisticsController.java;h=a9b51f112e1253ee6f070f7603ad775d3fa85565;hp=72ece7eea2034821757c238f7ea8f7a54a62068a;hb=8256bed38c0abeefe003adf6d9f126113f9cc5b3;hpb=2b94caaf1cba8a25da8d62638a36abce37b696ff diff --git a/server/compbio/controllers/DailyStatisticsController.java b/server/compbio/controllers/DailyStatisticsController.java index 72ece7e..a9b51f1 100644 --- a/server/compbio/controllers/DailyStatisticsController.java +++ b/server/compbio/controllers/DailyStatisticsController.java @@ -14,6 +14,7 @@ import compbio.engine.JobStatus; import compbio.cassandra.CassandraReader; import compbio.cassandra.DateBean; import compbio.cassandra.DateFormatter; +import compbio.cassandra.Total; import compbio.cassandra.TotalJobsStatisticBean; import compbio.statistic.CassandraRequester; @@ -60,8 +61,8 @@ public class DailyStatisticsController extends BasicController { * 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) @@ -101,6 +102,14 @@ public class DailyStatisticsController extends BasicController { model.put("date2", date2); TotalJobsStatisticBean res = cr.countJobs(date1, date2); model.put("result", res); + Map results = res.getDateTotal(); + String csvline = "\'Date\',\'Total\',\'OK\',\'Stopped\',\'Error\',\'Timeout\'%0A"; + for (Map.Entry 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));