You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2017/07/21 00:27:37 UTC

mesos git commit: Revert "Removed the optional time window from metrics::Counter."

Repository: mesos
Updated Branches:
  refs/heads/master 0242d84c1 -> 13104ef80


Revert "Removed the optional time window from metrics::Counter."

This reverts commit 0242d84c15a5d4129625f5b39f94a0c60138f2a8.


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/13104ef8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/13104ef8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/13104ef8

Branch: refs/heads/master
Commit: 13104ef806eea82610cf46f87d13e5c9083577d5
Parents: 0242d84
Author: Benjamin Mahler <bm...@apache.org>
Authored: Thu Jul 20 17:27:25 2017 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Thu Jul 20 17:27:25 2017 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/metrics/counter.hpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/13104ef8/3rdparty/libprocess/include/process/metrics/counter.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/metrics/counter.hpp b/3rdparty/libprocess/include/process/metrics/counter.hpp
index 3531b53..15aeeb5 100644
--- a/3rdparty/libprocess/include/process/metrics/counter.hpp
+++ b/3rdparty/libprocess/include/process/metrics/counter.hpp
@@ -28,8 +28,10 @@ class Counter : public Metric
 public:
   // 'name' is the unique name for the instance of Counter being constructed.
   // This is what will be used as the key in the JSON endpoint.
-  Counter(const std::string& name)
-    : Metric(name, None()), data(new Data())
+  // 'window' is the amount of history to keep for this Metric.
+  Counter(const std::string& name, const Option<Duration>& window = None())
+    : Metric(name, window),
+      data(new Data())
   {
     push(static_cast<double>(data->value.load()));
   }