Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 2140513002: Add UMAs for SharedBuffer::lock()/unlock() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reflect comments for histograms.xml Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/Resource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp
index 80db3954dc41028a2b38cbc7b9e64d8d821826b3..da4ad55da5b1c081add729780ce15ac690f786bc 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
@@ -564,6 +564,9 @@ bool Resource::unlock()
if (RuntimeEnabledFeatures::doNotUnlockSharedBufferEnabled())
return false;
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, unlockHistogram, new EnumerationHistogram("Blink.SharedBuffer.Unlock", kLastResourceType));
+ unlockHistogram.count(getType());
+
m_data->unlock();
return true;
}
@@ -986,11 +989,18 @@ bool Resource::lock()
// If locking fails, our buffer has been purged. There's no point
// in leaving a purged resource in MemoryCache.
if (!m_data->lock()) {
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, failedLockHistogram, new EnumerationHistogram("Blink.SharedBuffer.FailedLock", kLastResourceType));
+ failedLockHistogram.count(getType());
+
m_data.clear();
setEncodedSize(0);
memoryCache()->remove(this);
return false;
}
+
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, successfulLockHistogram, new EnumerationHistogram("Blink.SharedBuffer.SuccessfulLock", kLastResourceType));
+ successfulLockHistogram.count(getType());
+
return true;
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698