/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Returns true when two pairs can be merged, i.e. they do overlap or the one // ends exactly where the other begins. bool CanBeMerged(const ValidityPair& aOther) const;
// Returns true when aOffset is placed anywhere in the validity interval or // exactly after its end. bool IsInOrFollows(uint32_t aOffset) const;
// Returns true when this pair has lower offset than the other pair. In case // both pairs have the same offset it returns true when this pair has a // shorter length. bool LessThan(const ValidityPair& aOther) const;
// Merges two pair into one. void Merge(const ValidityPair& aOther);
// Group the hits and misses statistics by cache files count ranges (0-5000, // 5001-10000, ... , 95001- ) staticconst uint32_t kRangeSize = 5000; staticconst uint32_t kNumOfRanges = 20; staticconst uint32_t kPercentageRange = 5; staticconst uint32_t kMaxPercentage = 100;
// Use the same ranges to report an average hit rate. Report the hit rates // (and reset the counters) every kTotalSamplesReportLimit samples. staticconst uint32_t kTotalSamplesReportLimit = 1000;
// Report hit rate for a given cache size range only if it contains // kHitRateSamplesReportLimit or more samples. This limit should avoid // reporting a biased statistics. staticconst uint32_t kHitRateSamplesReportLimit = 500;
// All hit rates are accumulated in a single telemetry probe, so to use // a sane number of enumerated values the hit rate is divided into buckets // instead of using a percent value. This constant defines number of buckets // that we divide the hit rates into. I.e. we'll report ranges 0%-5%, 5%-10%, // 10-%15%, ... staticconst uint32_t kHitRateBuckets = 20;
// Protects sRecordCnt, sHRStats and Telemetry::Accumulated() calls. static StaticMutex sLock;
// Counter of samples that is compared against kTotalSamplesReportLimit. static uint32_t sRecordCnt MOZ_GUARDED_BY(sLock);
// Hit rate statistics for every cache size range. static HitRate sHRStats[kNumOfRanges] MOZ_GUARDED_BY(sLock);
};
class CachePerfStats { public: // perfStatTypes in displayRcwnStats() in toolkit/content/aboutNetworking.js // must match EDataType enum EDataType {
IO_OPEN = 0,
IO_READ = 1,
IO_WRITE = 2,
ENTRY_OPEN = 3,
LAST = 4
};
private: // This class computes average and standard deviation, it returns an // arithmetic avg and stddev until total number of values reaches mWeight. // Then it returns modified moving average computed as follows: // // avg = (1-a)*avg + a*value // avgsq = (1-a)*avgsq + a*value^2 // stddev = sqrt(avgsq - avg^2) // // where // avgsq is an average of the square of the values // a = 1 / weight class MMA { public:
MMA(uint32_t aTotalWeight, bool aFilter);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.