Skip to content

Latest commit

 

History

History
39 lines (35 loc) · 1.81 KB

Create_a_CSV_file_from_cfstats_diagnostics.md

File metadata and controls

39 lines (35 loc) · 1.81 KB

Create a CSV file from cfstats diagnostics

About

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.

Prerequisite

  1. python 3
  2. Download tablestats.py & cfstats.py scripts to your working directory
  3. 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
         |- ...
    

Usage

  1. 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
    
  2. 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
    
  3. From the generated CSV file, please find the the below row and move it to the header:
    keyspace,table,sstable_size_...
    
  4. Save the file and you are done