Fix the check

Signed-off-by: JmPotato <ghzpotato@gmail.com>
This commit is contained in:
JmPotato 2023-01-19 16:21:27 +08:00
parent 320af6501e
commit 08694efec4
2 changed files with 4 additions and 2 deletions

View File

@ -57,7 +57,7 @@ func (r interceptedClient) SendRequest(ctx context.Context, addr string, req *ti
} }
var ( var (
resourceControlSwitch atomic.Bool resourceControlSwitch atomic.Value
resourceControlInterceptor client.ResourceGroupKVInterceptor resourceControlInterceptor client.ResourceGroupKVInterceptor
) )
@ -88,7 +88,7 @@ func buildResourceControlInterceptor(
req *tikvrpc.Request, req *tikvrpc.Request,
resourceGroupName string, resourceGroupName string,
) interceptor.RPCInterceptor { ) interceptor.RPCInterceptor {
if !resourceControlSwitch.Load() { if !resourceControlSwitch.Load().(bool) {
return nil return nil
} }
// When the group name is empty or "default", we don't need to // When the group name is empty or "default", we don't need to

View File

@ -126,10 +126,12 @@ func getKVCPUMs(detailsV2 *kvrpcpb.ExecDetailsV2, details *kvrpcpb.ExecDetails)
return 0 return 0
} }
// ReadBytes returns the read bytes of the response.
func (res *ResponseInfo) ReadBytes() uint64 { func (res *ResponseInfo) ReadBytes() uint64 {
return res.readBytes return res.readBytes
} }
// KVCPUMs returns the KV CPU time in milliseconds of the response.
func (res *ResponseInfo) KVCPUMs() uint64 { func (res *ResponseInfo) KVCPUMs() uint64 {
return res.kvCPUMs return res.kvCPUMs
} }