Remove test jobs from statistics
[jabaws.git] / webservices / compbio / stat / collector / ExecutionStatCollector.java
index cd97f4a..c64a5b8 100644 (file)
@@ -38,6 +38,7 @@ import compbio.engine.client.SkeletalExecutable;
 import compbio.metadata.JobStatus;\r
 import compbio.util.FileUtil;\r
 import compbio.ws.client.Services;\r
+import compbio.ws.client.ServicesUtil;\r
 \r
 /**\r
  * Number of runs of each WS = number of folders with name\r
@@ -277,11 +278,11 @@ public class ExecutionStatCollector implements Runnable {
                }\r
 \r
                private Services getService() {\r
-                       return Services.getServiceByJobDirectory(jobdir);\r
+                       return ServicesUtil.getServiceByJobDirectory(jobdir);\r
                }\r
 \r
                long getResultSize() {\r
-                       Class<? extends Executable<?>> name = Services\r
+                       Class<? extends Executable<?>> name = ServicesUtil\r
                                        .getRunnerByJobDirectory(jobdir);\r
 \r
                        File f = null;\r
@@ -301,7 +302,7 @@ public class ExecutionStatCollector implements Runnable {
                }\r
 \r
                long getInputSize() {\r
-                       Class<? extends Executable<?>> name = Services\r
+                       Class<? extends Executable<?>> name = ServicesUtil\r
                                        .getRunnerByJobDirectory(jobdir);\r
 \r
                        File input = files.get(SkeletalExecutable.INPUT);\r
@@ -345,9 +346,15 @@ public class ExecutionStatCollector implements Runnable {
                }\r
        }\r
 \r
+       // TODO test!\r
        void collectStatistics() {\r
                File[] files = workDirectory.listFiles(directories);\r
                for (File file : files) {\r
+                       if (!InputFilter.accept(new File(file.getPath() + File.separator\r
+                                       + SkeletalExecutable.INPUT))) {\r
+                               // skip work directory with test input\r
+                               continue;\r
+                       }\r
                        JobDirectory jd = new JobDirectory(file);\r
                        JobStat jstat = jd.getJobStat();\r
                        // Do not record stats on the job that has not completed yet\r
@@ -360,7 +367,6 @@ public class ExecutionStatCollector implements Runnable {
                        // System.out.println(jd.getJobStat().getJobReportTabulated());\r
                }\r
        }\r
-\r
        @Override\r
        public void run() {\r
                log.info("Started updating statistics at " + new Date());\r