add some fix for speed_limit

This commit is contained in:
cr0
2021-12-24 10:54:59 +08:00
committed by LINxiansheng
parent 870a799aaa
commit 888a02778c
8 changed files with 76 additions and 13 deletions

View File

@ -420,6 +420,16 @@ int64_t ObMallocAllocator::get_tenant_hold(uint64_t tenant_id)
return hold;
}
int64_t ObMallocAllocator::get_tenant_remain(uint64_t tenant_id)
{
int64_t remain = 0;
with_resource_handle_invoke(tenant_id, [&remain](ObTenantMemoryMgr *mgr) {
remain = mgr->get_limit() - mgr->get_sum_hold() + mgr->get_cache_hold();
return OB_SUCCESS;
});
return remain;
}
int64_t ObMallocAllocator::get_tenant_rpc_hold(uint64_t tenant_id)
{
int64_t rpc_hold = 0;