> On 八月 2, 2016, 12:12 a.m., Benjamin Mahler wrote: > > src/tests/hierarchical_allocator_tests.cpp, lines 3461-3466 > > <https://reviews.apache.org/r/50677/diff/1/?file=1459446#file1459446line3461> > > > > Can we re-use the Allocation struct from above? > > > > > > https://github.com/apache/mesos/blob/9c6097f063405279efc07eec22457c2059653f07/src/tests/hierarchical_allocator_tests.cpp#L79-L83
Hi Ben, after some thought, seems here using `OfferedResources` maybe better, as here we are actually constructing the `offers` on each agent; But the `Allocation` is an allocator concept and it means the resources for a specified framework. Also using `OfferedResources` can make the API call `recoverResources` more simple as we can get the `slaveId` and `resources` on the agent directly from the `OfferedResources`; If using `Allocation`, then we will need to traverse the hashmap to get the `slaveId` and `resources` before `recoverResources`. The `benchmark` test is focusing on `offers`, so here we are using `OfferedResources` in `benchmark` test; For other unit test cases other than `benchmark` test, they are focusing on `allocations` for each framework, so it is using `Allocation`. What do you think? - Guangya ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/50677/#review144412 ----------------------------------------------------------- On 八月 1, 2016, 10:59 p.m., Guangya Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/50677/ > ----------------------------------------------------------- > > (Updated 八月 1, 2016, 10:59 p.m.) > > > Review request for mesos, Benjamin Mahler and Jiang Yan Xu. > > > Repository: mesos > > > Description > ------- > > This is a follow up action for https://reviews.apache.org/r/49616/ , > renaming `fferedResources` to `Allocation` would match the pattern > used in the HierarchicalAllocatorTestBase. > > > Diffs > ----- > > src/tests/hierarchical_allocator_tests.cpp > e5576023e4aab930f0e2b1d82d8baa6569d852eb > > Diff: https://reviews.apache.org/r/50677/diff/ > > > Testing > ------- > > make > make check > > ``` > [ RUN ] > SlaveAndFrameworkCount/HierarchicalAllocator_BENCHMARK_Test.ResourceLabels/1 > Using 1000 agents and 50 frameworks > Added 50 frameworks in 5231us > Added 1000 agents in 3.295297secs > round 0 allocate() took 2.323202secs to make 1000 offers after filtering 1000 > offers > round 1 allocate() took 2.326269secs to make 1000 offers after filtering 2000 > offers > round 2 allocate() took 2.393019secs to make 1000 offers after filtering 3000 > offers > round 3 allocate() took 2.33054secs to make 1000 offers after filtering 4000 > offers > round 4 allocate() took 2.388765secs to make 1000 offers after filtering 5000 > offers > round 5 allocate() took 2.364473secs to make 1000 offers after filtering 6000 > offers > round 6 allocate() took 2.631534secs to make 1000 offers after filtering 7000 > offers > round 7 allocate() took 2.692875secs to make 1000 offers after filtering 8000 > offers > round 8 allocate() took 2.653584secs to make 1000 offers after filtering 9000 > offers > ``` > > ``` > [ RUN ] > SlaveAndFrameworkCount/HierarchicalAllocator_BENCHMARK_Test.DeclineOffers/1 > Using 1000 agents and 50 frameworks > Added 50 frameworks in 6797us > Added 1000 agents in 2.628263secs > round 0 allocate() took 2.207578secs to make 1000 offers after filtering > 1000 offers > round 1 allocate() took 2.230511secs to make 1000 offers after filtering > 2000 offers > round 2 allocate() took 2.238138secs to make 1000 offers after filtering > 3000 offers > round 3 allocate() took 2.229707secs to make 1000 offers after filtering > 4000 offers > round 4 allocate() took 2.239294secs to make 1000 offers after filtering > 5000 offers > round 5 allocate() took 2.310338secs to make 1000 offers after filtering > 6000 offers > round 6 allocate() took 2.30661secs to make 1000 offers after filtering 7000 > offers > round 7 allocate() took 2.377254secs to make 1000 offers after filtering > 8000 offers > round 8 allocate() took 2.399587secs to make 1000 offers after filtering > 9000 offers > round 9 allocate() took 2.540271secs to make 1000 offers after filtering > 10000 offers > ``` > > > Thanks, > > Guangya Liu > >