Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace level logging for reads #55

Open
jisantuc opened this issue Dec 3, 2018 · 4 comments
Open

Trace level logging for reads #55

jisantuc opened this issue Dec 3, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@jisantuc
Copy link
Contributor

jisantuc commented Dec 3, 2018

With read errors, it's difficult to tell what's actually going on in any client application using geotrellis-contrib.

With trace level logging of:

  • uri
  • warp options
  • extent

that would be easier

@pomadchin pomadchin added the enhancement New feature or request label Dec 4, 2018
@metasim
Copy link
Contributor

metasim commented Apr 3, 2019

+1

@metasim
Copy link
Contributor

metasim commented Apr 3, 2019

Ideally would be great to know all the scenarios where GDAL is making IO calls.

@metasim
Copy link
Contributor

metasim commented Apr 3, 2019

@echeipesh
Copy link
Collaborator

Added this gem when debugging new OGC services:

lazy val tileBounds = sourceLayer.metadata.mapTransform.extentToBounds(sourceExtent)
lazy val pixelsRead = (tileBounds.size * sourceLayer.metadata.layout.tileCols * sourceLayer.metadata.layout.tileRows).toDouble
lazy val pixelsQueried = (targetRasterExtent.cols.toDouble * targetRasterExtent.rows.toDouble)
def msg = s"""${GREEN}ead($extent)${RESET} =
|\t${BOLD}FROM${RESET} $uri ${sourceLayer.id}
|\t${BOLD}TARGET${RESET} ${targetRasterExtent.extent} ${targetRasterExtent.cellSize} @ ${crs}
|\t${BOLD}SOURCE${RESET} $sourceExtent ${sourceLayer.metadata.cellSize} @ ${sourceLayer.metadata.crs}
|\t${BOLD}READ${RESET} ${pixelsRead/pixelsQueried} read/query ratio for ${tileBounds.size} tiles""".stripMargin
if (tileBounds.size < 1024) // Assuming 256x256 tiles this would be a very large request
logger.debug(msg)
else
logger.warn(msg + " (large read)")

it has been invaluable and ANSI colors are Purdy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants