X-Git-Url: http://source.jalview.org/gitweb/?p=proteocache.git;a=blobdiff_plain;f=server%2Fcompbio%2Fcontrollers%2FDailyStatisticsController.java;fp=server%2Fcompbio%2Fcontrollers%2FDailyStatisticsController.java;h=403c220807c7f599aa00173695ae733c377d3bd4;hp=75ab67aa93a0d5f4cd4b519a2f04ef723f50deef;hb=6823d2f36ff55b7ab11d674e3fe4d04dc57d6bbf;hpb=e8b88c0c8e432f8bc1aefdbd81df81e9ef706242 diff --git a/server/compbio/controllers/DailyStatisticsController.java b/server/compbio/controllers/DailyStatisticsController.java index 75ab67a..403c220 100644 --- a/server/compbio/controllers/DailyStatisticsController.java +++ b/server/compbio/controllers/DailyStatisticsController.java @@ -14,9 +14,11 @@ import compbio.engine.JobStatus; 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 @@ -61,8 +63,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) @@ -102,6 +104,14 @@ public class DailyStatisticsController extends BasicController { model.put("date2", date2); TotalJobsStatisticBean res = reader.query(longDate1, longDate2); 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));