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 (
|
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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue