Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 如何统计日志生成量(包括raft log和binlog)
How can I calculate the amount of logs generated by the database over a certain period of time if I can’t find the corresponding system view? This includes raft logs and binlogs.
Why are you collecting these statistics?
I remember there is a method, but it needs to be tested. In Prometheus, you can query the metric of raft log generation in TiDB using the following PromQL statement: sum(increase(tikv_raft_log_gc_process_seconds_count[1d]))
.
sum(increase(binlog_written_bytes[1d]))
For example, the raft log needs to be transmitted to other nodes, and the amount of logs directly determines the required network bandwidth. I want to conduct a survey to check.
The official documentation provides basic recommended parameters for network bandwidth. Isn’t it more straightforward to refer to that?
Yes, I also want to compare the transaction log write volume of several databases. 
WAL? That probably can’t be obtained… 
You can only get it through POC scenario stress testing and using Prometheus to help you obtain it.
Why can’t I find the metrics tikv_raft_log_gc_process_seconds_count and binlog_written_bytes? 