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

Unified Diff: blimp/net/blimp_connection_statistics.cc

Issue 1962393004: Added a debug info UI for Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added empty implementation for linux client Created 4 years, 7 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 | « blimp/net/blimp_connection_statistics.h ('k') | blimp/net/blimp_connection_statistics_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/blimp_connection_statistics.cc
diff --git a/blimp/net/blimp_connection_statistics.cc b/blimp/net/blimp_connection_statistics.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b61d23b718aec45a70451f66cc4a33a3edadbad7
--- /dev/null
+++ b/blimp/net/blimp_connection_statistics.cc
@@ -0,0 +1,26 @@
+// 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 "blimp/net/blimp_connection_statistics.h"
+
+namespace blimp {
+
+BlimpConnectionStatistics::BlimpConnectionStatistics()
+ : histogram_(
+ base::SparseHistogram::FactoryGet("BlimpSparseHistogram",
+ base::HistogramBase::kNoFlags)) {}
+
+BlimpConnectionStatistics::~BlimpConnectionStatistics() {}
+
+void BlimpConnectionStatistics::Add(EventType type, int data) {
+ histogram_->AddCount(type, data);
+}
+
+int BlimpConnectionStatistics::Get(EventType type) {
+ std::unique_ptr<base::HistogramSamples> snapshot =
+ histogram_->SnapshotSamples();
+ return snapshot->GetCount(type);
+}
+
+} // namespace blimp
« no previous file with comments | « blimp/net/blimp_connection_statistics.h ('k') | blimp/net/blimp_connection_statistics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698