Last active
January 1, 2016 10:29
-
-
Save apeyroux/8132283 to your computer and use it in GitHub Desktop.
Test perf cache #OSM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-- | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result
Proxy GN : 15min
Cache GN : 49Sec
ADSL : 4min49sec