Skip to content

Instantly share code, notes, and snippets.

@samsalisbury
Last active July 20, 2017 18:34
Show Gist options
  • Save samsalisbury/3cee9732e978d0e44974 to your computer and use it in GitHub Desktop.
Save samsalisbury/3cee9732e978d0e44974 to your computer and use it in GitHub Desktop.
Resize graphite whisperdb mesos_stats output
#!/bin/sh
# This script can be executed on a graphite node to resize output from https://github.com/samsalisbury/mesos_stats
DIR=/opt/graphite/storage/whisper/mesos_stats
RULE="1m:14d 5m:60d 10m:120d 1h:2y"
# First set the retention for all, leaving the existing default aggregation (which in our config was avg, xfilesfactor=0.5)
find $DIR -name *.wsp | while read f; do whisper-resize.py $f $RULE; done
# Now override the aggregations for the following special cases that need summing (using xfilesfactor=0.1 as is common for summing in our config)
find $DIR -name *_time_secs.wsp -or -name failed.wsp -or -name lost.wsp -or -name finished.wsp | while read f; do
whisper-resize.py --xFilesFactor=0.1 --aggregationMethod=sum $f $RULE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment