diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-09-30 04:39:37 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-09-30 04:39:37 +0200 |
commit | ab9edfb54bb985e683c318bbd7e4c3594d8e6df2 (patch) | |
tree | 2412275b845353d4f939f6f61c326d488e2d7347 /netwerk/cache2/CacheFileUtils.h | |
parent | 3343a4b4744b6c78d1f3d0c3f111e1adfddc18a5 (diff) | |
download | UXP-ab9edfb54bb985e683c318bbd7e4c3594d8e6df2.tar UXP-ab9edfb54bb985e683c318bbd7e4c3594d8e6df2.tar.gz UXP-ab9edfb54bb985e683c318bbd7e4c3594d8e6df2.tar.lz UXP-ab9edfb54bb985e683c318bbd7e4c3594d8e6df2.tar.xz UXP-ab9edfb54bb985e683c318bbd7e4c3594d8e6df2.zip |
Remove telemetry probes to get detailed disk cache hit rate.
Tag #21.
Diffstat (limited to 'netwerk/cache2/CacheFileUtils.h')
-rw-r--r-- | netwerk/cache2/CacheFileUtils.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/netwerk/cache2/CacheFileUtils.h b/netwerk/cache2/CacheFileUtils.h index 13acfd71d..b66f0adf1 100644 --- a/netwerk/cache2/CacheFileUtils.h +++ b/netwerk/cache2/CacheFileUtils.h @@ -10,7 +10,6 @@ #include "nsString.h" #include "nsTArray.h" #include "mozilla/StaticMutex.h" -#include "mozilla/TimeStamp.h" class nsILoadContextInfo; class nsACString; @@ -90,64 +89,6 @@ private: nsTArray<ValidityPair> mMap; }; - -class DetailedCacheHitTelemetry { -public: - enum ERecType { - HIT = 0, - MISS = 1 - }; - - static void AddRecord(ERecType aType, TimeStamp aLoadStart); - -private: - class HitRate { - public: - HitRate(); - - void AddRecord(ERecType aType); - // Returns the bucket index that the current hit rate falls into according - // to the given aNumOfBuckets. - uint32_t GetHitRateBucket(uint32_t aNumOfBuckets) const; - uint32_t Count(); - void Reset(); - - private: - uint32_t mHitCnt; - uint32_t mMissCnt; - }; - - // Group the hits and misses statistics by cache files count ranges (0-5000, - // 5001-10000, ... , 95001- ) - static const uint32_t kRangeSize = 5000; - static const uint32_t kNumOfRanges = 20; - - // Use the same ranges to report an average hit rate. Report the hit rates - // (and reset the counters) every kTotalSamplesReportLimit samples. - static const 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. - static const 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%, ... - static const uint32_t kHitRateBuckets = 20; - - // Protects sRecordCnt and sHitStats calls. - static StaticMutex sLock; - - // Counter of samples that is compared against kTotalSamplesReportLimit. - static uint32_t sRecordCnt; - - // Hit rate statistics for every cache size range. - static HitRate sHRStats[kNumOfRanges]; -}; - void FreeBuffer(void *aBuf); |