From: Sasha Sherstnev Date: Tue, 29 Oct 2013 14:59:46 +0000 (+0000) Subject: done time execution for queries, query by counter of job, total in column in query... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a2da61d72212909ad6ededefdc06b04113e380e6;p=proteocache.git done time execution for queries, query by counter of job, total in column in query by execution time of job --- diff --git a/.classpath b/.classpath index 291ed8d..fddf6c3 100644 --- a/.classpath +++ b/.classpath @@ -8,16 +8,6 @@ - - - - - - - - - - @@ -27,5 +17,15 @@ + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index bc59027..108b089 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,4 @@ - - + @@ -7,10 +6,7 @@ - - + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index 885ab91..bad9d4b 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,6 +1,6 @@ - + diff --git a/datadb/compbio/cassandra/DataBase.java b/datadb/compbio/cassandra/DataBase.java index bdb1a8c..016a30a 100644 --- a/datadb/compbio/cassandra/DataBase.java +++ b/datadb/compbio/cassandra/DataBase.java @@ -13,6 +13,7 @@ public class DataBase { private String jpred; private List subProt; private List timeRez; + private List timeTotalExec; public DataBase() { } @@ -85,5 +86,13 @@ public class DataBase { public List getTimeRez() { return timeRez; } + + public void setTimeTotalExec(List timeTotalExec) { + this.timeTotalExec = timeTotalExec; + } + + public List getTimeTotalExec() { + return timeTotalExec; + } } diff --git a/server/compbio/listeners/LengthServlet.java b/server/compbio/listeners/LengthServlet.java index 533e6e1..8bcc886 100644 --- a/server/compbio/listeners/LengthServlet.java +++ b/server/compbio/listeners/LengthServlet.java @@ -24,6 +24,7 @@ public class LengthServlet extends HttpServlet { * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + final long startTime = System.currentTimeMillis(); String date1 = request.getParameter("data1"); String date2 = request.getParameter("data2"); StatisticsProt sp = new StatisticsProt(); @@ -36,6 +37,8 @@ public class LengthServlet extends HttpServlet { request.setAttribute("data2", date2); request.setAttribute("result", sp.readLength(date1, date2)); request.setAttribute("flag", request.getParameter("option")); + final long endTime = System.currentTimeMillis(); + request.setAttribute("timeExecution", (endTime - startTime)); RequestDispatcher rd = request.getRequestDispatcher("/ReportLength.jsp"); rd.forward(request, response); } diff --git a/server/compbio/listeners/ProtServlet.java b/server/compbio/listeners/ProtServlet.java index cb74ecc..d567106 100644 --- a/server/compbio/listeners/ProtServlet.java +++ b/server/compbio/listeners/ProtServlet.java @@ -23,21 +23,26 @@ public class ProtServlet extends HttpServlet { * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + final long startTime = System.currentTimeMillis(); String flag = request.getParameter("protein"); String prot = request.getParameter("prot"); - String checkbox = request.getParameter("option"); + String search = request.getParameter("Search"); + int counter = Integer.parseInt(request.getParameter("counterJob")); StatisticsProt sp = new StatisticsProt(); - if (checkbox != null) { - request.setAttribute("result", sp.readProtID()); + if (search.equals("Search counter")) { + request.setAttribute("result", sp.readProtID(counter)); } else { if (flag.equals("whole")) request.setAttribute("result", sp.readProteins(prot)); else request.setAttribute("result", sp.readPart(prot)); } + final long endTime = System.currentTimeMillis(); + request.setAttribute("timeExecution", (endTime - startTime)); request.setAttribute("prot", prot); request.setAttribute("flag", flag); - request.setAttribute("checkbox", checkbox); + request.setAttribute("search", search); + request.setAttribute("counter", counter); RequestDispatcher rd = request.getRequestDispatcher("/ReportProt.jsp"); rd.forward(request, response); } diff --git a/server/compbio/listeners/QueryServlet.java b/server/compbio/listeners/QueryServlet.java index 196decb..a69a18f 100644 --- a/server/compbio/listeners/QueryServlet.java +++ b/server/compbio/listeners/QueryServlet.java @@ -23,6 +23,7 @@ public class QueryServlet extends HttpServlet { * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + final long startTime = System.currentTimeMillis(); String date1 = request.getParameter("data1"); String date2 = request.getParameter("data2"); StatisticsProt sp = new StatisticsProt(); @@ -35,6 +36,8 @@ public class QueryServlet extends HttpServlet { request.setAttribute("data2", date2); List res = sp.readDetails(date1, date2); request.setAttribute("result", res); + final long endTime = System.currentTimeMillis(); + request.setAttribute("timeExecution", (endTime - startTime)); System.out.println ("QueryServlet.doGet: total number of dates = " + res.size()); request.setAttribute("flag", request.getParameter("option")); RequestDispatcher rd = request.getRequestDispatcher("/ReportNew.jsp"); diff --git a/server/compbio/statistic/StatisticsProt.java b/server/compbio/statistic/StatisticsProt.java index 0294747..df6fec5 100644 --- a/server/compbio/statistic/StatisticsProt.java +++ b/server/compbio/statistic/StatisticsProt.java @@ -119,7 +119,7 @@ public class StatisticsProt { while (itCol.hasNext()) { String id = itCol.next().getName(); long lenResult = CountID(id); - if (lenResult <= 30) + if (lenResult <= 30) timeResult.set(0, timeResult.get(0) + 1); else if (lenResult > 30 && lenResult <= 60) timeResult.set(1, timeResult.get(1) + 1); @@ -129,6 +129,8 @@ public class StatisticsProt { timeResult.set(3, timeResult.get(3) + 1); } } + for (int i = 0; i < 4; i++) + totalTime.set(i, totalTime.get(i) + timeResult.get(i)); DataBase db = new DataBase(); db.setTimeRez(timeResult); db.setDate(DateFormat(dateStart)); @@ -136,6 +138,9 @@ public class StatisticsProt { } dateStart += MILLISECONDS_PER_DAY; } + DataBase db = new DataBase(); + db.setTimeTotalExec(totalTime); + query.add(db); System.out.println("StatisticsProt.readLength: total number of dates = " + query.size()); return query; } @@ -165,7 +170,7 @@ public class StatisticsProt { } // query by a protein sequence - public List readProtID() { + public List readProtID(int counter) { query = new ArrayList(); int row_count = 100000000; RangeSlicesQuery result = HFactory.createRangeSlicesQuery(cc.GetKeyspace(), StringSerializer.get(), @@ -190,7 +195,7 @@ public class StatisticsProt { ++npred; } } - if (npred > 3) { + if (npred >= counter) { DataBase db = new DataBase(); db.setProt(last_key); db.setTotalId(npred); diff --git a/website/ReportLength.jsp b/website/ReportLength.jsp index c7f9cff..f12c78c 100644 --- a/website/ReportLength.jsp +++ b/website/ReportLength.jsp @@ -12,6 +12,7 @@

Time execution for the interval: ${data1} - ${data2}

+

Time execution: ${timeExecution} ms

@@ -23,12 +24,24 @@ - - - - - - + + + + + + + + + + + + + + + + + +
${res.date}${time}
${res.date}${time}
Total:${total}
diff --git a/website/ReportNew.jsp b/website/ReportNew.jsp index 498fa8c..5abae4d 100644 --- a/website/ReportNew.jsp +++ b/website/ReportNew.jsp @@ -12,6 +12,7 @@ to +

Time execution: ${timeExecution} ms

diff --git a/website/ReportProt.jsp b/website/ReportProt.jsp index ae06cf6..3f6028a 100644 --- a/website/ReportProt.jsp +++ b/website/ReportProt.jsp @@ -4,11 +4,18 @@ <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> <%@ taglib uri="http://displaytag.sf.net" prefix="dt"%> - -

Dundee ProteoCache query result

+ + +

Dundee ProteoCache query result for jobs more than ${counter}

+
+ +

Dundee ProteoCache query result

+
+
+

Time execution: ${timeExecution} ms

- + @@ -22,7 +29,7 @@ diff --git a/website/Sequence.jsp b/website/Sequence.jsp index 1cbcfed..9e28601 100644 --- a/website/Sequence.jsp +++ b/website/Sequence.jsp @@ -14,8 +14,10 @@

search by the whole sequence search by a part of sequence
-

- Sequence with more then 3 jobs
+

+

Enter minimum counter of job/protein

+
+

Number of jobs${res.prot} + href="ProtServlet?prot=${res.prot}&protein=whole&Search=Search+sequence&counterJob=${counter}">${res.prot}