developmentseed / titiler-xarray

[DEMO] TiTiler extension for xarray
MIT License
28 stars 9 forks source link

Add server timing middleware #24

Closed abarciauskas-bgse closed 1 year ago

abarciauskas-bgse commented 1 year ago

Adds timing middle ware and 2 timings for xarray.open_dataset and rioxarray.RasterArray.reproject. More may be added in the future, especially if it's apparent significant time is spent outside of the 2.

vincentsarago commented 1 year ago

🥳 thanks @abarciauskas-bgse I think it makes sense to add this middleware 👍

I'll take over this PR and do:

vincentsarago commented 1 year ago

@abarciauskas-bgse in the last commit I did:

to enable ServerTimingMiddleware you will need to have yappi installed and then set TITILER_XARRAY_DEBUG to "TRUE"

abarciauskas-bgse commented 1 year ago

Thanks @vincentsarago all of those improvements make sense to me. Just one question is what is the issue with the middleware that you had to fix? I assume this is the reason to bring the code directly into this repo.

vincentsarago commented 1 year ago

@abarciauskas-bgse there was a todo that I did and one weird issue with a lambda function (not sure if there was really an issue, but ruff wasn't happy), I also added more typing info.