This commit is contained in:
serxa 2024-10-03 00:18:58 +00:00
parent 0d8ff26706
commit 4c02ddcf3b

View File

@ -31,21 +31,21 @@ TEST(SchedulerCustomResourceManager, Smoke)
</clickhouse> </clickhouse>
)CONFIG"); )CONFIG");
ClassifierPtr cA = t.manager->acquire("A"); ClassifierPtr c_a = t.manager->acquire("A");
ClassifierPtr cB = t.manager->acquire("B"); ClassifierPtr c_b = t.manager->acquire("B");
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
{ {
ResourceGuard gA(ResourceGuard::Metrics::getIOWrite(), cA->get("res1"), 1, ResourceGuard::Lock::Defer); ResourceGuard g_a(ResourceGuard::Metrics::getIOWrite(), c_a->get("res1"), 1, ResourceGuard::Lock::Defer);
gA.lock(); g_a.lock();
gA.consume(1); g_a.consume(1);
gA.unlock(); g_a.unlock();
ResourceGuard gB(ResourceGuard::Metrics::getIOWrite(), cB->get("res1")); ResourceGuard g_b(ResourceGuard::Metrics::getIOWrite(), c_b->get("res1"));
gB.unlock(); g_b.unlock();
ResourceGuard gC(ResourceGuard::Metrics::getIORead(), cB->get("res1")); ResourceGuard g_c(ResourceGuard::Metrics::getIORead(), c_b->get("res1"));
gB.consume(2); g_b.consume(2);
} }
} }