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

Unified Diff: base/test/histogram_tester.cc

Issue 2628843002: Match only prefixes of histogram names. (Closed)
Patch Set: Add expectation. Created 3 years, 11 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 | « no previous file | base/test/histogram_tester_unittest.cc » ('j') | base/test/histogram_tester_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/histogram_tester.cc
diff --git a/base/test/histogram_tester.cc b/base/test/histogram_tester.cc
index 90981e232637f8eb3323c96f9f22dc9538c5b89a..907e08b5d7def7b5158ad13f93c85eef352da1b1 100644
--- a/base/test/histogram_tester.cc
+++ b/base/test/histogram_tester.cc
@@ -11,6 +11,7 @@
#include "base/metrics/metrics_hashes.h"
#include "base/metrics/sample_map.h"
#include "base/metrics/statistics_recorder.h"
+#include "base/strings/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -113,6 +114,8 @@ HistogramTester::CountsMap HistogramTester::GetTotalCountsForPrefix(
CountsMap result;
for (base::HistogramBase* histogram : query_matches) {
Ilya Sherman 2017/01/12 20:32:41 Optional nit: While you're here, it would be nice
pkalinnikov 2017/01/13 10:28:59 Done here and throughout this file and its header.
+ if (!StartsWith(histogram->histogram_name(), query, CompareCase::SENSITIVE))
+ continue;
std::unique_ptr<HistogramSamples> new_samples =
GetHistogramSamplesSinceCreation(histogram->histogram_name());
// Omit unchanged histograms from the result.
« no previous file with comments | « no previous file | base/test/histogram_tester_unittest.cc » ('j') | base/test/histogram_tester_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698