resourcecontrol

package
v2.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL