Description of TSO - cmd and TSO - request is wrong in "Key Metrics on Performance Overview"
Error Report
Please answer the following questions before submitting your issue. Thanks!
- What is the URL/path of the document related to this issue?
https://docs.pingcap.com/tidb/stable/grafana-performance-overview-dashboard/#key-metrics-on-performance-overview
- How would you like to improve it?
TSO cmds are smaller units of operation. Multiple TSO commands can be batched into a single TSO request. Therefore, we should observe in the metrics that the number of TSO commands is greater than or equal to the number of TSO requests. However, the documentation describes this relationship incorrectly.
@JmPotato Could you please help take a look at this issue regarding the incorrect description of tso - cmd and tso - request metrics?
For reference, here are the related changes about tso - cmd and tso - request: https://github.com/pingcap/docs-cn/pull/18463 and https://github.com/pingcap/docs/pull/18722
After checking the relevant code, I found that the description here is indeed incorrect.
For TSO - cmd, each TSO request future is recorded as the smallest unit:
https://github.com/tikv/pd/blob/cf6b4752e7cbb4e9a6692ce9c04ccd986f20bf36/client/clients/tso/request.go#L77-L102
For TSO - request, it is recorded for each gRPC request, which serves as the unit for batched requests:
https://github.com/tikv/pd/blob/cf6b4752e7cbb4e9a6692ce9c04ccd986f20bf36/client/clients/tso/stream.go#L435
@JmPotato Could you please help submit a pull request to fix it?