Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestInfo ¶
type RequestInfo struct {
// contains filtered or unexported fields
}
RequestInfo contains information about a request that is able to calculate the RU cost before the request is sent. Specifically, the write bytes RU cost of a write request could be calculated by its key size to write.
func MakeRequestInfo ¶
func MakeRequestInfo(req *tikvrpc.Request) *RequestInfo
MakeRequestInfo extracts the relevant information from a BatchRequest.
func (*RequestInfo) IsWrite ¶
func (req *RequestInfo) IsWrite() bool
IsWrite returns whether the request is a write request.
func (*RequestInfo) WriteBytes ¶
func (req *RequestInfo) WriteBytes() uint64
WriteBytes returns the actual write size of the request, -1 will be returned if it's not a write request.
type ResponseInfo ¶
type ResponseInfo struct {
// contains filtered or unexported fields
}
ResponseInfo contains information about a response that is able to calculate the RU cost after the response is received. Specifically, the read bytes RU cost of a read request could be calculated by its response size, and the KV CPU time RU cost of a request could be calculated by its execution details info.
func MakeResponseInfo ¶
func MakeResponseInfo(resp *tikvrpc.Response) *ResponseInfo
MakeResponseInfo extracts the relevant information from a BatchResponse.
func (*ResponseInfo) KVCPUMs ¶
func (res *ResponseInfo) KVCPUMs() uint64
KVCPUMs returns the KV CPU time in milliseconds of the response.
func (*ResponseInfo) ReadBytes ¶
func (res *ResponseInfo) ReadBytes() uint64
ReadBytes returns the read bytes of the response.
func (*ResponseInfo) Succeed ¶ added in v2.0.6
func (res *ResponseInfo) Succeed() bool
Succeed returns whether the KV request is successful. Todo: to fit https://github.com/tikv/pd/pull/5941