Mercurial > gemma
comparison 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 |
comparison
equal
deleted
inserted
replaced
4638:2e19ed576c68 | 4639:4380f5483c03 |
---|---|
296 | 296 |
297 heights = common.DedupFloat64s(heights) | 297 heights = common.DedupFloat64s(heights) |
298 | 298 |
299 areas := tree.TraceAreas(heights, isoCellSize) | 299 areas := tree.TraceAreas(heights, isoCellSize) |
300 | 300 |
301 var size int | |
302 | |
301 for i, a := range areas { | 303 for i, a := range areas { |
302 if len(a) == 0 { | 304 if len(a) == 0 { |
303 continue | 305 continue |
304 } | 306 } |
307 wkb := a.AsWKB() | |
308 size += len(wkb) | |
305 if _, err = isoStmt.ExecContext( | 309 if _, err = isoStmt.ExecContext( |
306 ctx, | 310 ctx, |
307 id, heights[i], minuendTree.EPSG, | 311 id, heights[i], minuendTree.EPSG, |
308 a.AsWKB(), | 312 wkb, |
309 contourTolerance, | 313 contourTolerance, |
310 ); err != nil { | 314 ); err != nil { |
311 return | 315 return |
312 } | 316 } |
313 } | 317 } |
314 | 318 |
319 log.Printf("info: Transferred WKB size: %.2fMB.\n", | |
320 float64(size)/(1024*1024)) | |
321 | |
315 log.Printf("info: calculating and storing iso lines took %v\n", | 322 log.Printf("info: calculating and storing iso lines took %v\n", |
316 time.Since(start)) | 323 time.Since(start)) |
317 | 324 |
318 if err != nil { | 325 if err != nil { |
319 return | 326 return |