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

Side by Side Diff: base/test/statistics_delta_reader.h

Issue 379283002: Rework UMAHistogramHelper and StatisticsDeltaReader into [Chrome]HistogramTester. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/test/histogram_tester_unittest.cc ('k') | base/test/statistics_delta_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_TEST_STATISTICS_DELTA_READER_H_
6 #define BASE_TEST_STATISTICS_DELTA_READER_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13
14 namespace base {
15
16 class HistogramSamples;
17
18 // This class acts as a differential reader for histogram samples, enabling
19 // tests to check that metrics were recorded as they should be.
20 //
21 // This class is DEPRECATED.
22 // TODO(mlerman): Remove all references to this class with UMAHistogramHelper
23 // references. crbug.com/384011
24 class StatisticsDeltaReader {
25 public:
26 StatisticsDeltaReader();
27 ~StatisticsDeltaReader();
28
29 // Returns the histogram data accumulated since this instance was created.
30 // Returns NULL if no samples are available.
31 scoped_ptr<HistogramSamples> GetHistogramSamplesSinceCreation(
32 const std::string& histogram_name);
33
34 private:
35 // Used to determine the histogram changes made during this instance's
36 // lifecycle. This instance takes ownership of the samples, which are deleted
37 // when the instance is destroyed.
38 std::map<std::string, HistogramSamples*> original_samples_;
39
40 DISALLOW_COPY_AND_ASSIGN(StatisticsDeltaReader);
41 };
42
43 } // namespace base
44
45 #endif // BASE_TEST_STATISTICS_DELTA_READER_H_
OLDNEW
« no previous file with comments | « base/test/histogram_tester_unittest.cc ('k') | base/test/statistics_delta_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698