Commit 3616a430 authored by falken's avatar falken Committed by Commit bot

Remove Render.Workers.MaxWorkerCountInRendererProcess UMA.

This UMA and code is misleading because the shared worker ref count in
RenderProcessHostImpl actually is not the number of running shared
workers. We've added comments since that clarify it.

If we want this UMA back we can add a new one later. I'll add current
stats to the bug.

BUG=403258

Review-Url: https://codereview.chromium.org/2607513002
Cr-Commit-Position: refs/heads/master@{#440951}
parent 0a23e5ae
...@@ -683,7 +683,6 @@ RenderProcessHostImpl::RenderProcessHostImpl( ...@@ -683,7 +683,6 @@ RenderProcessHostImpl::RenderProcessHostImpl(
#if BUILDFLAG(ENABLE_WEBRTC) #if BUILDFLAG(ENABLE_WEBRTC)
webrtc_eventlog_host_(id_), webrtc_eventlog_host_(id_),
#endif #endif
max_worker_count_(0),
permission_service_context_(new PermissionServiceContext(this)), permission_service_context_(new PermissionServiceContext(this)),
channel_connected_(false), channel_connected_(false),
sent_render_process_ready_(false), sent_render_process_ready_(false),
...@@ -1388,8 +1387,6 @@ void RenderProcessHostImpl::IncrementServiceWorkerRefCount() { ...@@ -1388,8 +1387,6 @@ void RenderProcessHostImpl::IncrementServiceWorkerRefCount() {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!is_worker_ref_count_disabled_); DCHECK(!is_worker_ref_count_disabled_);
++service_worker_ref_count_; ++service_worker_ref_count_;
if (GetWorkerRefCount() > max_worker_count_)
max_worker_count_ = GetWorkerRefCount();
} }
void RenderProcessHostImpl::DecrementServiceWorkerRefCount() { void RenderProcessHostImpl::DecrementServiceWorkerRefCount() {
...@@ -1405,8 +1402,6 @@ void RenderProcessHostImpl::IncrementSharedWorkerRefCount() { ...@@ -1405,8 +1402,6 @@ void RenderProcessHostImpl::IncrementSharedWorkerRefCount() {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!is_worker_ref_count_disabled_); DCHECK(!is_worker_ref_count_disabled_);
++shared_worker_ref_count_; ++shared_worker_ref_count_;
if (GetWorkerRefCount() > max_worker_count_)
max_worker_count_ = GetWorkerRefCount();
} }
void RenderProcessHostImpl::DecrementSharedWorkerRefCount() { void RenderProcessHostImpl::DecrementSharedWorkerRefCount() {
...@@ -2144,13 +2139,6 @@ void RenderProcessHostImpl::Cleanup() { ...@@ -2144,13 +2139,6 @@ void RenderProcessHostImpl::Cleanup() {
base::TimeTicks::Now() - survive_for_worker_start_time_); base::TimeTicks::Now() - survive_for_worker_start_time_);
} }
if (max_worker_count_ > 0) {
// Record the max number of workers (SharedWorker or ServiceWorker)
// that are simultaneously hosted in this renderer process.
UMA_HISTOGRAM_COUNTS("Render.Workers.MaxWorkerCountInRendererProcess",
max_worker_count_);
}
// We cannot clean up twice; if this fails, there is an issue with our // We cannot clean up twice; if this fails, there is an issue with our
// control flow. // control flow.
DCHECK(!deleting_soon_); DCHECK(!deleting_soon_);
......
...@@ -423,7 +423,11 @@ class CONTENT_EXPORT RenderProcessHostImpl ...@@ -423,7 +423,11 @@ class CONTENT_EXPORT RenderProcessHostImpl
scoped_refptr<ConnectionFilterController> connection_filter_controller_; scoped_refptr<ConnectionFilterController> connection_filter_controller_;
service_manager::mojom::ServicePtr test_service_; service_manager::mojom::ServicePtr test_service_;
// The number of service workers running in this process.
size_t service_worker_ref_count_; size_t service_worker_ref_count_;
// See comments for IncrementSharedWorkerRefCount() and
// DecrementSharedWorkerRefCount(). This is more like a boolean flag and not
// actually the number of shared workers running in this process.
size_t shared_worker_ref_count_; size_t shared_worker_ref_count_;
// Set in ForceReleaseWorkerRefCounts. When true, worker ref counts must no // Set in ForceReleaseWorkerRefCounts. When true, worker ref counts must no
...@@ -553,10 +557,6 @@ class CONTENT_EXPORT RenderProcessHostImpl ...@@ -553,10 +557,6 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Records the time when the process starts surviving for workers for UMA. // Records the time when the process starts surviving for workers for UMA.
base::TimeTicks survive_for_worker_start_time_; base::TimeTicks survive_for_worker_start_time_;
// Records the maximum # of workers simultaneously hosted in this process
// for UMA.
size_t max_worker_count_;
// Context shared for each mojom::PermissionService instance created for this // Context shared for each mojom::PermissionService instance created for this
// RPH. // RPH.
std::unique_ptr<PermissionServiceContext> permission_service_context_; std::unique_ptr<PermissionServiceContext> permission_service_context_;
......
...@@ -313,19 +313,17 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::Sender, ...@@ -313,19 +313,17 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::Sender,
virtual void IncrementServiceWorkerRefCount() = 0; virtual void IncrementServiceWorkerRefCount() = 0;
virtual void DecrementServiceWorkerRefCount() = 0; virtual void DecrementServiceWorkerRefCount() = 0;
// Called when the existence of the other renderer process which is connected // The shared worker ref count is non-zero if any other process is connected
// to the Worker in this renderer process has changed. // to a shared worker in this process, or a new shared worker is being created
// in this process.
// The shared worker ref count is nonzero if any other process is connected to // IncrementSharedWorkerRefCount is called in two cases:
// a shared worker in this process, or a new shared worker is being created in
// this process. IncrementSharedWorkerRefCount is called in two cases:
// - there was no external renderer connected to a shared worker in this // - there was no external renderer connected to a shared worker in this
// process, and now there is at least one // process, and now there is at least one
// - a new worker is being created in this process. // - a new worker is being created in this process.
// DecrementSharedWorkerRefCount is called in two cases: // DecrementSharedWorkerRefCount is called in two cases:
// - there was an external renderer connected to a shared worker in this // - there was an external renderer connected to a shared worker in this
// process, and now there is none // process, and now there is none
// - a new worker finished being created in this process // - a new worker finished being created in this process.
virtual void IncrementSharedWorkerRefCount() = 0; virtual void IncrementSharedWorkerRefCount() = 0;
virtual void DecrementSharedWorkerRefCount() = 0; virtual void DecrementSharedWorkerRefCount() = 0;
......
...@@ -51667,6 +51667,13 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -51667,6 +51667,13 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</histogram> </histogram>
<histogram name="Render.Workers.MaxWorkerCountInRendererProcess"> <histogram name="Render.Workers.MaxWorkerCountInRendererProcess">
<obsolete>
Deprecated Dec 2016. This metric did not report the number of shared workers
correctly, since it used the RenderProcessHostImpl ref counts, which in the
shared worker case is more like a boolean flag (zero or one or maybe two)
than the number of shared workers. So its results can be thought of as
roughly the number of service workers only.
</obsolete>
<owner>kinuko@chromium.org</owner> <owner>kinuko@chromium.org</owner>
<summary> <summary>
Maximum number of workers (SharedWorker or ServiceWorker) that are Maximum number of workers (SharedWorker or ServiceWorker) that are
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment