----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45014/#review128232 -----------------------------------------------------------
docs/endpoints/index.md <https://reviews.apache.org/r/45014/#comment191621> Can you make the doc change a separate patch? Are you generating those endpoint docs using the script under support/? src/slave/http.cpp (lines 640 - 646) <https://reviews.apache.org/r/45014/#comment191624> I would just mention the NetworkInfo under 'container_status' because it's more widely used. I won't mention net_cls in this example. src/slave/http.cpp (line 678) <https://reviews.apache.org/r/45014/#comment191625> Why 'statisticsLimiter'? Let's not introduce the limiter for the `/containers` endpoint yet. src/slave/http.cpp (line 679) <https://reviews.apache.org/r/45014/#comment191631> I don't think we should be calling 'Slave::usage' here. You can just look through 'slave->frameworks' and calling `containerizer->usage` and `containerizer->status` directly. Something like the following: ``` Future<Response> Slave::Http::containers(const Request& request) const { Owned<list<JSON::Object>> results(new list<JSON::Object>()); list<Future<ResourceStatistics>> stats; list<Future<ContainerStatus>> statuses; foreachvalue (const Framework* framework, slave->frameworks) { foreachvalue (const Executor* executor, framework->executors) { const ContainerID& containerId = executor->containerId; JSON::Object object; object.values["framework_id"] = ...; object.values["executor_id"] = ...; object.values["container_id"] = ...; ... results->push_back(object); stats.push_back(slave->containerizer->usage(containerId)); statuses.push_back(slave->containerizer->status(containerId)); } } return await(await(stats), await(statues)) .then([results](const tuple< Future<list<Future<ResourceStatistics>>>, Future<list<Future<ContainerStatus>>>>& t) { // Finish filling 'results'. }))); } ``` - Jie Yu On April 11, 2016, 4:28 p.m., Jay Guo wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45014/ > ----------------------------------------------------------- > > (Updated April 11, 2016, 4:28 p.m.) > > > Review request for mesos and Jie Yu. > > > Bugs: MESOS-4891 > https://issues.apache.org/jira/browse/MESOS-4891 > > > Repository: mesos > > > Description > ------- > > It returns both resource statistics and container status. > > > Diffs > ----- > > docs/endpoints/index.md 4fc5583e27dda6df6dfc9f3cee72925a07cdd2b3 > docs/endpoints/monitor/statistics.json.md > 1830493d9b936279abcfc03fc5023b7e8b54888b > docs/endpoints/monitor/statistics.md > 38dede06ac0a7cc9798a50ffd540b124eb5c1c84 > docs/endpoints/slave/containers.md PRE-CREATION > src/slave/http.cpp a684ff504535e2b9b2064f8048f5e03a0efcb059 > src/slave/slave.hpp 76f3aff394e5cecc54dcb3065cb872e238bc228e > src/slave/slave.cpp f090c853b8affc4be5eecb4f616ec881fc2b60c3 > src/tests/containerizer.hpp efc1ca87c00b04d70efd1e3f6acf4e763132d6b0 > src/tests/containerizer.cpp 4c7f5a26d38222daf013bd3ca9a133e12d7bf338 > src/tests/slave_tests.cpp 4a576b98d1cc58072626ac2c41c599bd3c8385c5 > > Diff: https://reviews.apache.org/r/45014/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Jay Guo > >
