> On June 9, 2015, 11:33 a.m., Vinod Kone wrote:
> > src/master/http.cpp, lines 226-227
> > <https://reviews.apache.org/r/35239/diff/1/?file=981171#file981171line226>
> >
> >     why not just
> >     
> >     object.values["resources"] = model(slave.totalResources);
> >     
> >     because total resources represent the current state of the slave's 
> > resources.
> >     
> >     also, this is more consistent with "used_resources" and 
> > "offered_resources" which will now have revocable resources in them.

I was aiming for consistency between the metrics and state.json. In metrics, 
existing metrics `(cpus|mem|disk)_total` stay unchanged and only included data 
from `slave.info.resources()`.

But in replying to Ben's comment below I began to think it's probably better to 
just do this so I'll just do `object.values["resources"] = 
model(slave.totalResources);`.


- Jiang Yan


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


On June 8, 2015, 5:38 p.m., Jiang Yan Xu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35239/
> -----------------------------------------------------------
> 
> (Updated June 8, 2015, 5:38 p.m.)
> 
> 
> Review request for mesos and Vinod Kone.
> 
> 
> Bugs: MESOS-2776
>     https://issues.apache.org/jira/browse/MESOS-2776
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   src/common/http.cpp 2ac7fba7a3aac913540f1b09768777393b79284a 
>   src/master/http.cpp f8ac30934352db859e73819e0656a70047bb0dc5 
>   src/tests/common/http_tests.cpp f087b2313a13c3199b70b3d7feb728e1449a52e7 
> 
> Diff: https://reviews.apache.org/r/35239/diff/
> 
> 
> Testing
> -------
> 
> Added a test.
> 
> Also tested with a master/slave pair.
> 
> e.g., The following state.json output shows a slave using a fixed estimator 
> with `cpus:1;mem:512` revocable resources.
> ```json
>   "slaves": [
>     {
> ...
>       "resources": {
>         "cpus": 24,
>         "disk": 454767,
>         "mem": 71322,
>         "ports": "[31000-32000]"
>       },
>       "total_resources": {
>         "cpus": 24,
>         "cpus{REV}": 1,
>         "disk": 454767,
>         "mem": 71322,
>         "mem{REV}": 512,
>         "ports": "[31000-32000]"
>       },
>       "used_resources": {
>         "cpus": 0,
>         "disk": 0,
>         "mem": 0
>       }
>     }
>   ],
> ```
> 
> Note that `resources` only looks at the resources from SlaveInfo while 
> `total_resources` reads Master::Slave::totalResources.
> 
> 
> Thanks,
> 
> Jiang Yan Xu
> 
>

Reply via email to