pnorman / bolder

A new open client-side style for OpenStreetMap data
Other
16 stars 2 forks source link

Scripts to examine tile size data #28

Open pnorman opened 5 years ago

pnorman commented 5 years ago

Scripts are needed to examine tile size data in the cache.

This should provide, per zoom,

pnorman commented 5 years ago

Average can be handled with du -ks --apparent-size cache/bolder/* and some math if you've generated all the tiles.

pnorman commented 5 years ago

Some thoughts

#!/bin/sh

# Exit immediately on error
set -e

FILE=scratch #$(mktemp /tmp/$(basename $0).XXXXX) || exit 1
#trap "rm -f $FILE" EXIT

find cache/bolder/4 -type f -print0 | du -b --apparent-size --files0-from=- | cut -f -1 | sort -n > $FILE

N=$(wc -l $FILE | awk '{print $1}')

P50=$(dc -e "$N 2 / p")
P90=$(dc -e "$N 9 * 10 / p")
P99=$(dc -e "$N 99 * 100 / p")
awk "FNR==$P50 || FNR==$P90 || FNR==$P99" $FILE
find cache/bolder/4 -type f -size +1M