----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/49616/#review143492 -----------------------------------------------------------
src/tests/hierarchical_allocator_tests.cpp (lines 3792 - 3816) <https://reviews.apache.org/r/49616/#comment209304> I prefer that we calcluate the elapse time of `addSlave` and `addFramework` separately. What about update the code as this: ``` Stopwatch watch; watch.start(); for (size_t i = 0; i < frameworkCount; i++) { frameworks.push_back(createFrameworkInfo("*")); allocator->addFramework(frameworks[i].id(), frameworks[i], {}); } // Wait for all the `addFramework` operations to be processed. Clock::settle(); watch.stop(); cout << "Added " << frameworkCount << " frameworks" << " in " << watch.elapsed() << endl; // Each agent has a portion of it's resources allocated to a single // framework. We round-robin through the frameworks when allocating. vector<SlaveInfo> agents; agents.reserve(agentCount); const string agentTotal = "cpus:24;mem:4096;disk:4096;ports:[31000-32000]"; Resources allocation = Resources::parse("cpus:16;mem:1024;disk:1024").get(); Try<::mesos::Value::Ranges> ranges = fragment(createRange(31000, 32000), 16); ASSERT_SOME(ranges); ASSERT_EQ(16, ranges->range_size()); allocation += createPorts(ranges.get()); for (size_t i = 0; i < agentCount; i++) { agents.push_back(createSlaveInfo(agentTotal)); hashmap<FrameworkID, Resources> used; used[frameworks[i % frameworkCount].id()] = allocation; allocator->addSlave( agents[i].id(), agents[i], None(), agents[i].resources(), used); } // Wait for all the `addSlave` operations to be processed. Clock::settle(); watch.stop(); cout << "Added " << slaveCount << " agents" << " in " << watch.elapsed() << endl; ``` src/tests/hierarchical_allocator_tests.cpp (line 3800) <https://reviews.apache.org/r/49616/#comment209303> A comment here: // Wait for all the `addFramework` operations to be processed. src/tests/hierarchical_allocator_tests.cpp (line 3809) <https://reviews.apache.org/r/49616/#comment209305> It is better adding some check here. ``` Try<::mesos::Value::Ranges> ranges = fragment(createRange(31000, 32000), 16); ASSERT_SOME(ranges); ASSERT_EQ(16, ranges->range_size()); allocation += createPorts(ranges.get()); ``` - Guangya Liu On 七月 26, 2016, 7:03 a.m., Jacob Janco wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/49616/ > ----------------------------------------------------------- > > (Updated 七月 26, 2016, 7:03 a.m.) > > > Review request for mesos, James Peach, Joris Van Remoortere, and Jiang Yan Xu. > > > Bugs: MESOS-5781 > https://issues.apache.org/jira/browse/MESOS-5781 > > > Repository: mesos > > > Description > ------- > > - Useful for high framework clusters which carry > many suppressed frameworks that are considered > during allocation. > > > Diffs > ----- > > src/tests/hierarchical_allocator_tests.cpp > bb6947fcecb5b78047e98d10fc1278c612a69548 > > Diff: https://reviews.apache.org/r/49616/diff/ > > > Testing > ------- > > MESOS_BENCHMARK=1 GTEST_FILTER="*BENCHMARK_Test.SuppressOffers*" make check > > > Thanks, > > Jacob Janco > >