----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/35239/#review87252 -----------------------------------------------------------
src/master/http.cpp <https://reviews.apache.org/r/35239/#comment139566> 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. - Vinod Kone On June 9, 2015, 12:38 a.m., Jiang Yan Xu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/35239/ > ----------------------------------------------------------- > > (Updated June 9, 2015, 12:38 a.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 > >
