You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2016/04/07 05:49:06 UTC
mesos git commit: Update metrics for SUBSCRIBE call for both PID/HTTP
frameworks.
Repository: mesos
Updated Branches:
refs/heads/master b1dbc63f3 -> a79261564
Update metrics for SUBSCRIBE call for both PID/HTTP frameworks.
This change will cover three cases:
1. Directly call {re}registerFramework
2. Through HTTP call
3. Through MesosSchedulerDriver
Suggested by Benjamin Mahler to introspect framework_info.id.
Review: https://reviews.apache.org/r/45808/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a7926156
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a7926156
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a7926156
Branch: refs/heads/master
Commit: a7926156470969c46ea2ad900a5a64198a3dcfb9
Parents: b1dbc63
Author: fan du <fa...@intel.com>
Authored: Wed Apr 6 20:48:46 2016 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Wed Apr 6 20:48:46 2016 -0700
----------------------------------------------------------------------
src/master/master.cpp | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/a7926156/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 36ebaf7..781402c 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -2033,8 +2033,6 @@ void Master::registerFramework(
const UPID& from,
const FrameworkInfo& frameworkInfo)
{
- ++metrics->messages_register_framework;
-
if (frameworkInfo.has_id() && !frameworkInfo.id().value().empty()) {
const string error = "Registering with 'id' already set";
@@ -2060,8 +2058,6 @@ void Master::reregisterFramework(
const FrameworkInfo& frameworkInfo,
bool failover)
{
- ++metrics->messages_reregister_framework;
-
if (!frameworkInfo.has_id() || frameworkInfo.id().value().empty()) {
const string error = "Re-registering without an 'id'";
@@ -2091,6 +2087,13 @@ void Master::subscribe(
const FrameworkInfo& frameworkInfo = subscribe.framework_info();
+ // Update messages_{re}register_framework accordingly.
+ if (!frameworkInfo.has_id() || frameworkInfo.id() == "") {
+ ++metrics->messages_register_framework;
+ } else {
+ ++metrics->messages_reregister_framework;
+ }
+
LOG(INFO) << "Received subscription request for"
<< " HTTP framework '" << frameworkInfo.name() << "'";
@@ -2285,6 +2288,13 @@ void Master::subscribe(
{
const FrameworkInfo& frameworkInfo = subscribe.framework_info();
+ // Update messages_{re}register_framework accordingly.
+ if (!frameworkInfo.has_id() || frameworkInfo.id() == "") {
+ ++metrics->messages_register_framework;
+ } else {
+ ++metrics->messages_reregister_framework;
+ }
+
if (authenticating.contains(from)) {
// TODO(vinod): Consider dropping this request and fix the tests
// to deal with the drop. Currently there is a race between master