changeset 4639:4380f5483c03

Log the size of the transferred WKB to database for differences, too.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 11 Oct 2019 20:00:06 +0200
parents 2e19ed576c68
children fb09a43b062e
files pkg/controllers/diff.go pkg/imports/sr.go
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/diff.go	Fri Oct 11 16:14:30 2019 +0200
+++ b/pkg/controllers/diff.go	Fri Oct 11 20:00:06 2019 +0200
@@ -298,20 +298,27 @@
 
 	areas := tree.TraceAreas(heights, isoCellSize)
 
+	var size int
+
 	for i, a := range areas {
 		if len(a) == 0 {
 			continue
 		}
+		wkb := a.AsWKB()
+		size += len(wkb)
 		if _, err = isoStmt.ExecContext(
 			ctx,
 			id, heights[i], minuendTree.EPSG,
-			a.AsWKB(),
+			wkb,
 			contourTolerance,
 		); err != nil {
 			return
 		}
 	}
 
+	log.Printf("info: Transferred WKB size: %.2fMB.\n",
+		float64(size)/(1024*1024))
+
 	log.Printf("info: calculating and storing iso lines took %v\n",
 		time.Since(start))
 
--- a/pkg/imports/sr.go	Fri Oct 11 16:14:30 2019 +0200
+++ b/pkg/imports/sr.go	Fri Oct 11 20:00:06 2019 +0200
@@ -928,7 +928,7 @@
 		}
 	}
 
-	feedback.Info("Transfered WKB size: %.2fMB.",
+	feedback.Info("Transferred WKB size: %.2fMB.",
 		float64(size)/(1024*1024))
 
 	return nil