How is the compression ratio in rocksdb - kv of grafana calculated?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: grafana 的 rocksdb - kv 中 compression ratio 是怎么计算的

| username: TiDBer_4dAknWOw

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
MySQL [(none)]> select version();
±-------------------+
| version() |
±-------------------+
| 5.7.25-TiDB-v6.1.4 |
±-------------------+
1 row in set (0.00 sec)
[Reproduction Path] What operations were performed to encounter the issue
[Encountered Issue: Problem Phenomenon and Impact]
I see the compression ratio is greater than 1. Is this calculated based on 3 replicas, with the compression ratio = size of data with 3 replicas / original data size?
[Resource Configuration]
[Attachments: Screenshots / Logs / Monitoring]

| username: h5n1 | Original post link

It is speculated that the ratio is based on the estimated number and size of keys compared to the actual file size.

| username: Lystorm | Original post link

This compression ratio is the ratio between the size of the input file and the size of the output file. The input and output file sizes here should both refer to the total data.