Commit 0c55bbd9 authored by falken's avatar falken Committed by Commit bot

Service Worker: Don't record StartWorker metrics for a doomed worker.

This happens a lot because the update check sees the worker is byte-by-byte
identical and then dooms the worker before it finishes starting.

BUG=448003

Review URL: https://codereview.chromium.org/995713002

Cr-Commit-Position: refs/heads/master@{#319854}
parent e27c27c2
...@@ -1554,14 +1554,21 @@ bool ServiceWorkerVersion::HasInflightRequests() const { ...@@ -1554,14 +1554,21 @@ bool ServiceWorkerVersion::HasInflightRequests() const {
void ServiceWorkerVersion::RecordStartWorkerResult( void ServiceWorkerVersion::RecordStartWorkerResult(
ServiceWorkerStatusCode status) { ServiceWorkerStatusCode status) {
base::TimeTicks start_time = start_time_;
ClearTick(&start_time_);
// Failing to start a doomed worker isn't interesting and very common when
// update dooms because the script is byte-to-byte identical.
if (is_doomed_)
return;
UMA_HISTOGRAM_ENUMERATION("ServiceWorker.StartWorker.Status", status, UMA_HISTOGRAM_ENUMERATION("ServiceWorker.StartWorker.Status", status,
SERVICE_WORKER_ERROR_MAX_VALUE); SERVICE_WORKER_ERROR_MAX_VALUE);
if (status == SERVICE_WORKER_OK && !start_time_.is_null()) { if (status == SERVICE_WORKER_OK && !start_time.is_null()) {
UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.StartWorker.Time", UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.StartWorker.Time",
GetTickDuration(start_time_)); GetTickDuration(start_time));
} }
ClearTick(&start_time_);
if (status != SERVICE_WORKER_ERROR_TIMEOUT) if (status != SERVICE_WORKER_ERROR_TIMEOUT)
return; return;
EmbeddedWorkerInstance::StartingPhase phase = EmbeddedWorkerInstance::StartingPhase phase =
......
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