--- dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Lookup.java 2014/09/12 14:05:10 2217 +++ dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Lookup.java 2014/09/22 07:39:46 2227 @@ -37,16 +37,21 @@ static Statistik flestDaekkede = new Statistik(); static Statistik flestIkkeDaekkede = new Statistik(); + static Statistik mestBrugteTid = new Statistik(); + static Statistik stoersteDataset = new Statistik(); static class Statistik { int postnr; int antalDaekkede = 0; int antalIkkeDaekkede = 0; + int totalDataset = 0; + long forbrugtTid = 0; + @Override public String toString() { - return "postnr=" + postnr + " antalIkkeDaekkede=" + antalIkkeDaekkede + " antalDaekkede=" + antalDaekkede; + return "postnr=" + postnr + " antalIkkeDaekkede=" + antalIkkeDaekkede + " antalDaekkede=" + antalDaekkede + " forbrugtTid=" + forbrugtTid + " totalDataset=" + totalDataset; } } @@ -62,7 +67,15 @@ } if (stat.antalIkkeDaekkede > flestIkkeDaekkede.antalIkkeDaekkede) { flestIkkeDaekkede = stat; - } + } + + if (stat.totalDataset > mestBrugteTid.totalDataset) { + stoersteDataset = stat; + } + + if (stat.forbrugtTid > mestBrugteTid.forbrugtTid) { + mestBrugteTid = stat; + } } public void doLookup() throws BoundingBoxException { @@ -90,9 +103,8 @@ stat.postnr = postnr; stat.antalDaekkede = daekkedeAdresser.length; stat.antalIkkeDaekkede = queue.size(); - - saveStatistics(stat); - + stat.totalDataset = stat.antalDaekkede * stat.antalIkkeDaekkede; + logger.info("Starter beregning for " + postnr); start2 = System.currentTimeMillis(); @@ -109,6 +121,8 @@ Thread.sleep(10);//wait for worker threads } + db.saveBatch();//Save any unsaved rows + } catch(Exception e) { logger.log(Level.WARNING, "Exception during lookup", e); @@ -121,6 +135,8 @@ } long now = System.currentTimeMillis(); + stat.forbrugtTid = (now-start1); + saveStatistics(stat); logger.info( stat.toString() ); logger.info("Done! elapsed=" + (now-start1) + "/" + (now-start2) + " postnr=" + postnr); @@ -175,7 +191,6 @@ - File confFile = new File( CONFIG_FILENAME ); if (! confFile.exists() ) { logger.warning("Config file not found: " + CONFIG_FILENAME); @@ -237,8 +252,10 @@ long now = System.currentTimeMillis(); long elapsed = now - start ; + logger.info("Mest brugte tid: " + mestBrugteTid); logger.info("Flest Ikke-dækkede, " + flestIkkeDaekkede); logger.info("Flest Dækkede, " + flestDaekkede); + logger.info("Største Dataset, " + stoersteDataset); logger.info("Fuld load done : " + formatMilliSeconds(elapsed) );