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

Issue 2706923003: Add UMA for how long service workers run for. (Closed)

Created:
3 years, 10 months ago by falken
Modified:
3 years, 9 months ago
Reviewers:
kinuko, jwd, nhiroki
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, shimazu+serviceworker_chromium.org, serviceworker-reviews, jam, kinuko+serviceworker, horo+watch_chromium.org, darin-cc_chromium.org, kinuko+watch, tzik, blink-worker-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add UMA for how long service workers run for. We don't have any UMA for how long a SW stays alive, so this is a step toward fixing that. This adds UMA: * ServiceWorker.Runtime - How long the worker ran for (wall time). Recorded when a service worker stops. Ideally we'd additionally like to know 1) about SW's that never stop, and 2) why a SW stays alive particularly if it's for a long time, and also be able to distinguish valid use from abusive use, but there's some complexity there so we're starting simple. BUG=683047 Review-Url: https://codereview.chromium.org/2706923003 Cr-Commit-Position: refs/heads/master@{#457669} Committed: https://chromium.googlesource.com/chromium/src/+/f93cb21f636207e7f0573bf99681bfce4951e0f7

Patch Set 1 #

Patch Set 2 : simplify #

Patch Set 3 : simplify #

Patch Set 4 : rm unneeded change #

Patch Set 5 : tweaks #

Patch Set 6 : constexpr #

Total comments: 17

Patch Set 7 : comments #

Total comments: 2

Patch Set 8 : move to embeddedworkerregistsry #

Patch Set 9 : rebase #

Total comments: 2

Patch Set 10 : simplify! #

Patch Set 11 : reflect comments #

Patch Set 12 : tweaks, fmt #

Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -3 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/embedded_worker_instance.cc View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/embedded_worker_registry.h View 1 2 3 4 5 6 7 3 chunks +5 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_registry.cc View 1 2 3 4 5 6 7 4 chunks +7 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_lifetime_tracker.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +51 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_lifetime_tracker.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +45 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_lifetime_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +78 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_metrics.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_metrics.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +15 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (25 generated)
falken
ptal
3 years, 10 months ago (2017-02-23 04:28:23 UTC) #6
nhiroki
https://codereview.chromium.org/2706923003/diff/90001/content/browser/service_worker/service_worker_context_core.h File content/browser/service_worker/service_worker_context_core.h (right): https://codereview.chromium.org/2706923003/diff/90001/content/browser/service_worker/service_worker_context_core.h#newcode316 content/browser/service_worker/service_worker_context_core.h:316: struct RunningInfo { Who uses this? https://codereview.chromium.org/2706923003/diff/90001/content/browser/service_worker/service_worker_lifetime_tracker.cc File content/browser/service_worker/service_worker_lifetime_tracker.cc ...
3 years, 10 months ago (2017-02-23 07:54:24 UTC) #9
falken
Thanks! https://codereview.chromium.org/2706923003/diff/90001/content/browser/service_worker/service_worker_context_core.h File content/browser/service_worker/service_worker_context_core.h (right): https://codereview.chromium.org/2706923003/diff/90001/content/browser/service_worker/service_worker_context_core.h#newcode316 content/browser/service_worker/service_worker_context_core.h:316: struct RunningInfo { On 2017/02/23 07:54:23, nhiroki wrote: ...
3 years, 10 months ago (2017-02-23 08:18:18 UTC) #10
nhiroki
lgtm https://codereview.chromium.org/2706923003/diff/90001/content/browser/service_worker/service_worker_metrics.cc File content/browser/service_worker/service_worker_metrics.cc (right): https://codereview.chromium.org/2706923003/diff/90001/content/browser/service_worker/service_worker_metrics.cc#newcode982 content/browser/service_worker/service_worker_metrics.cc:982: UMA_HISTOGRAM_LONG_TIMES("ServiceWorker.Runtime", time); On 2017/02/23 08:18:18, falken wrote: > ...
3 years, 10 months ago (2017-02-23 09:05:06 UTC) #15
falken
https://codereview.chromium.org/2706923003/diff/110001/content/browser/service_worker/service_worker_context_core.cc File content/browser/service_worker/service_worker_context_core.cc (right): https://codereview.chromium.org/2706923003/diff/110001/content/browser/service_worker/service_worker_context_core.cc#newcode763 content/browser/service_worker/service_worker_context_core.cc:763: } Hm it looks like I should just add ...
3 years, 10 months ago (2017-02-24 08:32:26 UTC) #16
falken
updated. I tried making the tracking based on ServiceWorkerContextObserver but that turns out complex because ...
3 years, 9 months ago (2017-02-27 07:47:12 UTC) #21
falken
ping :)
3 years, 9 months ago (2017-02-28 08:01:12 UTC) #22
nhiroki
On 2017/02/28 08:01:12, falken wrote: > ping :) Sorry, I missed this. Now reviewing...
3 years, 9 months ago (2017-02-28 08:28:11 UTC) #23
nhiroki
lgtm with nits https://codereview.chromium.org/2706923003/diff/150001/content/browser/service_worker/service_worker_lifetime_tracker.h File content/browser/service_worker/service_worker_lifetime_tracker.h (right): https://codereview.chromium.org/2706923003/diff/150001/content/browser/service_worker/service_worker_lifetime_tracker.h#newcode29 content/browser/service_worker/service_worker_lifetime_tracker.h:29: void StartTiming(int64_t version_id); Can you replace ...
3 years, 9 months ago (2017-02-28 08:50:08 UTC) #24
falken
ptal I removed the StillRunningTime because testing locally revealed it would give really hard to ...
3 years, 9 months ago (2017-03-16 05:57:02 UTC) #28
nhiroki
lgtm
3 years, 9 months ago (2017-03-16 07:12:23 UTC) #31
falken
jwd: can you review histograms? Notably, this is using a HISTOGRAM_CUSTOM_TIMES macro to better fit ...
3 years, 9 months ago (2017-03-16 07:29:08 UTC) #33
jwd
lgtm
3 years, 9 months ago (2017-03-16 16:30:17 UTC) #34
falken
+kinuko for content/browser/BUILD.gn
3 years, 9 months ago (2017-03-17 01:25:15 UTC) #36
kinuko
lgtm
3 years, 9 months ago (2017-03-17 01:28:47 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2706923003/210001
3 years, 9 months ago (2017-03-17 01:31:41 UTC) #39
commit-bot: I haz the power
3 years, 9 months ago (2017-03-17 03:07:13 UTC) #42
Message was sent while issue was closed.
Committed patchset #12 (id:210001) as
https://chromium.googlesource.com/chromium/src/+/f93cb21f636207e7f0573bf99681...

Powered by Google App Engine
This is Rietveld 408576698