You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Jay Guo <gu...@cn.ibm.com> on 2016/04/11 04:27:54 UTC
Re: Review Request 45014: Add /containers endpoint.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/
-----------------------------------------------------------
(Updated April 11, 2016, 2:27 a.m.)
Review request for mesos and Jie Yu.
Summary (updated)
-----------------
Add /containers endpoint.
Repository: mesos
Description (updated)
-------
It returns both resource statistics and container status.
Diffs (updated)
-----
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
`curl agent_ip:port/containers` returns same json content as `curl agent_ip:port/monitor/statistics.json`
This is a draft patch of adding /containers endpoint to agent [MESOS-4891](https://issues.apache.org/jira/browse/MESOS-4891)
ContainerStatus will be added to response based on this patch.
Thanks,
Jay Guo
Re: Review Request 45014: Add /containers endpoint.
Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/#review128070
-----------------------------------------------------------
Patch looks great!
Reviews applied: [45014]
Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh
- Mesos ReviewBot
On April 11, 2016, 2:32 a.m., Jay Guo wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45014/
> -----------------------------------------------------------
>
> (Updated April 11, 2016, 2:32 a.m.)
>
>
> Review request for mesos and Jie Yu.
>
>
> 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
>
>
Re: Review Request 45014: Add /containers endpoint.
Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/#review128441
-----------------------------------------------------------
src/slave/http.cpp (line 669)
<https://reviews.apache.org/r/45014/#comment191861>
Why creating a helper in Slave? I don't think that's necessary. We have a helper 'usage' in Slave because other component (e.g., ResourceEstimator) wants to use that besides the http endpoint.
src/slave/slave.cpp (lines 5221 - 5222)
<https://reviews.apache.org/r/45014/#comment191862>
We don't use typedef typically in our code base for explicitness. Please use explicit type instead.
src/slave/slave.cpp (line 5250)
<https://reviews.apache.org/r/45014/#comment191863>
Please add a CHECK to make sure the sizes of the lists are the same
src/slave/slave.cpp (lines 5251 - 5253)
<https://reviews.apache.org/r/45014/#comment191864>
Please use 'auto'.
- Jie Yu
On April 12, 2016, 9:11 a.m., Jay Guo wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45014/
> -----------------------------------------------------------
>
> (Updated April 12, 2016, 9:11 a.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
> -----
>
> 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
>
>
Re: Review Request 45014: Add /containers endpoint.
Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/#review130005
-----------------------------------------------------------
Ship it!
src/slave/http.cpp (line 680)
<https://reviews.apache.org/r/45014/#comment193607>
Instead of copying the entire list, i used an Owned pointer here to avoid some copying. I fixed it for you.
- Jie Yu
On April 18, 2016, 3:38 a.m., Jay Guo wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45014/
> -----------------------------------------------------------
>
> (Updated April 18, 2016, 3:38 a.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
> -----
>
> src/slave/http.cpp 3f96f2c201597706dfc814c0a20bb983cd56905a
> src/slave/slave.hpp f78c1b4e4d5378ef7223c6eb3ea45491c30fb4c1
> src/slave/slave.cpp de99e9eb5cc812b2e07deb749b98b4f4db363728
> src/tests/containerizer.hpp efc1ca87c00b04d70efd1e3f6acf4e763132d6b0
> src/tests/containerizer.cpp 4c7f5a26d38222daf013bd3ca9a133e12d7bf338
> src/tests/slave_tests.cpp ee58488b0b927c7c5833add4718941539663e6d2
>
> Diff: https://reviews.apache.org/r/45014/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jay Guo
>
>
Re: Review Request 45014: Add /containers endpoint.
Posted by Jay Guo <gu...@cn.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/
-----------------------------------------------------------
(Updated April 18, 2016, 3:38 a.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 (updated)
-----
src/slave/http.cpp 3f96f2c201597706dfc814c0a20bb983cd56905a
src/slave/slave.hpp f78c1b4e4d5378ef7223c6eb3ea45491c30fb4c1
src/slave/slave.cpp de99e9eb5cc812b2e07deb749b98b4f4db363728
src/tests/containerizer.hpp efc1ca87c00b04d70efd1e3f6acf4e763132d6b0
src/tests/containerizer.cpp 4c7f5a26d38222daf013bd3ca9a133e12d7bf338
src/tests/slave_tests.cpp ee58488b0b927c7c5833add4718941539663e6d2
Diff: https://reviews.apache.org/r/45014/diff/
Testing
-------
make check
Thanks,
Jay Guo
Re: Review Request 45014: Add /containers endpoint.
Posted by Jie Yu <yu...@gmail.com>.
> On April 15, 2016, 12:33 a.m., Jie Yu wrote:
> > ping?
>
> Jay Guo wrote:
> bump
sorry, was sick these days. WIll commit it today.
- Jie
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/#review129045
-----------------------------------------------------------
On April 18, 2016, 3:38 a.m., Jay Guo wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45014/
> -----------------------------------------------------------
>
> (Updated April 18, 2016, 3:38 a.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
> -----
>
> src/slave/http.cpp 3f96f2c201597706dfc814c0a20bb983cd56905a
> src/slave/slave.hpp f78c1b4e4d5378ef7223c6eb3ea45491c30fb4c1
> src/slave/slave.cpp de99e9eb5cc812b2e07deb749b98b4f4db363728
> src/tests/containerizer.hpp efc1ca87c00b04d70efd1e3f6acf4e763132d6b0
> src/tests/containerizer.cpp 4c7f5a26d38222daf013bd3ca9a133e12d7bf338
> src/tests/slave_tests.cpp ee58488b0b927c7c5833add4718941539663e6d2
>
> Diff: https://reviews.apache.org/r/45014/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jay Guo
>
>
Re: Review Request 45014: Add /containers endpoint.
Posted by Jay Guo <gu...@cn.ibm.com>.
> On April 15, 2016, 12:33 a.m., Jie Yu wrote:
> > ping?
bump
- Jay
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/#review129045
-----------------------------------------------------------
On April 18, 2016, 3:38 a.m., Jay Guo wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45014/
> -----------------------------------------------------------
>
> (Updated April 18, 2016, 3:38 a.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
> -----
>
> src/slave/http.cpp 3f96f2c201597706dfc814c0a20bb983cd56905a
> src/slave/slave.hpp f78c1b4e4d5378ef7223c6eb3ea45491c30fb4c1
> src/slave/slave.cpp de99e9eb5cc812b2e07deb749b98b4f4db363728
> src/tests/containerizer.hpp efc1ca87c00b04d70efd1e3f6acf4e763132d6b0
> src/tests/containerizer.cpp 4c7f5a26d38222daf013bd3ca9a133e12d7bf338
> src/tests/slave_tests.cpp ee58488b0b927c7c5833add4718941539663e6d2
>
> Diff: https://reviews.apache.org/r/45014/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jay Guo
>
>
Re: Review Request 45014: Add /containers endpoint.
Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/#review129045
-----------------------------------------------------------
ping?
- Jie Yu
On April 12, 2016, 9:11 a.m., Jay Guo wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45014/
> -----------------------------------------------------------
>
> (Updated April 12, 2016, 9:11 a.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
> -----
>
> 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
>
>
Re: Review Request 45014: Add /containers endpoint.
Posted by Jay Guo <gu...@cn.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/
-----------------------------------------------------------
(Updated April 12, 2016, 9:11 a.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 (updated)
-----
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
Re: Review Request 45014: Add /containers endpoint.
Posted by Jay Guo <gu...@cn.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/
-----------------------------------------------------------
(Updated April 12, 2016, 8 a.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 (updated)
-----
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
Re: Review Request 45014: Add /containers endpoint.
Posted by Jay Guo <gu...@cn.ibm.com>.
> On April 11, 2016, 8:31 p.m., Jie Yu wrote:
> > src/slave/http.cpp, line 678
> > <https://reviews.apache.org/r/45014/diff/2/?file=1338543#file1338543line678>
> >
> > Why 'statisticsLimiter'? Let's not introduce the limiter for the `/containers` endpoint yet.
I thought it's intended to limit workload on containerizer, no? I deleted it in the update.
> On April 11, 2016, 8:31 p.m., Jie Yu wrote:
> > src/slave/http.cpp, line 679
> > <https://reviews.apache.org/r/45014/diff/2/?file=1338543#file1338543line679>
> >
> > 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'.
> > })));
> > }
> > ```
You are right, I didn't notice that await() api can handle different type of futures. thx
- Jay
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/#review128232
-----------------------------------------------------------
On April 12, 2016, 8 a.m., Jay Guo wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45014/
> -----------------------------------------------------------
>
> (Updated April 12, 2016, 8 a.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
> -----
>
> 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
>
>
Re: Review Request 45014: Add /containers endpoint.
Posted by Jay Guo <gu...@cn.ibm.com>.
> On April 11, 2016, 8:31 p.m., Jie Yu wrote:
> > docs/endpoints/index.md, lines 106-109
> > <https://reviews.apache.org/r/45014/diff/2/?file=1338539#file1338539line106>
> >
> > Can you make the doc change a separate patch? Are you generating those endpoint docs using the script under support/?
Yes it's generated using generate-endpoint-help.py. I created another patch to update docs: https://reviews.apache.org/r/46075/
> On April 11, 2016, 8:31 p.m., Jie Yu wrote:
> > src/slave/http.cpp, lines 640-646
> > <https://reviews.apache.org/r/45014/diff/2/?file=1338543#file1338543line640>
> >
> > I would just mention the NetworkInfo under 'container_status' because it's more widely used. I won't mention net_cls in this example.
OK
- Jay
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/#review128232
-----------------------------------------------------------
On April 12, 2016, 8 a.m., Jay Guo wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45014/
> -----------------------------------------------------------
>
> (Updated April 12, 2016, 8 a.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
> -----
>
> 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
>
>
Re: Review Request 45014: Add /containers endpoint.
Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
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
>
>
Re: Review Request 45014: Add /containers endpoint.
Posted by Jay Guo <gu...@cn.ibm.com>.
-----------------------------------------------------------
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
Re: Review Request 45014: Add /containers endpoint.
Posted by Jay Guo <gu...@cn.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45014/
-----------------------------------------------------------
(Updated April 11, 2016, 2:32 a.m.)
Review request for mesos and Jie Yu.
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 (updated)
-------
make check
Thanks,
Jay Guo