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

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

Issue 120753002: Add a StatisticsDeltaReader class and use cases (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove SetUpTestCase in StatisticsDeltaReader unit tests. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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 #include "base/metrics/histogram_samples.h"
14
15 namespace base {
16
17 // This class acts as a differential reader for histogram samples, enabling
18 // tests to check that metrics were recorded as they should be.
19 // Before using this class, StatisticsRecoder must be initialized.
20 class StatisticsDeltaReader {
21 public:
22 StatisticsDeltaReader();
23 ~StatisticsDeltaReader();
24
25 // Returns the histogram data accumulated since this instance was created.
26 // Returns NULL if no samples are available.
27 scoped_ptr<HistogramSamples> GetHistogramSamplesSinceCreation(
28 const std::string& histogram_name);
29
30 private:
31 // Used to determine the histogram changes made during this instance's
32 // lifecycle. This isntance takes ownership of the samples, which are deleted
Ilya Sherman 2014/01/06 23:31:35 nit: "isntance" -> "instance"
lpromero 2014/01/07 10:20:02 Done.
33 // when the instance is destroyed.
34 std::map<std::string, HistogramSamples*> original_samples_;
35
36 DISALLOW_COPY_AND_ASSIGN(StatisticsDeltaReader);
37 };
38
39 } // namespace base
40
41 #endif // BASE_TEST_STATISTICS_DELTA_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698