bolder icon indicating copy to clipboard operation
bolder copied to clipboard

Scripts to examine tile size data

Open pnorman opened this issue 7 years ago • 2 comments

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

This should provide, per zoom,

  • average tile size
  • median tile size
  • some percentiles, or a histogram

pnorman avatar Feb 25 '19 18:02 pnorman

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

pnorman avatar Feb 25 '19 18:02 pnorman

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

pnorman avatar Feb 26 '19 01:02 pnorman