Skip to content
Snippets Groups Projects
Commit a9a2b4df authored by Powers, Peter M.'s avatar Powers, Peter M.
Browse files

bathc logging improvements

parent b51da263
No related branches found
No related tags found
2 merge requests!593Production Release | nshm-haz,!591Code review 479
......@@ -280,7 +280,7 @@ public class DisaggCalc {
log.info(PROGRAM + " (return period): calculating ...");
HazardExport handler = HazardExport.create(model, config, sites, log);
HazardExport handler = HazardExport.create(model, config, sites);
Path disaggDir = handler.outputDir().resolve("disagg");
Files.createDirectory(disaggDir);
......@@ -310,17 +310,18 @@ public class DisaggCalc {
GSON.toJson(response, writer);
writer.close();
if (i % logInterval == 0) {
int count = i + 1;
if (count % logInterval == 0) {
log.info(String.format(
" %s of %s sites completed in %s",
i + 1, sites.size(), stopwatch));
count, sites.size(), stopwatch));
}
}
handler.expire();
log.info(String.format(
PROGRAM + " (return period): %s sites completed in %s",
handler.resultCount(), handler.elapsedTime()));
sites.size(), stopwatch.stop()));
exec.shutdown();
return handler.outputDir();
......@@ -396,16 +397,17 @@ public class DisaggCalc {
GSON.toJson(response, writer);
writer.close();
if (i % logInterval == 0) {
int count = i + 1;
if (count % logInterval == 0) {
log.info(String.format(
" %s of %s sites completed in %s",
i + 1, sites.size(), stopwatch));
count, sites.size(), stopwatch));
}
}
log.info(String.format(
PROGRAM + " (IML): %s sites completed in %s",
sites.size(), stopwatch));
sites.size(), stopwatch.stop()));
exec.shutdown();
return outDir;
......
......@@ -172,7 +172,7 @@ public class HazardCalc {
log.info("Threads: " + ((ThreadPoolExecutor) exec).getCorePoolSize());
log.info(PROGRAM + ": calculating ...");
HazardExport handler = HazardExport.create(model, config, sites, log);
HazardExport handler = HazardExport.create(model, config, sites);
CalcTask.Builder calcTask = new CalcTask.Builder(model, config, exec);
WriteTask.Builder writeTask = new WriteTask.Builder(handler);
......@@ -184,10 +184,11 @@ public class HazardCalc {
Site site = sites.get(i);
Hazard hazard = calcTask.withSite(site).call();
out = exec.submit(writeTask.withResult(hazard));
if (i % logInterval == 0) {
int count = i + 1;
if (count % logInterval == 0) {
log.info(String.format(
" %s of %s sites completed in %s",
i + 1, sites.size(), stopwatch));
count, sites.size(), stopwatch));
}
}
/* Block shutdown until last task is returned. */
......@@ -197,7 +198,7 @@ public class HazardCalc {
exec.shutdown();
log.info(String.format(
PROGRAM + ": %s sites completed in %s",
handler.resultCount(), handler.elapsedTime()));
handler.resultCount(), stopwatch.stop()));
return outputDir;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment