Created
January 30, 2017 14:05
-
-
Save endeepak/3a09d80c58bd732f815f2b25f2adafd7 to your computer and use it in GitHub Desktop.
Influxdb : Print cardinality / series count per measurement
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
#!/usr/bin/env bash | |
if [ "$#" -ne 1 ] | |
then | |
echo "Usage: $0 <db_name>" | |
exit 1 | |
fi | |
db_name=$1 | |
meaurement_names=$(influx -database $db_name -execute 'SHOW MEASUREMENTS' | tail -n +4) | |
for meaurement_name in $meaurement_names; do | |
number_of_series=$(influx -database $db_name -execute "SHOW SERIES FROM \"$meaurement_name\"" | tail -n +3 | wc -l) | |
echo "$meaurement_name $number_of_series" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment