A diagnostics tarball created by DataStax Diagnostics Collection script or by DataStax OpsCenter contains cfstats file, which is created from nodetool tablestats
command, and contains all the table statistics.
This script parses cfstats file using excerpts from DataStax sperf
and convert statistics across the nodes to CSV format. This was tested using the Python 3.8.2
version.
- python 3
- Download
tablestats.py
&cfstats.py
scripts to your working directory - You should see the following directory structure in the downloaded diagnostics:
./- |- nodes |- 10.0.10.01 |- conf |- driver |- ... |- 10.0.10.02 |- conf |- ... |- 10.0.10.03 |- ...
- Run the following from the working directory where it has the diagnostics tarball and the scripts:
python3 tablestats.py /path/to/diagnostics/nodes/directory > your_filename.csv
- The generated
your_filename.csv
file will have duplicates and that can be removed by running the following:sort your_filename.csv | uniq > your_dups_removed_filename.csv
- From the generated CSV file, please find the the below row and move it to the header:
keyspace,table,sstable_size_...
- Save the file and you are done