Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: remoting/base/running_samples.cc

Issue 1817093005: Revert of Show max latency on client's status bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/running_samples.h ('k') | remoting/base/running_samples_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/running_samples.cc
diff --git a/remoting/base/running_samples.cc b/remoting/base/running_samples.cc
deleted file mode 100644
index d76a1a688d8458e6c3d1cd2c644c4e5ca6b4dd9f..0000000000000000000000000000000000000000
--- a/remoting/base/running_samples.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/base/running_samples.h"
-
-#include <algorithm>
-
-#include "base/logging.h"
-
-namespace remoting {
-
-RunningSamples::RunningSamples(int window_size)
- : window_size_(window_size) {
- DCHECK_GT(window_size, 0);
-}
-
-RunningSamples::~RunningSamples() {}
-
-void RunningSamples::Record(int64_t value) {
- DCHECK(thread_checker_.CalledOnValidThread());
-
- data_points_.push_back(value);
- sum_ += value;
-
- if (data_points_.size() > window_size_) {
- sum_ -= data_points_[0];
- data_points_.pop_front();
- }
-}
-
-double RunningSamples::Average() const {
- DCHECK(thread_checker_.CalledOnValidThread());
-
- if (data_points_.empty())
- return 0;
- return static_cast<double>(sum_) / data_points_.size();
-}
-
-int64_t RunningSamples::Max() const {
- DCHECK(thread_checker_.CalledOnValidThread());
-
- if (data_points_.empty())
- return 0;
-
- return *std::max_element(data_points_.begin(), data_points_.end());
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/base/running_samples.h ('k') | remoting/base/running_samples_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698