You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2018/07/18 12:57:46 UTC

[4/4] mesos git commit: Added balloon framework metric for tasks which were running.

Added balloon framework metric for tasks which were running.

The framework currently exposes metric counters for various expected
and unexpected task termination reasons. Interpreting these counters
can be non-trivial since tasks might fail due to benign, but unknown
external reasons.

This patch adds a counter for the tasks which actually made it to the
running stage which can be correlated with the different terminal task
counts.

Review: https://reviews.apache.org/r/67928


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/63aca0de
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/63aca0de
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/63aca0de

Branch: refs/heads/1.4.x
Commit: 63aca0dee323b49762c716fb1ab2e18fbee5cdcc
Parents: 163dd77
Author: Benjamin Bannier <bb...@apache.org>
Authored: Mon Jul 16 16:39:21 2018 +0200
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Wed Jul 18 14:17:22 2018 +0200

----------------------------------------------------------------------
 src/examples/balloon_framework.cpp | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/63aca0de/src/examples/balloon_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/balloon_framework.cpp b/src/examples/balloon_framework.cpp
index c1fe723..b30249d 100644
--- a/src/examples/balloon_framework.cpp
+++ b/src/examples/balloon_framework.cpp
@@ -285,7 +285,6 @@ public:
         taskActive = false;
         if (status.reason() == TaskStatus::REASON_CONTAINER_LIMITATION_MEMORY) {
           ++metrics.tasks_oomed;
-          break;
         }
 
         // NOTE: Fetching the executor (e.g. `--executor_uri`) may fail
@@ -293,8 +292,8 @@ public:
         // enough that it makes sense to track this failure metric separately.
         if (status.reason() == TaskStatus::REASON_CONTAINER_LAUNCH_FAILED) {
           ++metrics.launch_failures;
-          break;
         }
+        break;
       case TASK_KILLED:
       case TASK_LOST:
       case TASK_ERROR:
@@ -302,7 +301,20 @@ public:
 
         ++metrics.abnormal_terminations;
         break;
-      default:
+      case TASK_RUNNING:
+        ++metrics.tasks_running;
+        break;
+      // We ignore uninteresting transient task status updates.
+      case TASK_KILLING:
+      case TASK_STAGING:
+      case TASK_STARTING:
+        break;
+      // We ignore task status updates related to reconciliation.
+      case TASK_DROPPED:
+      case TASK_GONE:
+      case TASK_GONE_BY_OPERATOR:
+      case TASK_UNKNOWN:
+      case TASK_UNREACHABLE:
         break;
     }
   }
@@ -338,6 +350,7 @@ private:
             defer(_scheduler, &BalloonSchedulerProcess::_registered)),
         tasks_finished(string(FRAMEWORK_METRICS_PREFIX) + "/tasks_finished"),
         tasks_oomed(string(FRAMEWORK_METRICS_PREFIX) + "/tasks_oomed"),
+        tasks_running(string(FRAMEWORK_METRICS_PREFIX) + "/tasks_running"),
         launch_failures(string(FRAMEWORK_METRICS_PREFIX) + "/launch_failures"),
         abnormal_terminations(
             string(FRAMEWORK_METRICS_PREFIX) + "/abnormal_terminations")
@@ -346,6 +359,7 @@ private:
       process::metrics::add(registered);
       process::metrics::add(tasks_finished);
       process::metrics::add(tasks_oomed);
+      process::metrics::add(tasks_running);
       process::metrics::add(launch_failures);
       process::metrics::add(abnormal_terminations);
     }
@@ -365,6 +379,7 @@ private:
 
     process::metrics::Counter tasks_finished;
     process::metrics::Counter tasks_oomed;
+    process::metrics::Counter tasks_running;
     process::metrics::Counter launch_failures;
     process::metrics::Counter abnormal_terminations;
   } metrics;