import java.util.Date;\r
import java.util.List;\r
\r
+import compbio.engine.client.ConfExecutable;\r
import compbio.ws.client.Services;\r
\r
public class StatProcessor {\r
this.stats = stats;\r
}\r
\r
+ /*\r
+ * TODO List<JobStat> getNewStat() throws SQLException { Set<String> jobids\r
+ * = new HashSet<String>(); for(JobStat js: stats) { jobids.add(js.jobname);\r
+ * } StatDB.removeRecordedJobs(jobids); List<String> newjobs = new\r
+ * HashSet<String>(); for(String jobid: jobids) { if(newjobs.co)\r
+ * jobids.add(js.jobname); } }\r
+ */\r
+\r
List<JobStat> getAbandonedJobs() {\r
List<JobStat> abJobs = new ArrayList<StatProcessor.JobStat>();\r
for (JobStat js : stats) {\r
report += "Cancelled Jobs: " + getCancelledJobs().size() + "\n";\r
report += "Total Runtime (s): " + getTotalRuntime() + "\n";\r
report += "Unsuccessful Jobs: " + getUnsuccessfulJobs().size() + "\n";\r
- report += "10 longest jobs: \n\n" + sortByRuntime().subList(0, 9)\r
- + "\n";\r
- report += "10 biggest jobs: \n\n" + sortByResultSize().subList(0, 9)\r
- + "\n";\r
+ if (sortByRuntime().size() > 10) {\r
+ report += "10 longest jobs: \n\n" + sortByRuntime().subList(0, 9)\r
+ + "\n";\r
+ } else {\r
+ report += "longest jobs: \n\n" + sortByRuntime() + "\n";\r
+ }\r
+ if (sortByResultSize().size() > 10)\r
+ report += "10 biggest jobs: \n\n"\r
+ + sortByResultSize().subList(0, 9) + "\n";\r
+ else {\r
+ report += "biggest jobs: \n\n" + sortByResultSize() + "\n";\r
+ }\r
return report;\r
}\r
\r
};\r
\r
Services webService;\r
+ String clusterJobId;\r
String jobname;\r
long start;\r
long finish;\r
boolean isCollected;\r
boolean isCancelled;\r
\r
- JobStat(Services webService, String jobname, long start, long finish,\r
- long inputSize, long resultSize, boolean isCollected,\r
- boolean isCancelled) {\r
+ JobStat(Services webService, String clusterJobId, String jobname,\r
+ long start, long finish, long inputSize, long resultSize,\r
+ boolean isCollected, boolean isCancelled) {\r
super();\r
this.webService = webService;\r
+ this.clusterJobId = clusterJobId;\r
this.jobname = jobname;\r
this.start = start;\r
this.finish = finish;\r
this.isCancelled = isCancelled;\r
}\r
\r
+ public boolean isClusterJob() {\r
+ return jobname.startsWith(ConfExecutable.CLUSTER_TASK_ID_PREFIX);\r
+ }\r
+\r
@Override\r
public int hashCode() {\r
final int prime = 31;\r
}\r
report += "Input size " + inputSize + "\n";\r
report += "Result size " + resultSize + "\n";\r
+ report += "ClusterJobID " + clusterJobId + "\n";\r
report += "Collected? " + isCollected + "\n";\r
+ report += "Cancelled? " + isCancelled + "\n";\r
return report;\r
}\r
\r
}\r
report += inputSize + "\t";\r
report += resultSize + "\t";\r
+ report += clusterJobId + "\t";\r
report += isCollected + "\t";\r
+ report += isCancelled + "\t";\r
return report;\r
}\r
\r