You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/07/06 02:48:13 UTC
mesos git commit: Skipped terminated executors in statistics
endpoints.
Repository: mesos
Updated Branches:
refs/heads/master 57b52a0ee -> fcc94d202
Skipped terminated executors in statistics endpoints.
For /containers and /monitor/statistics endpoints. This is possible
because the agent won't remove the executor from its list until it
receives the ack for the last status update. For those executors, we
know that they have terminated, therefore we should skip them.
Review: https://reviews.apache.org/r/49672
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fcc94d20
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fcc94d20
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fcc94d20
Branch: refs/heads/master
Commit: fcc94d202290f5103ec43ff9fb595b431d88d318
Parents: 57b52a0
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Jul 5 17:11:27 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Jul 5 19:48:05 2016 -0700
----------------------------------------------------------------------
src/slave/http.cpp | 6 ++++++
src/slave/slave.cpp | 6 ++++++
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/fcc94d20/src/slave/http.cpp
----------------------------------------------------------------------
diff --git a/src/slave/http.cpp b/src/slave/http.cpp
index 67ed67e..ef2d510 100644
--- a/src/slave/http.cpp
+++ b/src/slave/http.cpp
@@ -1241,6 +1241,12 @@ Future<JSON::Array> Slave::Http::__containers() const
foreachvalue (const Framework* framework, slave->frameworks) {
foreachvalue (const Executor* executor, framework->executors) {
+ // No need to get statistics and status if we know that the
+ // executor has already terminated.
+ if (executor->state == Executor::TERMINATED) {
+ continue;
+ }
+
const ExecutorInfo& info = executor->info;
const ContainerID& containerId = executor->containerId;
http://git-wip-us.apache.org/repos/asf/mesos/blob/fcc94d20/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 066c0ee..36f63bc 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -5222,6 +5222,12 @@ Future<ResourceUsage> Slave::usage()
foreachvalue (const Framework* framework, frameworks) {
foreachvalue (const Executor* executor, framework->executors) {
+ // No need to get statistics and status if we know that the
+ // executor has already terminated.
+ if (executor->state == Executor::TERMINATED) {
+ continue;
+ }
+
ResourceUsage::Executor* entry = usage->add_executors();
entry->mutable_executor_info()->CopyFrom(executor->info);
entry->mutable_allocated()->CopyFrom(executor->resources);