Skip to content

Instantly share code, notes, and snippets.

@apeyroux
Last active January 1, 2016 10:29
Show Gist options
  • Save apeyroux/8132283 to your computer and use it in GitHub Desktop.
Save apeyroux/8132283 to your computer and use it in GitHub Desktop.
Test perf cache #OSM
{--
Bessans :
min = tileFromLatLong 45.32 6.98 19
max = tileFromLatLong 45.31 7.01 19
--}
import HSlippyMap
import Network.Curl
lbbox = [[(49.13, 3.05),(48.57,1.66)]]
getTile url = do
resp <- (curlGetResponse_ (url) [] :: IO CurlResponse)
ttTime <- (respGetInfo resp TotalTime)
effUrl <- (respGetInfo resp EffectiveUrl)
sizeDwl <- (respGetInfo resp SizeDownload)
responseCode <- (respGetInfo resp ResponseCode)
contentType <- (respGetInfo resp ContentType)
speedDwl <- (respGetInfo resp SpeedDownload)
putStrLn $ show effUrl ++ " - [type:" ++ show contentType
++ "|rcode:" ++ show responseCode
++ "|tttime:" ++ show ttTime
++ "|size:" ++ show sizeDwl
++ "|speedDl:" ++ show speedDwl ++ "]"
main = do
mapM (\(x,y) -> mapM (\y'-> getTile $ "http://openstreetmap.asi.mi/" ++ show z ++ "/" ++ show x ++ "/" ++ show y' ++ ".png") y)
[(x,[(minimum [tymin, tymax])..(maximum [tymin,tymax])]) | x <- [(minimum [txmin, txmax])..(maximum [txmin, txmax])]]
where
min = tileFromLatLong 45.32 6.98 19
max = tileFromLatLong 45.31 7.01 19
txmin = tx min
txmax = tx max
tymax = ty min
tymin = ty max
z = tz min
@apeyroux
Copy link
Author

Result

Proxy GN : 15min
Cache GN : 49Sec
ADSL : 4min49sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment