summaryrefslogtreecommitdiffstats
path: root/netwerk/cache2
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-09-03 10:11:38 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-09-03 10:11:38 +0200
commitab961aeb54335fd07c66de2e3b8c3b6af6f89ea2 (patch)
treec44670a25d942a672951e430499f70978ec7d337 /netwerk/cache2
parent45f9a0daad81d1c6a1188b3473e5f0c67d27c0aa (diff)
downloadUXP-ab961aeb54335fd07c66de2e3b8c3b6af6f89ea2.tar
UXP-ab961aeb54335fd07c66de2e3b8c3b6af6f89ea2.tar.gz
UXP-ab961aeb54335fd07c66de2e3b8c3b6af6f89ea2.tar.lz
UXP-ab961aeb54335fd07c66de2e3b8c3b6af6f89ea2.tar.xz
UXP-ab961aeb54335fd07c66de2e3b8c3b6af6f89ea2.zip
Remove all C++ Telemetry Accumulation calls.
This creates a number of stubs and leaves some surrounding code that may be irrelevant (eg. recorded time stamps, status variables). Stub resolution/removal should be a follow-up to this.
Diffstat (limited to 'netwerk/cache2')
-rw-r--r--netwerk/cache2/CacheFile.cpp7
-rw-r--r--netwerk/cache2/CacheFileIOManager.cpp4
-rw-r--r--netwerk/cache2/CacheFileMetadata.cpp14
-rw-r--r--netwerk/cache2/CacheFileUtils.cpp16
-rw-r--r--netwerk/cache2/CacheFileUtils.h2
-rw-r--r--netwerk/cache2/CacheIOThread.cpp2
-rw-r--r--netwerk/cache2/CacheIndex.cpp1
-rw-r--r--netwerk/cache2/CacheStorageService.cpp5
-rw-r--r--netwerk/cache2/OldWrappers.cpp19
9 files changed, 1 insertions, 69 deletions
diff --git a/netwerk/cache2/CacheFile.cpp b/netwerk/cache2/CacheFile.cpp
index fa0a89382..ce771c754 100644
--- a/netwerk/cache2/CacheFile.cpp
+++ b/netwerk/cache2/CacheFile.cpp
@@ -14,7 +14,6 @@
#include <algorithm>
#include "nsComponentManagerUtils.h"
#include "nsProxyRelease.h"
-#include "mozilla/Telemetry.h"
// When CACHE_CHUNKS is defined we always cache unused chunks in mCacheChunks.
// When it is not defined, we always release the chunks ASAP, i.e. we cache
@@ -1914,9 +1913,6 @@ CacheFile::RemoveInput(CacheFileInputStream *aInput, nsresult aStatus)
// chunks that won't be used anymore.
CleanUpCachedChunks();
- Telemetry::Accumulate(Telemetry::NETWORK_CACHE_V2_INPUT_STREAM_STATUS,
- StatusToTelemetryEnum(aStatus));
-
return NS_OK;
}
@@ -1952,9 +1948,6 @@ CacheFile::RemoveOutput(CacheFileOutputStream *aOutput, nsresult aStatus)
// Notify close listener as the last action
aOutput->NotifyCloseListener();
- Telemetry::Accumulate(Telemetry::NETWORK_CACHE_V2_OUTPUT_STREAM_STATUS,
- StatusToTelemetryEnum(aStatus));
-
return NS_OK;
}
diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp
index 1d0d57635..98fdc24ac 100644
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -21,7 +21,6 @@
#include "nsIObserverService.h"
#include "nsICacheStorageVisitor.h"
#include "nsISizeOf.h"
-#include "mozilla/Telemetry.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/Services.h"
#include "nsDirectoryServiceUtils.h"
@@ -3861,7 +3860,6 @@ CacheFileIOManager::CreateCacheTree()
}
#endif
- Telemetry::Accumulate(Telemetry::NETWORK_CACHE_FS_TYPE, fsType);
CacheObserver::SetCacheFSReported();
}
@@ -3917,8 +3915,6 @@ CacheFileIOManager::OpenNSPRHandle(CacheFileHandle *aHandle, bool aCreate)
uint32_t cacheUsage;
if (NS_SUCCEEDED(CacheIndex::GetCacheSize(&cacheUsage))) {
cacheUsage >>= 10;
- Telemetry::Accumulate(Telemetry::NETWORK_CACHE_SIZE_FULL_FAT,
- cacheUsage);
sSizeReported = true;
}
}
diff --git a/netwerk/cache2/CacheFileMetadata.cpp b/netwerk/cache2/CacheFileMetadata.cpp
index 3814b4c87..86fc089aa 100644
--- a/netwerk/cache2/CacheFileMetadata.cpp
+++ b/netwerk/cache2/CacheFileMetadata.cpp
@@ -14,7 +14,6 @@
#include "nsICacheEntry.h" // for nsICacheEntryMetaDataVisitor
#include "../cache/nsCacheUtils.h"
#include "nsIFile.h"
-#include "mozilla/Telemetry.h"
#include "mozilla/DebugOnly.h"
#include "prnetdb.h"
@@ -687,16 +686,6 @@ CacheFileMetadata::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
return NS_OK;
}
- if (mFirstRead) {
- Telemetry::AccumulateTimeDelta(
- Telemetry::NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS, mReadStart);
- Telemetry::Accumulate(
- Telemetry::NETWORK_CACHE_METADATA_FIRST_READ_SIZE, mBufSize);
- } else {
- Telemetry::AccumulateTimeDelta(
- Telemetry::NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS, mReadStart);
- }
-
// check whether we have read all necessary data
uint32_t realOffset = NetworkEndian::readUint32(mBuf + mBufSize -
sizeof(uint32_t));
@@ -776,9 +765,6 @@ CacheFileMetadata::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
return NS_OK;
}
- Telemetry::Accumulate(Telemetry::NETWORK_CACHE_METADATA_SIZE,
- size - realOffset);
-
// We have all data according to offset information at the end of the entry.
// Try to parse it.
rv = ParseMetadata(realOffset, realOffset - usedOffset, true);
diff --git a/netwerk/cache2/CacheFileUtils.cpp b/netwerk/cache2/CacheFileUtils.cpp
index d43e958bf..fe1a53b3d 100644
--- a/netwerk/cache2/CacheFileUtils.cpp
+++ b/netwerk/cache2/CacheFileUtils.cpp
@@ -7,7 +7,6 @@
#include "CacheFileUtils.h"
#include "LoadContextInfo.h"
#include "mozilla/Tokenizer.h"
-#include "mozilla/Telemetry.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsString.h"
@@ -474,19 +473,6 @@ DetailedCacheHitTelemetry::AddRecord(ERecType aType, TimeStamp aLoadStart)
StaticMutexAutoLock lock(sLock);
- if (aType == MISS) {
- mozilla::Telemetry::AccumulateTimeDelta(
- mozilla::Telemetry::NETWORK_CACHE_V2_MISS_TIME_MS,
- aLoadStart);
- } else {
- mozilla::Telemetry::AccumulateTimeDelta(
- mozilla::Telemetry::NETWORK_CACHE_V2_HIT_TIME_MS,
- aLoadStart);
- }
-
- Telemetry::Accumulate(Telemetry::NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE,
- hitMissValue);
-
sHRStats[rangeIdx].AddRecord(aType);
++sRecordCnt;
@@ -505,8 +491,6 @@ DetailedCacheHitTelemetry::AddRecord(ERecType aType, TimeStamp aLoadStart)
uint32_t bucketOffset = sHRStats[i].GetHitRateBucket(kHitRateBuckets) *
kNumOfRanges;
- Telemetry::Accumulate(Telemetry::NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE,
- bucketOffset + i);
sHRStats[i].Reset();
}
}
diff --git a/netwerk/cache2/CacheFileUtils.h b/netwerk/cache2/CacheFileUtils.h
index 3371c3eb5..13acfd71d 100644
--- a/netwerk/cache2/CacheFileUtils.h
+++ b/netwerk/cache2/CacheFileUtils.h
@@ -138,7 +138,7 @@ private:
// 10-%15%, ...
static const uint32_t kHitRateBuckets = 20;
- // Protects sRecordCnt, sHitStats and Telemetry::Accumulated() calls.
+ // Protects sRecordCnt and sHitStats calls.
static StaticMutex sLock;
// Counter of samples that is compared against kTotalSamplesReportLimit.
diff --git a/netwerk/cache2/CacheIOThread.cpp b/netwerk/cache2/CacheIOThread.cpp
index b96f03216..d51f61b0f 100644
--- a/netwerk/cache2/CacheIOThread.cpp
+++ b/netwerk/cache2/CacheIOThread.cpp
@@ -62,8 +62,6 @@ void CacheIOTelemetry::Report(uint32_t aLevel, CacheIOTelemetry::size_type aLeng
// 10 is number of buckets we have in each probe
aLength = std::min<size_type>(aLength, 10);
-
- Telemetry::Accumulate(telemetryID[aLevel], aLength - 1); // counted from 0
}
} // anon
diff --git a/netwerk/cache2/CacheIndex.cpp b/netwerk/cache2/CacheIndex.cpp
index 4525bbe6d..1009aeaf8 100644
--- a/netwerk/cache2/CacheIndex.cpp
+++ b/netwerk/cache2/CacheIndex.cpp
@@ -3757,7 +3757,6 @@ ReportHashSizeMatch(const SHA1Sum::Hash *aHash1, const SHA1Sum::Hash *aHash2)
bitsDiff++;
uint8_t hashSizeMatch = debruijn32[bitsDiff*0x076be629>>27] + (i<<5);
- Telemetry::Accumulate(Telemetry::NETWORK_CACHE_HASH_STATS, hashSizeMatch);
return;
}
diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp
index 67ef4c526..85f364e4e 100644
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -2084,8 +2084,6 @@ CacheStorageService::TelemetryRecordEntryCreation(CacheEntry const* entry)
mPurgeTimeStamps.Remove(key);
- Telemetry::AccumulateTimeDelta(Telemetry::HTTP_CACHE_ENTRY_RELOAD_TIME,
- timeStamp, TimeStamp::NowLoRes());
}
void
@@ -2112,9 +2110,6 @@ CacheStorageService::TelemetryRecordEntryRemoval(CacheEntry const* entry)
TelemetryPrune(now);
mPurgeTimeStamps.Put(key, now);
- Telemetry::Accumulate(Telemetry::HTTP_CACHE_ENTRY_REUSE_COUNT, entry->UseCount());
- Telemetry::AccumulateTimeDelta(Telemetry::HTTP_CACHE_ENTRY_ALIVE_TIME,
- entry->LoadStart(), TimeStamp::NowLoRes());
}
// nsIMemoryReporter
diff --git a/netwerk/cache2/OldWrappers.cpp b/netwerk/cache2/OldWrappers.cpp
index 81df88df0..76a4fa6c1 100644
--- a/netwerk/cache2/OldWrappers.cpp
+++ b/netwerk/cache2/OldWrappers.cpp
@@ -21,7 +21,6 @@
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsProxyRelease.h"
-#include "mozilla/Telemetry.h"
static NS_DEFINE_CID(kStreamTransportServiceCID,
NS_STREAMTRANSPORTSERVICE_CID);
@@ -793,24 +792,6 @@ _OldCacheLoad::Run()
return NS_OK;
}
- if (NS_SUCCEEDED(mStatus)) {
- if (mFlags & nsICacheStorage::OPEN_TRUNCATE) {
- mozilla::Telemetry::AccumulateTimeDelta(
- mozilla::Telemetry::NETWORK_CACHE_V1_TRUNCATE_TIME_MS,
- mLoadStart);
- }
- else if (mNew) {
- mozilla::Telemetry::AccumulateTimeDelta(
- mozilla::Telemetry::NETWORK_CACHE_V1_MISS_TIME_MS,
- mLoadStart);
- }
- else {
- mozilla::Telemetry::AccumulateTimeDelta(
- mozilla::Telemetry::NETWORK_CACHE_V1_HIT_TIME_MS,
- mLoadStart);
- }
- }
-
if (!(mFlags & CHECK_MULTITHREADED))
Check();