done time execution for queries, query by counter of job, total in column in query...
[proteocache.git] / server / compbio / statistic / StatisticsProt.java
index 0294747..df6fec5 100644 (file)
@@ -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<DataBase> readProtID() {
+       public List<DataBase> readProtID(int counter) {
                query = new ArrayList<DataBase>();
                int row_count = 100000000;
                RangeSlicesQuery<String, String, String> 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);