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

Unified Diff: base/metrics/histogram_snapshot_manager.h

Issue 10829466: SampleSet -> HistogramSamples (will be reused by SparseHistogram) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « base/metrics/histogram_samples.cc ('k') | base/metrics/histogram_snapshot_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_snapshot_manager.h
===================================================================
--- base/metrics/histogram_snapshot_manager.h (revision 155400)
+++ base/metrics/histogram_snapshot_manager.h (working copy)
@@ -9,12 +9,13 @@
#include <string>
#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
-#include "base/metrics/histogram_flattener.h"
namespace base {
+class HistogramSamples;
+class HistogramFlattener;
+
// HistogramSnapshotManager handles the logistics of gathering up available
// histograms for recording either to disk or for transmission (such as from
// renderer to browser, or from browser to UMA upload). Since histograms can sit
@@ -30,23 +31,23 @@
// Snapshot all histograms, and ask |histogram_flattener_| to record the
// delta. The arguments allow selecting only a subset of histograms for
// recording, or to set a flag in each recorded histogram.
- void PrepareDeltas(base::Histogram::Flags flags_to_set, bool record_only_uma);
+ void PrepareDeltas(Histogram::Flags flags_to_set, bool record_only_uma);
private:
- // Maintain a map of histogram names to the sample stats we've recorded.
- typedef std::map<std::string, base::Histogram::SampleSet> LoggedSampleMap;
- // List of histograms names, and their encontered corruptions.
- typedef std::map<std::string, int> ProblemMap;
-
// Snapshot this histogram, and record the delta.
- void PrepareDelta(const base::Histogram& histogram);
+ void PrepareDelta(const Histogram& histogram);
+ // Try to detect and fix count inconsistency of logged samples.
+ void InspectLoggedSamplesInconsistency(
+ const HistogramSamples& new_snapshot,
+ HistogramSamples* logged_samples);
+
// For histograms, track what we've already recorded (as a sample for
// each histogram) so that we can record only the delta with the next log.
- LoggedSampleMap logged_samples_;
+ std::map<std::string, HistogramSamples*> logged_samples_;
- // List of histograms found corrupt to be corrupt, and their problems.
- scoped_ptr<ProblemMap> inconsistencies_;
+ // List of histograms found to be corrupt, and their problems.
+ std::map<std::string, int> inconsistencies_;
// |histogram_flattener_| handles the logistics of recording the histogram
// deltas.
« no previous file with comments | « base/metrics/histogram_samples.cc ('k') | base/metrics/histogram_snapshot_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698