Skip to content

CASS-20015: Add -H option in the nodetool compactionhistory#3628

Closed
chengw-netflix wants to merge 1 commit intoapache:trunkfrom
chengw-netflix:chengw/cass-20015
Closed

CASS-20015: Add -H option in the nodetool compactionhistory#3628
chengw-netflix wants to merge 1 commit intoapache:trunkfrom
chengw-netflix:chengw/cass-20015

Conversation

@chengw-netflix
Copy link
Contributor

Summary
This PR introduces a -H option to the nodetool compactionhistory command Cassandra. The -H option formats the output in a human-readable manner, making it easier for users to interpret the data.

More specifically, when the -H option is used, the bytes_in and bytes_out fields are displayed in a more readable format (e.g., KiB).

Testing

  1. Without -H option:
Compaction History:
id                                   keyspace_name columnfamily_name   compacted_at            bytes_in bytes_out rows_merged compaction_properties
2a5355b0-90f0-11ef-bf8c-79bcdbb5790b system_schema tables              2024-10-22T20:37:44.986 10526    3985      {2:4, 3:2}  {compaction_type:Compaction}
2a348310-90f0-11ef-bf8c-79bcdbb5790b system_schema keyspaces           2024-10-22T20:37:44.779 808      312       {2:4, 3:2}  {compaction_type:Compaction}
  1. With -H option:
Compaction History:
id                                   keyspace_name columnfamily_name   compacted_at            bytes_in  bytes_out rows_merged compaction_properties
2a5355b0-90f0-11ef-bf8c-79bcdbb5790b system_schema tables              2024-10-22T20:37:44.986 10.28 KiB 3.89 KiB  {2:4, 3:2}  {compaction_type:Compaction}
2a348310-90f0-11ef-bf8c-79bcdbb5790b system_schema keyspaces           2024-10-22T20:37:44.779 808 bytes 312 bytes {2:4, 3:2}  {compaction_type:Compaction}
  1. With -F json option:
{
  "CompactionHistory" : [ {
    "keyspace_name" : "system_schema",
    "bytes_out" : "3985",
    "bytes_in" : "10526",
    "compaction_properties" : "{compaction_type:Compaction}",
    "columnfamily_name" : "tables",
    "rows_merged" : "{2:4, 3:2}",
    "id" : "2a5355b0-90f0-11ef-bf8c-79bcdbb5790b",
    "compacted_at" : "2024-10-22T20:37:44.986"
}
  1. With -F json -H option:
{
  "CompactionHistory" : [ {
    "keyspace_name" : "system_schema",
    "bytes_out" : "3.89 KiB",
    "bytes_in" : "10.28 KiB",
    "compaction_properties" : "{compaction_type:Compaction}",
    "columnfamily_name" : "tables",
    "rows_merged" : "{2:4, 3:2}",
    "id" : "2a5355b0-90f0-11ef-bf8c-79bcdbb5790b",
    "compacted_at" : "2024-10-22T20:37:44.986"
  }, 

@chengw-netflix chengw-netflix marked this pull request as draft October 23, 2024 05:50
@chengw-netflix chengw-netflix marked this pull request as ready for review October 23, 2024 05:51
@chengw-netflix chengw-netflix marked this pull request as draft October 23, 2024 05:52
@chengw-netflix chengw-netflix marked this pull request as ready for review October 23, 2024 21:37
@chengw-netflix chengw-netflix force-pushed the chengw/cass-20015 branch 2 times, most recently from 8f4c656 to 31706c9 Compare October 24, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants