【发布时间】:2019-06-22 06:56:50
【问题描述】:
我想对 nodetool tablestats 元数据列出的所有表求和“已用空间(总计):0”。谁能知道如何做到这一点?请帮忙。
所需代码:为所有表格添加 已用空间(总计) 值;如下:
for Table: dbtimestamp
size += value(Space used (total))
Table: dbtimestamp_compressed
size += value((Space used (total))
Table: migration_status
size += value((Space used (total))
----------------------------------------------------------------------------
nodetool tablestats metadata
Total number of tables: 584
----------------
Keyspace : metadata
Read Count: 296
Read Latency: 0.23686486486486488 ms
Write Count: 68611
Write Latency: 0.02151582107825276 ms
Pending Flushes: 0
Table: dbtimestamp
SSTable count: 0
Space used (live): 0
Space used (total): 0
Space used by snapshots (total): 0
Off heap memory used (total): 0
Table: dbtimestamp_compressed
SSTable count: 0
Space used (live): 0
Space used (total): 0
Space used by snapshots (total): 0
Off heap memory used (total): 0
Table: migration_status
SSTable count: 2
Space used (live): 13014
Space used (total): 13014
Space used by snapshots (total): 0
Off heap memory used (total): 80
Table: reporttimestamp_by_type
SSTable count: 2
Space used (live): 121332
Space used (total): 121332
Space used by snapshots (total): 0
Off heap memory used (total): 112
【问题讨论】:
-
还请务必提及您为解决问题所做的努力以及预期的示例输出。
-
通过查看您的个人资料就知道您从不选择正确的答案,给它一些时间,当您在帖子上看到足够的答案时,尝试选择其中任何一个作为正确的答案。您也可以针对较早的问题执行此操作。
-
@RavinderSingh13 :在我的大多数问题中,我自己都得到了答案,并且通过 Answer your question 标签更新了相同的问题。我会尝试在我所有的问题中做同样的事情。谢谢
标签: regex bash awk cassandra-3.0 nodetool