mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 705796 - telemetry data on how often cache is corrupt at startup. r=michal
This commit is contained in:
parent
92a61d5d9e
commit
5e606cdb1f
11
netwerk/cache/nsDiskCacheDevice.cpp
vendored
11
netwerk/cache/nsDiskCacheDevice.cpp
vendored
@ -1020,16 +1020,21 @@ nsDiskCacheDevice::OpenDiskCache()
|
|||||||
// Try opening cache map file.
|
// Try opening cache map file.
|
||||||
rv = mCacheMap.Open(mCacheDirectory);
|
rv = mCacheMap.Open(mCacheDirectory);
|
||||||
// move "corrupt" caches to trash
|
// move "corrupt" caches to trash
|
||||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
Telemetry::Accumulate(Telemetry::DISK_CACHE_CORRUPT, 0);
|
||||||
|
} else if (rv == NS_ERROR_FILE_CORRUPTED) {
|
||||||
|
Telemetry::Accumulate(Telemetry::DISK_CACHE_CORRUPT, 1);
|
||||||
// delay delete by 1 minute to avoid IO thrash at startup
|
// delay delete by 1 minute to avoid IO thrash at startup
|
||||||
rv = nsDeleteDir::DeleteDir(mCacheDirectory, true, 60000);
|
rv = nsDeleteDir::DeleteDir(mCacheDirectory, true, 60000);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
exists = false;
|
exists = false;
|
||||||
}
|
} else {
|
||||||
else if (NS_FAILED(rv))
|
// don't gather telemetry for "corrupt cache" for new profile
|
||||||
|
// where cache doesn't exist (most likely case if we're here).
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if we don't have a cache directory, create one and open it
|
// if we don't have a cache directory, create one and open it
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
|
@ -226,6 +226,7 @@ HISTOGRAM(SPDY_SETTINGS_IW, 1, 1000, 50, EXPONENTIAL, "SPDY: Settings IW (round
|
|||||||
#undef HTTP_HISTOGRAMS
|
#undef HTTP_HISTOGRAMS
|
||||||
|
|
||||||
HISTOGRAM(HTTP_CACHE_DISPOSITION, 1, 5, 5, LINEAR, "HTTP Cache Hit, Reval, Failed-Reval, Miss")
|
HISTOGRAM(HTTP_CACHE_DISPOSITION, 1, 5, 5, LINEAR, "HTTP Cache Hit, Reval, Failed-Reval, Miss")
|
||||||
|
HISTOGRAM(DISK_CACHE_CORRUPT, 0, 1, 2, BOOLEAN, "Was the HTTP disk cache corrupt at startup?")
|
||||||
HISTOGRAM(HTTP_DISK_CACHE_DISPOSITION, 1, 5, 5, LINEAR, "HTTP Disk Cache Hit, Reval, Failed-Reval, Miss")
|
HISTOGRAM(HTTP_DISK_CACHE_DISPOSITION, 1, 5, 5, LINEAR, "HTTP Disk Cache Hit, Reval, Failed-Reval, Miss")
|
||||||
HISTOGRAM(HTTP_MEMORY_CACHE_DISPOSITION, 1, 5, 5, LINEAR, "HTTP Memory Cache Hit, Reval, Failed-Reval, Miss")
|
HISTOGRAM(HTTP_MEMORY_CACHE_DISPOSITION, 1, 5, 5, LINEAR, "HTTP Memory Cache Hit, Reval, Failed-Reval, Miss")
|
||||||
HISTOGRAM(HTTP_OFFLINE_CACHE_DISPOSITION, 1, 5, 5, LINEAR, "HTTP Offline Cache Hit, Reval, Failed-Reval, Miss")
|
HISTOGRAM(HTTP_OFFLINE_CACHE_DISPOSITION, 1, 5, 5, LINEAR, "HTTP Offline Cache Hit, Reval, Failed-Reval, Miss")
|
||||||
|
Loading…
Reference in New Issue
Block a user