Skip to content

Instantly share code, notes, and snippets.

@Krinkle
Last active March 21, 2018 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Krinkle/677d04fad6f9b36d3a8bb0dee1b90dc5 to your computer and use it in GitHub Desktop.
Save Krinkle/677d04fad6f9b36d3a8bb0dee1b90dc5 to your computer and use it in GitHub Desktop.
#!/bin/bash -eu
for f in $(find . -iname '*.wsp'); do
if [ -a "$f" ]; then
name="$(basename $f)";
# Vary xFilesFactor
# Based on https://github.com/wikimedia/operations-puppet/blob/production/modules/role/manifests/graphite/base.pp
case "$name" in
count.wsp|sum.wsp) x='0' ;;
*) x='0.01' ;;
esac
# Storage schema is assumed as zzdefault.
# Don't apply this script to 'daily' or 'hourly' metrics
echo "Resizing $f ..."
sudo -u _graphite whisper-resize "--xFilesFactor=$x" "$f" 1m:7d 5m:14d 15m:30d 1h:1y 1d:5y
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment