| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/test/histogram_tester.h" | 5 #include "base/test/histogram_tester.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/metrics/histogram_samples.h" | 8 #include "base/metrics/histogram_samples.h" |
| 9 #include "base/metrics/sample_map.h" | 9 #include "base/metrics/sample_map.h" |
| 10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/googletest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 | 15 |
| 16 HistogramTester::HistogramTester() { | 16 HistogramTester::HistogramTester() { |
| 17 StatisticsRecorder::Initialize(); // Safe to call multiple times. | 17 StatisticsRecorder::Initialize(); // Safe to call multiple times. |
| 18 | 18 |
| 19 // Record any histogram data that exists when the object is created so it can | 19 // Record any histogram data that exists when the object is created so it can |
| 20 // be subtracted later. | 20 // be subtracted later. |
| 21 StatisticsRecorder::Histograms histograms; | 21 StatisticsRecorder::Histograms histograms; |
| 22 StatisticsRecorder::GetSnapshot(std::string(), &histograms); | 22 StatisticsRecorder::GetSnapshot(std::string(), &histograms); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 bool Bucket::operator==(const Bucket& other) const { | 167 bool Bucket::operator==(const Bucket& other) const { |
| 168 return min == other.min && count == other.count; | 168 return min == other.min && count == other.count; |
| 169 } | 169 } |
| 170 | 170 |
| 171 void PrintTo(const Bucket& bucket, std::ostream* os) { | 171 void PrintTo(const Bucket& bucket, std::ostream* os) { |
| 172 *os << "Bucket " << bucket.min << ": " << bucket.count; | 172 *os << "Bucket " << bucket.min << ": " << bucket.count; |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace base | 175 } // namespace base |
| OLD | NEW |