mirror of https://github.com/tikv/client-go.git
Fix the check
Signed-off-by: JmPotato <ghzpotato@gmail.com>
This commit is contained in:
parent
320af6501e
commit
08694efec4
|
|
@ -57,7 +57,7 @@ func (r interceptedClient) SendRequest(ctx context.Context, addr string, req *ti
|
|||
}
|
||||
|
||||
var (
|
||||
resourceControlSwitch atomic.Bool
|
||||
resourceControlSwitch atomic.Value
|
||||
resourceControlInterceptor client.ResourceGroupKVInterceptor
|
||||
)
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ func buildResourceControlInterceptor(
|
|||
req *tikvrpc.Request,
|
||||
resourceGroupName string,
|
||||
) interceptor.RPCInterceptor {
|
||||
if !resourceControlSwitch.Load() {
|
||||
if !resourceControlSwitch.Load().(bool) {
|
||||
return nil
|
||||
}
|
||||
// When the group name is empty or "default", we don't need to
|
||||
|
|
|
|||
|
|
@ -126,10 +126,12 @@ func getKVCPUMs(detailsV2 *kvrpcpb.ExecDetailsV2, details *kvrpcpb.ExecDetails)
|
|||
return 0
|
||||
}
|
||||
|
||||
// ReadBytes returns the read bytes of the response.
|
||||
func (res *ResponseInfo) ReadBytes() uint64 {
|
||||
return res.readBytes
|
||||
}
|
||||
|
||||
// KVCPUMs returns the KV CPU time in milliseconds of the response.
|
||||
func (res *ResponseInfo) KVCPUMs() uint64 {
|
||||
return res.kvCPUMs
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue