diff pkg/controllers/diff.go @ 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 0ed1489af8b6
children fb09a43b062e
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))