Return-Path: X-Original-To: apmail-incubator-mesos-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-mesos-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 367DBE541 for ; Wed, 6 Mar 2013 02:38:48 +0000 (UTC) Received: (qmail 81855 invoked by uid 500); 6 Mar 2013 02:38:48 -0000 Delivered-To: apmail-incubator-mesos-commits-archive@incubator.apache.org Received: (qmail 81832 invoked by uid 500); 6 Mar 2013 02:38:48 -0000 Mailing-List: contact mesos-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mesos-dev@incubator.apache.org Delivered-To: mailing list mesos-commits@incubator.apache.org Received: (qmail 81825 invoked by uid 99); 6 Mar 2013 02:38:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Mar 2013 02:38:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Mar 2013 02:38:46 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 343592388BEF; Wed, 6 Mar 2013 02:38:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1453146 - /incubator/mesos/trunk/third_party/libprocess/src/statistics.cpp Date: Wed, 06 Mar 2013 02:38:23 -0000 To: mesos-commits@incubator.apache.org From: vinodkone@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130306023823.343592388BEF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vinodkone Date: Wed Mar 6 02:38:22 2013 New Revision: 1453146 URL: http://svn.apache.org/r1453146 Log: Fixed a bug in the slave that crashed it when hitting /statistics/snapshot.json. From: Ben Mahler Review: https://reviews.apache.org/r/9748 Modified: incubator/mesos/trunk/third_party/libprocess/src/statistics.cpp Modified: incubator/mesos/trunk/third_party/libprocess/src/statistics.cpp URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/src/statistics.cpp?rev=1453146&r1=1453145&r2=1453146&view=diff ============================================================================== --- incubator/mesos/trunk/third_party/libprocess/src/statistics.cpp (original) +++ incubator/mesos/trunk/third_party/libprocess/src/statistics.cpp Wed Mar 6 02:38:22 2013 @@ -346,21 +346,19 @@ Future StatisticsProcess::snap foreachkey (const string& context, statistics) { foreachkey (const string& name, statistics[context]) { - // Exclude archived time series. - if (statistics[context][name].archived) { + // Exclude archived and empty time series. + if (statistics[context][name].archived || + statistics[context][name].values.empty()) { continue; } // Skip statistics that don't match the query, if present. if (queryContext.isSome() && queryContext.get() != context) { continue; - } - if (queryName.isSome() && queryName.get() != name) { + } else if (queryName.isSome() && queryName.get() != name) { continue; } - CHECK(statistics[context][name].values.size() > 0); - JSON::Object object; object.values["context"] = context; object.values["name"] = name;