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

Unified Diff: base/metrics/histogram.h

Issue 1485763002: Merge multiple histogram snapshots into single one for reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared-histograms
Patch Set: rebased Created 4 years, 10 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/metrics/histogram.cc » ('j') | base/metrics/histogram.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.h
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index 4e722aa20d91da7a1a0cd318150ee1a40c266830..6a54b148bdc8034ab8041f7b6e392b6d01ce8f67 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -145,6 +145,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
Sample maximum,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
+ HistogramBase::AtomicCount* logged,
uint32_t counts_size,
HistogramSamples::Metadata* meta);
@@ -197,6 +198,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
void Add(Sample value) override;
void AddCount(Sample value, int count) override;
scoped_ptr<HistogramSamples> SnapshotSamples() const override;
+ scoped_ptr<HistogramSamples> SnapshotDelta() override;
void AddSamples(const HistogramSamples& samples) override;
bool AddSamplesFromPickle(base::PickleIterator* iter) override;
void WriteHTMLGraph(std::string* output) const override;
@@ -228,6 +230,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
Sample maximum,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
+ HistogramBase::AtomicCount* logged,
Alexei Svitkine (slow) 2016/02/09 19:46:51 Nit: logged_counts Change everywhere.
bcwhite 2016/02/11 16:42:38 Done.
uint32_t counts_size,
HistogramSamples::Metadata* meta);
@@ -303,6 +306,9 @@ class BASE_EXPORT Histogram : public HistogramBase {
// sample.
scoped_ptr<SampleVector> samples_;
+ // Also keep a previous uploaded state for calculating deltas.
+ scoped_ptr<HistogramSamples> logged_;
+
DISALLOW_COPY_AND_ASSIGN(Histogram);
};
@@ -347,6 +353,7 @@ class BASE_EXPORT LinearHistogram : public Histogram {
Sample maximum,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
+ HistogramBase::AtomicCount* logged,
uint32_t counts_size,
HistogramSamples::Metadata* meta);
@@ -388,6 +395,7 @@ class BASE_EXPORT LinearHistogram : public Histogram {
Sample maximum,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
+ HistogramBase::AtomicCount* logged,
uint32_t counts_size,
HistogramSamples::Metadata* meta);
@@ -431,6 +439,7 @@ class BASE_EXPORT BooleanHistogram : public LinearHistogram {
static HistogramBase* PersistentGet(const std::string& name,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
+ HistogramBase::AtomicCount* logged,
HistogramSamples::Metadata* meta);
HistogramType GetHistogramType() const override;
@@ -443,6 +452,7 @@ class BASE_EXPORT BooleanHistogram : public LinearHistogram {
BooleanHistogram(const std::string& name,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
+ HistogramBase::AtomicCount* logged,
HistogramSamples::Metadata* meta);
friend BASE_EXPORT HistogramBase* DeserializeHistogramInfo(
@@ -476,6 +486,7 @@ class BASE_EXPORT CustomHistogram : public Histogram {
static HistogramBase* PersistentGet(const std::string& name,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
+ HistogramBase::AtomicCount* logged,
uint32_t counts_size,
HistogramSamples::Metadata* meta);
@@ -499,6 +510,7 @@ class BASE_EXPORT CustomHistogram : public Histogram {
CustomHistogram(const std::string& name,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
+ HistogramBase::AtomicCount* logged,
uint32_t counts_size,
HistogramSamples::Metadata* meta);
« no previous file with comments | « no previous file | base/metrics/histogram.cc » ('j') | base/metrics/histogram.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698