Return-Path: X-Original-To: apmail-mesos-dev-archive@www.apache.org Delivered-To: apmail-mesos-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 065C8172DE for ; Wed, 28 Jan 2015 18:17:15 +0000 (UTC) Received: (qmail 79518 invoked by uid 500); 28 Jan 2015 18:17:15 -0000 Delivered-To: apmail-mesos-dev-archive@mesos.apache.org Received: (qmail 79452 invoked by uid 500); 28 Jan 2015 18:17:15 -0000 Mailing-List: contact dev-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mesos.apache.org Delivered-To: mailing list dev@mesos.apache.org Received: (qmail 79408 invoked by uid 99); 28 Jan 2015 18:17:07 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jan 2015 18:17:07 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id B52C71D6FC1; Wed, 28 Jan 2015 18:17:02 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6798977029356096385==" MIME-Version: 1.0 Subject: Re: Review Request 30074: Added "max allowed age" to Slave stats.json endpoint From: "Niklas Nielsen" To: "Niklas Nielsen" , "Till Toenshoff" Cc: "Alexander Rojas" , "mesos" Date: Wed, 28 Jan 2015 18:17:02 -0000 Message-ID: <20150128181702.25679.90849@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Niklas Nielsen" X-ReviewGroup: mesos X-ReviewRequest-URL: https://reviews.apache.org/r/30074/ X-Sender: "Niklas Nielsen" References: <20150121135500.9401.92511@reviews.apache.org> In-Reply-To: <20150121135500.9401.92511@reviews.apache.org> Reply-To: "Niklas Nielsen" X-ReviewRequest-Repository: mesos-git --===============6798977029356096385== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/30074/#review70029 ----------------------------------------------------------- Thanks for submitting this Alexander! I have a few questions/suggestions below :) src/slave/http.cpp Why stats and not state.json? src/slave/http.cpp We should think about how to get the fact in, that it integer is a number of seconds. How about something like: max_allowed_directory_age_seconds = 42 or max_allowed_directory_seconds = 42 ? src/slave/slave.hpp We can make this a bit more precise. It is not just any files, but the executor directories/sandboxes. How about having something like: // Maximum age of executor directories. Will be recomputed periodically every flags.disk_watch_interval. src/slave/slave.cpp You don't have to initialize Option types with None. They will automatically be that :) src/slave/slave.cpp You don't need to use some() here. You can just set the value: maxAllowedAge = age(usage.get()); src/tests/slave_tests.cpp Instead of setting this low (which would still cause a 1s+ test). How about forwarding the clock with flags.disk_watch_interval? That should trigger the timeout immediately - Niklas Nielsen On Jan. 21, 2015, 5:55 a.m., Alexander Rojas wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/30074/ > ----------------------------------------------------------- > > (Updated Jan. 21, 2015, 5:55 a.m.) > > > Review request for mesos, Niklas Nielsen and Till Toenshoff. > > > Bugs: mesos-2229 > https://issues.apache.org/jira/browse/mesos-2229 > > > Repository: mesos-git > > > Description > ------- > > Adds and entry `max_allowed_age` to the response of the stats.json endpoint in the slave. The format of the value is `{double}(days|mins|secs)`. > > The max allowed age value is available only if it is set, which depends on the flag `--disk_watch_interval` which by default runs every minute (So it will only be available after the first minute running). > > Modifies the unit test `SlaveTest.MetricsInStatsEndpoint` so it takes into account the new entry. > > > Diffs > ----- > > src/slave/http.cpp d1cf8a6 > src/slave/slave.hpp 70bd8c1 > src/slave/slave.cpp fca83b3 > src/tests/slave_tests.cpp a85a028 > > Diff: https://reviews.apache.org/r/30074/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Alexander Rojas > > --===============6798977029356096385==--