Cassandra – tablestats

How to produce a digest of tables using nodetool

$ nodetool tablestats | awk ‘ /Keyspace/ || /Latency/ {print $0} /Table:/ {gsub(/^[ ][ ]/,””);table=”–> “$0} /Space used/ && $NF > 0 {gsub(/^[ ][ ]/,””);space=space “|” $0} /used by snapshots/ {printf(“%-30s\t%-30s\n”,table,space);table=””;space=””} ‘

Keyspace : system_traces
Read Latency: NaN ms
Write Latency: NaN ms
–> Table: events
–> Table: sessions
Keyspace : system
Read Latency: 4.279434782608696 ms
Write Latency: 0.3454382659499075 ms
–> Table: IndexInfo
–> Table: available_ranges
–> Table: batches
–> Table: batchlog
–> Table: built_views
–> Table: compaction_history |Space used (live): 13424|Space used (total): 13424
–> Table: hints
–> Table: local |Space used (live): 15977|Space used (total): 15977
–> Table: paxos
–> Table: peer_events
–> Table: peers |Space used (live): 14912|Space used (total): 14912
–> Table: prepared_statements
–> Table: range_xfers
–> Table: size_estimates |Space used (live): 94270|Space used (total): 94270
–> Table: sstable_activity |Space used (live): 11098|Space used (total): 11098
–> Table: transferred_ranges
–> Table: views_builds_in_progress
Keyspace : system_distributed
Read Latency: NaN ms
Write Latency: NaN ms
–> Table: parent_repair_history
–> Table: repair_history
–> Table: view_build_status
Keyspace : system_schema
Read Latency: 1.7939485294117647 ms
Write Latency: 2.188590909090909 ms
–> Table: aggregates
–> Table: columns |Space used (live): 18096|Space used (total): 18096
–> Table: dropped_columns
–> Table: functions
–> Table: indexes
–> Table: keyspaces |Space used (live): 10828|Space used (total): 10828
–> Table: tables |Space used (live): 16857|Space used (total): 16857
–> Table: triggers
–> Table: types
–> Table: views
Keyspace : system_auth
Read Latency: 0.241 ms
Write Latency: 0.123 ms
–> Table: resource_role_permissons_index
–> Table: role_members
–> Table: role_permissions
–> Table: roles |Space used (live): 5134|Space used (total): 5134

Previous Post

Next Post

Leave a Reply

Your email address will not be published. Required fields are marked *