You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Ross Allen <ro...@mesosphe.re> on 2013/07/23 04:15:09 UTC

Review Request 12832: Iterate over all offers only once

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/12832/
-----------------------------------------------------------

Review request for mesos.


Repository: mesos-git


Description
-------

Iterate over all offers only once

Offers are first appended to "$scope.offers" while iterating over each
framework, and then "$scope.offers" is iterated to calculate stats. The
stats can instead be calculated at the same time the offers are
appended to "$scope.offers" to save an iteration.


Diffs
-----

  src/webui/master/static/js/controllers.js dae12b61001ff0c7379169242e5d125ef6ca141b 

Diff: https://reviews.apache.org/r/12832/diff/


Testing
-------


Thanks,

Ross Allen


Re: Review Request 12832: Iterate over all offers only once

Posted by Ross Allen <ro...@mesosphe.re>.

> On July 25, 2013, 9:13 p.m., Ben Mahler wrote:
> > Thanks!
> > 
> > I'm noticing angular.forEach and I'm not sure I find it as clean as _.each (see my comment on https://reviews.apache.org/r/12830/).

angular.forEach is equivalent to _.each but with a bit longer name. They both actually delegate to the native Array.forEach[1] in browsers that implement it: IE9+, and all modern browsers.

I like `forEach` because that's what core JS calls it.

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach


- Ross


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/12832/#review23870
-----------------------------------------------------------


On July 23, 2013, 2:15 a.m., Ross Allen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12832/
> -----------------------------------------------------------
> 
> (Updated July 23, 2013, 2:15 a.m.)
> 
> 
> Review request for mesos.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Iterate over all offers only once
> 
> Offers are first appended to "$scope.offers" while iterating over each
> framework, and then "$scope.offers" is iterated to calculate stats. The
> stats can instead be calculated at the same time the offers are
> appended to "$scope.offers" to save an iteration.
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/js/controllers.js dae12b61001ff0c7379169242e5d125ef6ca141b 
> 
> Diff: https://reviews.apache.org/r/12832/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Ross Allen
> 
>


Re: Review Request 12832: Iterate over all offers only once

Posted by Ross Allen <ro...@mesosphe.re>.

> On July 25, 2013, 9:13 p.m., Ben Mahler wrote:
> > Thanks!
> > 
> > I'm noticing angular.forEach and I'm not sure I find it as clean as _.each (see my comment on https://reviews.apache.org/r/12830/).
> 
> Ross Allen wrote:
>     angular.forEach is equivalent to _.each but with a bit longer name. They both actually delegate to the native Array.forEach[1] in browsers that implement it: IE9+, and all modern browsers.
>     
>     I like `forEach` because that's what core JS calls it.
>     
>     [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach

After the discussion over https://reviews.apache.org/r/12830/, I replaced the `angular.forEach` calls with `_.each` again until Underscore is replaced with native calls.


- Ross


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/12832/#review23870
-----------------------------------------------------------


On July 23, 2013, 2:15 a.m., Ross Allen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12832/
> -----------------------------------------------------------
> 
> (Updated July 23, 2013, 2:15 a.m.)
> 
> 
> Review request for mesos.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Iterate over all offers only once
> 
> Offers are first appended to "$scope.offers" while iterating over each
> framework, and then "$scope.offers" is iterated to calculate stats. The
> stats can instead be calculated at the same time the offers are
> appended to "$scope.offers" to save an iteration.
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/js/controllers.js dae12b61001ff0c7379169242e5d125ef6ca141b 
> 
> Diff: https://reviews.apache.org/r/12832/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Ross Allen
> 
>


Re: Review Request 12832: Iterate over all offers only once

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/12832/#review23870
-----------------------------------------------------------

Ship it!


Thanks!

I'm noticing angular.forEach and I'm not sure I find it as clean as _.each (see my comment on https://reviews.apache.org/r/12830/).

- Ben Mahler


On July 23, 2013, 2:15 a.m., Ross Allen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12832/
> -----------------------------------------------------------
> 
> (Updated July 23, 2013, 2:15 a.m.)
> 
> 
> Review request for mesos.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Iterate over all offers only once
> 
> Offers are first appended to "$scope.offers" while iterating over each
> framework, and then "$scope.offers" is iterated to calculate stats. The
> stats can instead be calculated at the same time the offers are
> appended to "$scope.offers" to save an iteration.
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/js/controllers.js dae12b61001ff0c7379169242e5d125ef6ca141b 
> 
> Diff: https://reviews.apache.org/r/12832/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Ross Allen
> 
>