Project: mesos
Issue MESOS-1695: The stats.json endpoint on the slave exposes "registered" as a string.
The slave is currently exposing a string value for the "registered" statistic, this should be a number: {code} slave:5051/stats.json { "recovery_errors": 0, "registered": "1", "slave/executors_registering": 0, ... } {code} Should be a pretty straightforward fix, looks like this first originated back in 2013: {code} commit b8291304e1523eb67ea8dc5f195cdb0d8e7d8348 Author: Vinod Kone Date: Wed Jul 3 12:37:36 2013 -0700 Added a "registered" key/value pair to slave's stats.json. Review: https://reviews.apache.org/r/12256 diff --git a/src/slave/http.cpp b/src/slave/http.cpp index dc2955f..dd51516 100644 --- a/src/slave/http.cpp +++ b/src/slave/http.cpp @@ -281,6 +281,8 @@ Future Slave::Http::stats(const Request& request) object.values["lost_tasks"] = slave.stats.tasks[TASK_LOST]; object.values["valid_status_updates"] = slave.stats.validStatusUpdates; object.values["invalid_status_updates"] = slave.stats.invalidStatusUpdates; + object.values["registered"] = slave.master ? "1" : "0"; + return OK(object, request.query.get("jsonp")); } {code}
Story points: 1