You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gr...@apache.org on 2018/08/01 20:24:28 UTC

[11/16] mesos git commit: Enabled per-framework metrics in the allocator.

Enabled per-framework metrics in the allocator.

The `FrameworkMetrics` struct will hold per-framework metrics tracked
by the allocator.

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


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

Branch: refs/heads/master
Commit: dba94e3ae4657aaecc5d6b2c1e6cce227f33ce9f
Parents: d309258
Author: Greg Mann <gr...@mesosphere.io>
Authored: Wed Aug 1 07:58:45 2018 -0700
Committer: Greg Mann <gr...@gmail.com>
Committed: Wed Aug 1 13:07:55 2018 -0700

----------------------------------------------------------------------
 src/master/allocator/mesos/hierarchical.cpp |  3 ++-
 src/master/allocator/mesos/hierarchical.hpp |  2 ++
 src/master/allocator/mesos/metrics.cpp      |  7 +++++++
 src/master/allocator/mesos/metrics.hpp      | 10 ++++++++++
 4 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/dba94e3a/src/master/allocator/mesos/hierarchical.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index 3599247..83a6bcd 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -139,7 +139,8 @@ HierarchicalAllocatorProcess::Framework::Framework(
   : roles(protobuf::framework::getRoles(frameworkInfo)),
     suppressedRoles(_suppressedRoles),
     capabilities(frameworkInfo.capabilities()),
-    active(_active) {}
+    active(_active),
+    metrics(new FrameworkMetrics(frameworkInfo)) {}
 
 
 void HierarchicalAllocatorProcess::initialize(

http://git-wip-us.apache.org/repos/asf/mesos/blob/dba94e3a/src/master/allocator/mesos/hierarchical.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.hpp b/src/master/allocator/mesos/hierarchical.hpp
index 0cd2fac..691df9e 100644
--- a/src/master/allocator/mesos/hierarchical.hpp
+++ b/src/master/allocator/mesos/hierarchical.hpp
@@ -335,6 +335,8 @@ protected:
     hashmap<SlaveID, hashset<InverseOfferFilter*>> inverseOfferFilters;
 
     bool active;
+
+    process::Owned<FrameworkMetrics> metrics;
   };
 
   double _event_queue_dispatches()

http://git-wip-us.apache.org/repos/asf/mesos/blob/dba94e3a/src/master/allocator/mesos/metrics.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/metrics.cpp b/src/master/allocator/mesos/metrics.cpp
index 82990b2..84499c8 100644
--- a/src/master/allocator/mesos/metrics.cpp
+++ b/src/master/allocator/mesos/metrics.cpp
@@ -207,6 +207,13 @@ void Metrics::removeRole(const string& role)
   process::metrics::remove(gauge.get());
 }
 
+
+FrameworkMetrics::FrameworkMetrics(const FrameworkInfo& _frameworkInfo)
+  : frameworkInfo(_frameworkInfo) {}
+
+
+FrameworkMetrics::~FrameworkMetrics() {}
+
 } // namespace internal {
 } // namespace allocator {
 } // namespace master {

http://git-wip-us.apache.org/repos/asf/mesos/blob/dba94e3a/src/master/allocator/mesos/metrics.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/metrics.hpp b/src/master/allocator/mesos/metrics.hpp
index 6d38622..daac93f 100644
--- a/src/master/allocator/mesos/metrics.hpp
+++ b/src/master/allocator/mesos/metrics.hpp
@@ -90,6 +90,16 @@ struct Metrics
   hashmap<std::string, process::metrics::PullGauge> offer_filters_active;
 };
 
+
+struct FrameworkMetrics
+{
+  explicit FrameworkMetrics(const FrameworkInfo& _frameworkInfo);
+
+  ~FrameworkMetrics();
+
+  const FrameworkInfo frameworkInfo;
+};
+
 } // namespace internal {
 } // namespace allocator {
 } // namespace master {