Remove telemetry probes for cache file system.

This commit is contained in:
wolfbeast 2018-09-29 23:55:49 +02:00 committed by Roy Tam
commit e87890d893
5 changed files with 0 additions and 99 deletions

View file

@ -3822,44 +3822,6 @@ CacheFileIOManager::CreateCacheTree()
StartRemovingTrash();
if (!CacheObserver::CacheFSReported()) {
uint32_t fsType = 4; // Other OS
#ifdef XP_WIN
nsAutoString target;
nsresult rv = mCacheDirectory->GetTarget(target);
if (NS_FAILED(rv)) {
return NS_OK;
}
wchar_t volume_path[MAX_PATH + 1] = { 0 };
if (!::GetVolumePathNameW(target.get(),
volume_path,
mozilla::ArrayLength(volume_path))) {
return NS_OK;
}
wchar_t fsName[6] = { 0 };
if (!::GetVolumeInformationW(volume_path, nullptr, 0, nullptr, nullptr,
nullptr, fsName,
mozilla::ArrayLength(fsName))) {
return NS_OK;
}
if (wcscmp(fsName, L"NTFS") == 0) {
fsType = 0;
} else if (wcscmp(fsName, L"FAT32") == 0) {
fsType = 1;
} else if (wcscmp(fsName, L"FAT") == 0) {
fsType = 2;
} else {
fsType = 3;
}
#endif
CacheObserver::SetCacheFSReported();
}
return NS_OK;
}
@ -3905,16 +3867,6 @@ CacheFileIOManager::OpenNSPRHandle(CacheFileHandle *aHandle, bool aCreate)
LOG(("CacheFileIOManager::OpenNSPRHandle() - Successfully evicted entry"
" with hash %08x%08x%08x%08x%08x. %s to create the new file.",
LOGSHA1(&hash), NS_SUCCEEDED(rv) ? "Succeeded" : "Failed"));
// Report the full size only once per session
static bool sSizeReported = false;
if (!sSizeReported) {
uint32_t cacheUsage;
if (NS_SUCCEEDED(CacheIndex::GetCacheSize(&cacheUsage))) {
cacheUsage >>= 10;
sSizeReported = true;
}
}
} else {
LOG(("CacheFileIOManager::OpenNSPRHandle() - Couldn't evict an existing"
" entry."));

View file

@ -86,9 +86,6 @@ bool CacheObserver::sSanitizeOnShutdown = kDefaultSanitizeOnShutdown;
static bool kDefaultClearCacheOnShutdown = false;
bool CacheObserver::sClearCacheOnShutdown = kDefaultClearCacheOnShutdown;
static bool kDefaultCacheFSReported = false;
bool CacheObserver::sCacheFSReported = kDefaultCacheFSReported;
static uint32_t const kDefaultMaxShutdownIOLag = 2; // seconds
Atomic<uint32_t, Relaxed> CacheObserver::sMaxShutdownIOLag(kDefaultMaxShutdownIOLag);
@ -327,32 +324,6 @@ CacheObserver::StoreDiskCacheCapacity()
sDiskCacheCapacity);
}
// static
void
CacheObserver::SetCacheFSReported()
{
sCacheFSReported = true;
if (!sSelf) {
return;
}
if (NS_IsMainThread()) {
sSelf->StoreCacheFSReported();
} else {
nsCOMPtr<nsIRunnable> event =
NewRunnableMethod(sSelf, &CacheObserver::StoreCacheFSReported);
NS_DispatchToMainThread(event);
}
}
void
CacheObserver::StoreCacheFSReported()
{
mozilla::Preferences::SetInt("browser.cache.disk.filesystem_reported",
sCacheFSReported);
}
// static
void CacheObserver::ParentDirOverride(nsIFile** aDir)
{

View file

@ -61,9 +61,6 @@ class CacheObserver : public nsIObserver
{ return sHalfLifeExperiment; }
static bool ClearCacheOnShutdown()
{ return sSanitizeOnShutdown && sClearCacheOnShutdown; }
static bool CacheFSReported()
{ return sCacheFSReported; }
static void SetCacheFSReported();
static void ParentDirOverride(nsIFile ** aDir);
static bool EntryIsTooBig(int64_t aSize, bool aUsingDisk);
@ -79,7 +76,6 @@ private:
static CacheObserver* sSelf;
void StoreDiskCacheCapacity();
void StoreCacheFSReported();
void AttachToPreferences();
static uint32_t sUseNewCache;
@ -102,7 +98,6 @@ private:
static int32_t sHalfLifeExperiment;
static bool sSanitizeOnShutdown;
static bool sClearCacheOnShutdown;
static bool sCacheFSReported;
static Atomic<uint32_t, Relaxed> sMaxShutdownIOLag;
static Atomic<PRIntervalTime> sShutdownDemandedTime;

View file

@ -8426,19 +8426,6 @@
"n_values": 7,
"description": "Final status of the CacheFileInputStream (0=ok, 1=other error, 2=out of memory, 3=disk full, 4=file corrupted, 5=file not found, 6=binding aborted)"
},
"NETWORK_CACHE_FS_TYPE": {
"expires_in_version": "42",
"kind": "enumerated",
"n_values": 5,
"description": "Type of FS that the cache is stored on (0=NTFS (Win), 1=FAT32 (Win), 2=FAT (Win), 3=other FS (Win), 4=other OS)"
},
"NETWORK_CACHE_SIZE_FULL_FAT": {
"expires_in_version": "42",
"kind": "linear",
"high": 500,
"n_buckets": 50,
"description": "Size (in MB) of a cache that reached a file count limit"
},
"NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE": {
"expires_in_version": "never",
"kind": "enumerated",

View file

@ -429,14 +429,12 @@
"MOZ_SQLITE_WEBAPPS_WRITE_B",
"MOZ_SQLITE_WEBAPPS_WRITE_MAIN_THREAD_MS",
"MOZ_SQLITE_WEBAPPS_WRITE_MS",
"NETWORK_CACHE_FS_TYPE",
"NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE",
"NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE",
"NETWORK_CACHE_METADATA_FIRST_READ_SIZE",
"NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS",
"NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS",
"NETWORK_CACHE_METADATA_SIZE",
"NETWORK_CACHE_SIZE_FULL_FAT",
"NETWORK_CACHE_V1_HIT_TIME_MS",
"NETWORK_CACHE_V1_MISS_TIME_MS",
"NETWORK_CACHE_V1_TRUNCATE_TIME_MS",
@ -1275,14 +1273,12 @@
"MOZ_SQLITE_WEBAPPS_WRITE_MS",
"MOZ_STORAGE_ASYNC_REQUESTS_MS",
"MOZ_STORAGE_ASYNC_REQUESTS_SUCCESS",
"NETWORK_CACHE_FS_TYPE",
"NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE",
"NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE",
"NETWORK_CACHE_METADATA_FIRST_READ_SIZE",
"NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS",
"NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS",
"NETWORK_CACHE_METADATA_SIZE",
"NETWORK_CACHE_SIZE_FULL_FAT",
"NETWORK_CACHE_V1_HIT_TIME_MS",
"NETWORK_CACHE_V1_MISS_TIME_MS",
"NETWORK_CACHE_V1_TRUNCATE_TIME_MS",