diff --git a/src/main/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java b/src/main/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java index 4cf283047b78ff7fb3921368c2d53a258072a1b9..e95cccebc549266844ce65e4c3d6fec411a77d0b 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java @@ -22,10 +22,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.function.Function; -import java.util.logging.Logger; import java.util.stream.IntStream; -import com.google.common.base.Stopwatch; import com.google.common.collect.FluentIterable; import com.google.common.collect.Iterables; import com.google.common.collect.Maps; @@ -66,7 +64,6 @@ public final class HazardExport { private static final String CURVE_FILE_ASCII_TRUNCATED = "curves-truncated.csv"; private static final String VALUE_FMT = "%.8e"; - private final Logger log; private final Path dir; private final HazardModel model; private final CalcConfig config; @@ -75,9 +72,6 @@ public final class HazardExport { private final Function<Double, String> valueFormatter; - private final Stopwatch batchWatch; - private final Stopwatch totalWatch; - private int batchCount = 0; private int resultCount = 0; private final boolean namedSites; @@ -86,10 +80,8 @@ public final class HazardExport { private HazardExport( HazardModel model, CalcConfig config, - List<Site> sites, - Logger log) throws IOException { + List<Site> sites) throws IOException { - this.log = log; this.dir = createOutputDir(config.output.directory); this.model = model; this.config = config; @@ -104,9 +96,6 @@ public final class HazardExport { Site demoSite = sites.get(0); this.namedSites = demoSite.name() != Site.NO_NAME; - this.batchWatch = Stopwatch.createStarted(); - this.totalWatch = Stopwatch.createStarted(); - init(sites); } @@ -121,10 +110,9 @@ public final class HazardExport { public static HazardExport create( HazardModel model, CalcConfig config, - List<Site> sites, - Logger log) throws IOException { + List<Site> sites) throws IOException { - return new HazardExport(model, config, sites, log); + return new HazardExport(model, config, sites); } /* Initialize output directories. */ @@ -195,13 +183,6 @@ public final class HazardExport { checkState(!used, "This result handler is expired"); writeHazard(hazard); resultCount++; - if (resultCount % 10 == 0) { - batchCount++; - log.info(String.format( - " batch: %s in %s – %s sites in %s", - batchCount, batchWatch, resultCount, totalWatch)); - batchWatch.reset().start(); - } } /** @@ -209,26 +190,16 @@ public final class HazardExport { * 'used'; no more results may be added. */ public void expire() { - batchWatch.stop(); - totalWatch.stop(); used = true; } /** - * The number of hazard [and disagg] results passed to this handler thus far. + * The number of hazard results passed to this handler thus far. */ public int resultCount() { return resultCount; } - /** - * A string representation of the time duration that this result handler has - * been running. - */ - public String elapsedTime() { - return totalWatch.toString(); - } - /** * The target output directory established by this handler. */ @@ -236,7 +207,7 @@ public final class HazardExport { return dir; } - /* Write the supplied hazard and possible disagg results to file(s). */ + /* Write the supplied hazard results to file(s). */ private void writeHazard(Hazard hazard) throws IOException { Set<Gmm> gmms = hazard.model.gmms(); diff --git a/src/main/java/gov/usgs/earthquake/nshmp/calc/Sites.java b/src/main/java/gov/usgs/earthquake/nshmp/calc/Sites.java index 29b8bac9adbf72a72110a4db45c2029bc1123224..cde75e2aadc6bffddc2345d7e33e8e9a2f96b4a8 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/calc/Sites.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/calc/Sites.java @@ -71,7 +71,7 @@ public final class Sites { * If a sites file contains columns for basin depths, a 'null' value string * indicates a GMM should do whatever it defines as default behavior and * will override values that may be included in the site data of a model. If - * the value is empty, then whatever defaults from (2) or (3) will be used. + * the value is empty, then whatever values from (2) or (3) will be used. */ Location loc = Location.create( diff --git a/src/test/java/gov/usgs/earthquake/nshmp/model/LoaderTests.java b/src/test/java/gov/usgs/earthquake/nshmp/model/LoaderTests.java index 2237cd95c176e1ea3eb04a4279ab70edca63027a..c1b56bb6487e40ceab0b22ec2a9e981435930133 100644 --- a/src/test/java/gov/usgs/earthquake/nshmp/model/LoaderTests.java +++ b/src/test/java/gov/usgs/earthquake/nshmp/model/LoaderTests.java @@ -17,7 +17,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.logging.Logger; import java.util.stream.Stream; import org.junit.jupiter.api.BeforeAll; @@ -214,8 +213,7 @@ class LoaderTests { List<Site> sites) throws IOException { ExecutorService exec = initExecutor(config.performance.threadCount); - Logger log = Logger.getLogger(LoaderTests.class.getName()); - HazardExport handler = HazardExport.create(model, config, sites, log); + HazardExport handler = HazardExport.create(model, config, sites); for (Site site : sites) { Hazard hazard = HazardCalcs.hazard(model, config, site, exec); handler.write(hazard);