mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1147973 - Detailed disk cache hit rate telemetry is wrong, r=honzab
This commit is contained in:
parent
dc212799b8
commit
6c2133969b
@ -337,6 +337,8 @@ bool CacheEntry::Load(bool aTruncate, bool aPriority)
|
||||
nsAutoCString fileKey;
|
||||
rv = HashingKeyWithStorage(fileKey);
|
||||
|
||||
bool reportMiss = false;
|
||||
|
||||
// Check the index under two conditions for two states and take appropriate action:
|
||||
// 1. When this is a disk entry and not told to truncate, check there is a disk file.
|
||||
// If not, set the 'truncate' flag to true so that this entry will open instantly
|
||||
@ -351,6 +353,9 @@ bool CacheEntry::Load(bool aTruncate, bool aPriority)
|
||||
switch (status) {
|
||||
case CacheIndex::DOES_NOT_EXIST:
|
||||
LOG((" entry doesn't exist according information from the index, truncating"));
|
||||
if (!aTruncate && mUseDisk) {
|
||||
reportMiss = true;
|
||||
}
|
||||
aTruncate = true;
|
||||
break;
|
||||
case CacheIndex::EXISTS:
|
||||
@ -380,6 +385,11 @@ bool CacheEntry::Load(bool aTruncate, bool aPriority)
|
||||
{
|
||||
mozilla::MutexAutoUnlock unlock(mLock);
|
||||
|
||||
if (reportMiss) {
|
||||
CacheFileUtils::DetailedCacheHitTelemetry::AddRecord(
|
||||
CacheFileUtils::DetailedCacheHitTelemetry::MISS, mLoadStart);
|
||||
}
|
||||
|
||||
LOG((" performing load, file=%p", mFile.get()));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = mFile->Init(fileKey,
|
||||
|
Loading…
Reference in New Issue
Block a user