# HG changeset patch # User Ingo Weinzierl # Date 1267633579 0 # Node ID 83f8f98a4f11e3751c5041c400427559768d2f0b # Parent 8d2bd52f05e3118fda557d782d0d7bf16fd8472c Log important values used for gap detection if debug level is enabled. gnv-artifacts/trunk@728 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 8d2bd52f05e3 -r 83f8f98a4f11 gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Wed Mar 03 15:05:12 2010 +0000 +++ b/gnv-artifacts/ChangeLog Wed Mar 03 16:26:19 2010 +0000 @@ -1,3 +1,8 @@ +2010-03-03 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java: Log important + values used for gap detection if debug level is enabled. + 2010-03-03 Ingo Weinzierl Issue146 diff -r 8d2bd52f05e3 -r 83f8f98a4f11 gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java Wed Mar 03 15:05:12 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java Wed Mar 03 16:26:19 2010 +0000 @@ -51,7 +51,8 @@ public static final String DEFAULT_DATE_FORMAT = "dd-MMM-yyyy"; - private static final long NO_TIME_GAP = Long.MAX_VALUE - 1000; + public static final long NO_TIME_GAP = Long.MAX_VALUE - 1000; + public static final int GAP_SIZE = 5; // in percent private static Logger log = Logger.getLogger(TimeSeriesChart.class); @@ -400,6 +401,20 @@ startDate, endDate, startPos, endPos, gapID ); + if (log.isDebugEnabled()) { + log.debug("*****************************************************"); + log.debug("Values of gap detection."); + log.debug("Start date: " + startDate.toString()); + log.debug("End date: " + endDate.toString()); + long diff = endDate.getTime() - startDate.getTime(); + log.debug("Time difference (in ms): " + diff); + log.debug("Time difference (in h): " + (diff/(1000*60*60))); + log.debug("Configured gap size (in %): " + GAP_SIZE); + log.debug("Calculated gap size (in ms): " + maxDiff); + log.debug("Calculated gap size (in h): " + (maxDiff/(1000*60*60))); + log.debug("*****************************************************"); + } + Date last = startDate; for (int i = startPos+1; i < endPos; i++) { Result res = results[i]; @@ -427,7 +442,7 @@ int endPos, int gapID ){ - long maxGap = (end.getTime() - start.getTime()) / 20; + long maxGap = (end.getTime() - start.getTime()) / 100 * GAP_SIZE; long interval = getTimeGapValue(start, end, startPos, endPos, gapID); if (maxGap < interval)