mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vinodk...@apache.org
Subject svn commit: r1453146 - /incubator/mesos/trunk/third_party/libprocess/src/statistics.cpp
Date Wed, 06 Mar 2013 02:38:23 GMT
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 <benjamin.mahler@gmail.com>
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<Response> 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;



Mime
View raw message