\r
static final int UNDEFINED = -1;\r
\r
- private static final Logger log = Logger\r
- .getLogger(ExecutionStatCollector.class);\r
+ private static final Logger log = Logger.getLogger(ExecutionStatCollector.class);\r
\r
static SimpleDateFormat DF = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");\r
\r
log.info("Starting stat collector for directory: " + workDirectory);\r
log.info("Maximum allowed runtime(h): " + timeOutInHours);\r
if (!PathValidator.isValidDirectory(workDirectory)) {\r
- throw new IllegalArgumentException("workDirectory '"\r
- + workDirectory + "' does not exist!");\r
+ throw new IllegalArgumentException("workDirectory '" + workDirectory + "' does not exist!");\r
}\r
this.workDirectory = new File(workDirectory);\r
stats = new ArrayList<JobStat>();\r
if (timeOutInHours <= 0) {\r
throw new IllegalArgumentException(\r
- "Timeout value must be greater than 0! Given value: "\r
- + timeOutInHours);\r
+ "Timeout value must be greater than 0! Given value: " + timeOutInHours);\r
}\r
this.timeOutInHours = timeOutInHours;\r
}\r
\r
// TODO test!\r
void collectStatistics() {\r
+ // clear stats array;\r
+ stats.clear();\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
- if (hasCompleted(jd)) {\r
- stats.add(jstat);\r
+ // skip work directory with test input\r
+ if (InputFilter.accept(new File(file.getPath() + File.separator + SkeletalExecutable.INPUT))) {\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
+ if (hasCompleted(jd)) {\r
+ stats.add(jstat);\r
+ System.out.println("added: id = " + jd);\r
+ } else {\r
+ log.debug("Skipping the job: " + jstat);\r
+ log.debug("As it has not completed yet");\r
+ }\r
+ // System.out.println(jd.getJobStat().getJobReportTabulated());\r
} else {\r
- log.debug("Skipping the job: " + jstat);\r
- log.debug("As it has not completed yet");\r
+ log.trace("training input: " + file.getPath() + File.separator + SkeletalExecutable.INPUT);\r
}\r
- // System.out.println(jd.getJobStat().getJobReportTabulated());\r
}\r
}\r
@Override\r