Skip to content

Commit

Permalink
ServiceWorker: Add UMA to track the execution time of onmessage event
Browse files Browse the repository at this point in the history
BUG=407997
TEST=N/A

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

Cr-Commit-Position: refs/heads/master@{#297957}
  • Loading branch information
makotoshimazu authored and Commit bot committed Oct 3, 2014
1 parent 05b6445 commit 20894f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,13 @@ void ServiceWorkerScriptContext::OnPostMessage(
}
}

// dispatchMessageEvent is expected to execute onmessage function
// synchronously.
base::TimeTicks before = base::TimeTicks::Now();
proxy_->dispatchMessageEvent(message, ports);
UMA_HISTOGRAM_TIMES(
"ServiceWorker.MessageEventExecutionTime",
base::TimeTicks::Now() - before);
}

void ServiceWorkerScriptContext::OnDidGetClientDocuments(
Expand Down
5 changes: 5 additions & 0 deletions tools/metrics/histograms/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29506,6 +29506,11 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<summary>Execution time of ServiceWorkerGlobalScope.oninstall.</summary>
</histogram>

<histogram name="ServiceWorker.MessageEventExecutionTime" units="millisecond">
<owner>shimazu@chromium.org</owner>
<summary>Execution time of ServiceWorkerGlobalScope.onmessage.</summary>
</histogram>

<histogram name="ServiceWorker.ScriptSize" units="bytes">
<owner>ksakamoto@chromium.org</owner>
<summary>
Expand Down

0 comments on commit 20894f5

Please sign in to comment.