changeset 642:83f8f98a4f11

Log important values used for gap detection if debug level is enabled. gnv-artifacts/trunk@728 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 03 Mar 2010 16:26:19 +0000
parents 8d2bd52f05e3
children 24a85678bd39
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java
diffstat 2 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 <ingo.weinzierl@intevation.de>
+
+	* 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 <ingo.weinzierl@intevation.de>
 
 	  Issue146
--- 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)

http://dive4elements.wald.intevation.org