зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1256366 - Remove linear and exponential stats collection from histogram.cc. r=gfritzsche
--HG-- extra : rebase_source : 0432153cd79b63c1618056988ff354d5a9b1f4ea
This commit is contained in:
Родитель
30229f6ecd
Коммит
3a67285d62
|
@ -567,7 +567,7 @@ const std::string Histogram::GetAsciiBucketRange(size_t i) const {
|
|||
|
||||
// Update histogram data with new sample.
|
||||
void Histogram::Accumulate(Sample value, Count count, size_t index) {
|
||||
sample_.AccumulateWithLinearStats(value, count, index);
|
||||
sample_.Accumulate(value, count, index);
|
||||
}
|
||||
|
||||
void Histogram::SetBucketRange(size_t i, Sample value) {
|
||||
|
@ -720,9 +720,6 @@ void Histogram::WriteAsciiBucketGraph(double current_size, double max_size,
|
|||
Histogram::SampleSet::SampleSet()
|
||||
: counts_(),
|
||||
sum_(0),
|
||||
sum_squares_(0),
|
||||
log_sum_(0),
|
||||
log_sum_squares_(0),
|
||||
redundant_count_(0),
|
||||
mutex_("Histogram::SampleSet::SampleSet") {
|
||||
}
|
||||
|
@ -747,12 +744,11 @@ void Histogram::SampleSet::Accumulate(const OffTheBooksMutexAutoLock& ev,
|
|||
DCHECK_GE(redundant_count_, 0);
|
||||
}
|
||||
|
||||
void Histogram::SampleSet::AccumulateWithLinearStats(Sample value,
|
||||
Count count,
|
||||
size_t index) {
|
||||
void Histogram::SampleSet::Accumulate(Sample value,
|
||||
Count count,
|
||||
size_t index) {
|
||||
OffTheBooksMutexAutoLock locker(mutex_);
|
||||
Accumulate(locker, value, count, index);
|
||||
sum_squares_ += static_cast<int64_t>(count) * value * value;
|
||||
}
|
||||
|
||||
Count Histogram::SampleSet::TotalCount(const OffTheBooksMutexAutoLock& ev)
|
||||
|
@ -770,9 +766,6 @@ void Histogram::SampleSet::Add(const SampleSet& other) {
|
|||
OffTheBooksMutexAutoLock locker(mutex_);
|
||||
DCHECK_EQ(counts_.size(), other.counts_.size());
|
||||
sum_ += other.sum_;
|
||||
sum_squares_ += other.sum_squares_;
|
||||
log_sum_ += other.log_sum_;
|
||||
log_sum_squares_ += other.log_sum_squares_;
|
||||
redundant_count_ += other.redundant_count_;
|
||||
for (size_t index = 0; index < counts_.size(); ++index)
|
||||
counts_[index] += other.counts_[index];
|
||||
|
@ -868,7 +861,7 @@ Histogram::ClassType LinearHistogram::histogram_type() const {
|
|||
}
|
||||
|
||||
void LinearHistogram::Accumulate(Sample value, Count count, size_t index) {
|
||||
sample_.AccumulateWithLinearStats(value, count, index);
|
||||
sample_.Accumulate(value, count, index);
|
||||
}
|
||||
|
||||
void LinearHistogram::SetRangeDescriptions(
|
||||
|
|
|
@ -353,7 +353,7 @@ class Histogram {
|
|||
void Resize(const Histogram& histogram);
|
||||
|
||||
// Accessor for histogram to make routine additions.
|
||||
void AccumulateWithLinearStats(Sample value, Count count, size_t index);
|
||||
void Accumulate(Sample value, Count count, size_t index);
|
||||
|
||||
// Arithmetic manipulation of corresponding elements of the set.
|
||||
void Add(const SampleSet& other);
|
||||
|
@ -375,15 +375,6 @@ class Histogram {
|
|||
int64_t sum(const OffTheBooksMutexAutoLock& ev) const {
|
||||
return sum_;
|
||||
}
|
||||
uint64_t sum_squares(const OffTheBooksMutexAutoLock& ev) const {
|
||||
return sum_squares_;
|
||||
}
|
||||
double log_sum(const OffTheBooksMutexAutoLock& ev) const {
|
||||
return log_sum_;
|
||||
}
|
||||
double log_sum_squares(const OffTheBooksMutexAutoLock& ev) const {
|
||||
return log_sum_squares_;
|
||||
}
|
||||
int64_t redundant_count(const OffTheBooksMutexAutoLock& ev) const {
|
||||
return redundant_count_;
|
||||
}
|
||||
|
@ -396,9 +387,6 @@ class Histogram {
|
|||
const SampleSet& operator=(const SampleSet& other) {
|
||||
counts_ = other.counts_;
|
||||
sum_ = other.sum_;
|
||||
sum_squares_ = other.sum_squares_;
|
||||
log_sum_ = other.log_sum_;
|
||||
log_sum_squares_ = other.log_sum_squares_;
|
||||
redundant_count_ = other.redundant_count_;
|
||||
return *this;
|
||||
}
|
||||
|
@ -415,13 +403,6 @@ class Histogram {
|
|||
// Save simple stats locally. Note that this MIGHT get done in base class
|
||||
// without shared memory at some point.
|
||||
int64_t sum_; // sum of samples.
|
||||
uint64_t sum_squares_; // sum of squares of samples.
|
||||
|
||||
// These fields may or may not be updated at the discretion of the
|
||||
// histogram. We use the natural log and compute ln(sample+1) so that
|
||||
// zeros are handled sanely.
|
||||
double log_sum_; // sum of logs of samples.
|
||||
double log_sum_squares_; // sum of squares of logs of samples
|
||||
|
||||
// To help identify memory corruption, we reduntantly save the number of
|
||||
// samples we've accumulated into all of our buckets. We can compare this
|
||||
|
|
Загрузка…
Ссылка в новой задаче