mysql的行的数据和体积等指标,我们可以通过定时任务脚本去采集information_schema.tables然后存到库里面。
最终效果如下:
看板对于的sql如下:
select
rds_name as "RDS实例",
table_schema as "库名",
table_name as "表名",
table_rows as "当前行数",
total_size as "当前表总体积",
max(table_rows) - min(table_rows) as "近7日增加行数"
from rds_table_stats
WHERE
date(collect_date) IN ( DATE_ADD(curdate(), interval -7 day), date_format(curdate(),'%Y-%m-%d'))
group by rds_name, table_schema ,table_name
order by max(table_rows) - min(table_rows) desc LIMIT 20
;