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 22:54:38 UTC

Review Request 12880: Compute framework stats in one iteration

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

Review request for mesos.


Repository: mesos-git


Description
-------

Compute framework stats in one iteration

Rather than iterate over 'frameworks' and 'completed_frameworks' once
to update the slave mappings and a second time to calculate stats for
the frameworks, move that work into a single loop.

This also removes a 'concat' call that was creating a temporary Array
used to calculate stats once and then thrown away.


Diffs
-----

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

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


Testing
-------

Rendered /slaves/:id to verify framework stats were still calculated properly.


Thanks,

Ross Allen


Re: Review Request 12880: Compute framework stats in one iteration

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

> On July 25, 2013, 9:23 p.m., Ben Mahler wrote:
> > src/webui/master/static/js/controllers.js, lines 456-468
> > <https://reviews.apache.org/r/12880/diff/1/?file=326135#file326135line456>
> >
> >     Can you move this down to where it's used?

I defined them outside the scope of `var update = function() { ... }` because they don't need access to the `update` function's scope.

This could actually move outside the Controller's scope as well since it doesn't need access to anything in that scope either.


- Ross


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


On July 23, 2013, 8:54 p.m., Ross Allen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12880/
> -----------------------------------------------------------
> 
> (Updated July 23, 2013, 8:54 p.m.)
> 
> 
> Review request for mesos.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Compute framework stats in one iteration
> 
> Rather than iterate over 'frameworks' and 'completed_frameworks' once
> to update the slave mappings and a second time to calculate stats for
> the frameworks, move that work into a single loop.
> 
> This also removes a 'concat' call that was creating a temporary Array
> used to calculate stats once and then thrown away.
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/js/controllers.js dae12b61001ff0c7379169242e5d125ef6ca141b 
> 
> Diff: https://reviews.apache.org/r/12880/diff/
> 
> 
> Testing
> -------
> 
> Rendered /slaves/:id to verify framework stats were still calculated properly.
> 
> 
> Thanks,
> 
> Ross Allen
> 
>


Re: Review Request 12880: Compute framework stats in one iteration

Posted by Ben Mahler <be...@gmail.com>.

> On July 25, 2013, 9:23 p.m., Ben Mahler wrote:
> > src/webui/master/static/js/controllers.js, lines 456-468
> > <https://reviews.apache.org/r/12880/diff/1/?file=326135#file326135line456>
> >
> >     Can you move this down to where it's used?
> 
> Ross Allen wrote:
>     I defined them outside the scope of `var update = function() { ... }` because they don't need access to the `update` function's scope.
>     
>     This could actually move outside the Controller's scope as well since it doesn't need access to anything in that scope either.

Ditto from my previous comment, since they're only being used in one scope. Let's keep it local unless it proves useful for other parts of the code.


- Ben


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


On July 23, 2013, 8:54 p.m., Ross Allen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12880/
> -----------------------------------------------------------
> 
> (Updated July 23, 2013, 8:54 p.m.)
> 
> 
> Review request for mesos.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Compute framework stats in one iteration
> 
> Rather than iterate over 'frameworks' and 'completed_frameworks' once
> to update the slave mappings and a second time to calculate stats for
> the frameworks, move that work into a single loop.
> 
> This also removes a 'concat' call that was creating a temporary Array
> used to calculate stats once and then thrown away.
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/js/controllers.js dae12b61001ff0c7379169242e5d125ef6ca141b 
> 
> Diff: https://reviews.apache.org/r/12880/diff/
> 
> 
> Testing
> -------
> 
> Rendered /slaves/:id to verify framework stats were still calculated properly.
> 
> 
> Thanks,
> 
> Ross Allen
> 
>


Re: Review Request 12880: Compute framework stats in one iteration

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



src/webui/master/static/js/controllers.js
<https://reviews.apache.org/r/12880/#comment47694>

    Can you move this down to where it's used?


- Ben Mahler


On July 23, 2013, 8:54 p.m., Ross Allen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12880/
> -----------------------------------------------------------
> 
> (Updated July 23, 2013, 8:54 p.m.)
> 
> 
> Review request for mesos.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Compute framework stats in one iteration
> 
> Rather than iterate over 'frameworks' and 'completed_frameworks' once
> to update the slave mappings and a second time to calculate stats for
> the frameworks, move that work into a single loop.
> 
> This also removes a 'concat' call that was creating a temporary Array
> used to calculate stats once and then thrown away.
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/js/controllers.js dae12b61001ff0c7379169242e5d125ef6ca141b 
> 
> Diff: https://reviews.apache.org/r/12880/diff/
> 
> 
> Testing
> -------
> 
> Rendered /slaves/:id to verify framework stats were still calculated properly.
> 
> 
> Thanks,
> 
> Ross Allen
> 
>


Re: Review Request 12880: Compute framework stats in one iteration

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

Ship it!


Ship It!

- Ben Mahler


On July 26, 2013, 6:23 p.m., Ross Allen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12880/
> -----------------------------------------------------------
> 
> (Updated July 26, 2013, 6:23 p.m.)
> 
> 
> Review request for mesos.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Compute framework stats in one iteration
> 
> Rather than iterate over 'frameworks' and 'completed_frameworks' once
> to update the slave mappings and a second time to calculate stats for
> the frameworks, move that work into a single loop.
> 
> This also removes a 'concat' call that was creating a temporary Array
> used to calculate stats once and then thrown away.
> 
> Review: http://reviews.apache.org/r/12880
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/js/controllers.js a757f131b37053eb0dc81d2f057b233cef5ecc57 
> 
> Diff: https://reviews.apache.org/r/12880/diff/
> 
> 
> Testing
> -------
> 
> Rendered /slaves/:id to verify framework stats were still calculated properly.
> 
> 
> Thanks,
> 
> Ross Allen
> 
>


Re: Review Request 12880: Compute framework stats in one iteration

Posted by Ross Allen <ro...@mesosphe.re>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/12880/
-----------------------------------------------------------

(Updated July 26, 2013, 6:23 p.m.)


Review request for mesos.


Changes
-------

Moved `computeFrameworkStats` next to where it is called.


Repository: mesos-git


Description (updated)
-------

Compute framework stats in one iteration

Rather than iterate over 'frameworks' and 'completed_frameworks' once
to update the slave mappings and a second time to calculate stats for
the frameworks, move that work into a single loop.

This also removes a 'concat' call that was creating a temporary Array
used to calculate stats once and then thrown away.

Review: http://reviews.apache.org/r/12880


Diffs (updated)
-----

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

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


Testing
-------

Rendered /slaves/:id to verify framework stats were still calculated properly.


Thanks,

Ross Allen