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

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: 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
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 20b69e38de6bd385ea801e11c98a8aafe177faef..20691353bf0ef31b5719e3deb64a3a1d27647b33 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", Manifest + 1));
bashi 2016/07/11 08:02:27 nit: does it make sense to change the name of metr
hiroshige 2016/07/11 08:15:58 I also considered that option, but I names Blink.S
bashi 2016/07/11 08:23:22 I see. Thanks for the explanation.
Ilya Sherman 2016/07/11 19:28:33 Please document (in the header file, where the enu
hiroshige 2016/07/12 10:06:29 Done.
+ 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", Manifest + 1));
Ilya Sherman 2016/07/11 19:28:33 Using "Manifest + 1" as a boundary value is a bit
hiroshige 2016/07/12 10:06:29 Added |kLastResourceType|. I avoid adding |Last|
+ 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", Manifest + 1));
+ successfulLockHistogram.count(getType());
+
return true;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698