Add call counters to WebView APIs |
|||||||||||
Issue descriptionI think we'll want to create a single enum histogram, with an enum value for each API we want to record. See comments in: https://cs.chromium.org/chromium/src/base/metrics/histogram_macros.h Enum histograms are recommended for counting events. We can add new enum values for new APIs, so long as we never change or re-use existing values. API call counts will probably only make sense in relation to each other. I don't imagine e.g. "loadUrl was called 1 gazillion times globally" would be nearly as useful as "loadUrl is called twice as often as postUrl". So I'm guessing it would be more useful to see these counts in a single histogram (rather than a separate histogram for each API). Also, if we were to have separate histograms, it's not clear what value we should record each time their APIs were hit. Additional info about how APIs are called (e.g. "how often is loadDataWithBaseURL called with historyUrl=null/empty/baseUrl?") will require separate histograms. Caveat: since metrics is native, we won't be able to count APIs which can be called without initializing WebView, or which don't plumb into the WebView implementation, e.g. getCurrentWebViewPackage.
,
Oct 26 2017
Doc is up at: https://goo.gl/dSyEVQ (requires @google.com org, but I can switch it to @chromium.org if requested).
,
Mar 7 2018
I won't have time to work on this for the next couple weeks. It'd be great if another team member could take this up! Otherwise, I'll take this back when I get a spare moment.
,
Mar 8 2018
I can get this started, at least. What was the progress on the spreadsheet of APIs (click through the doc)? here's a WIP CL of the 15 apis marked "yes" on the spreadsheet: crrev.com/c/954351 What sort of investigation is needed to make decisions about the rest of the APIs?
,
Mar 8 2018
I never finished the spreadsheet. I expanded the doc to explain when it's safe to collect metrics for an API. Another way to do the investigation would be to exclude anything which has "@Override" in the WebView class (we probably don't care about View methods we're implementing, only WebView-defined APIs). Another idea: we could break this into multiple UMA histograms (one per frameworks class). We can still make comparisons across histograms (e.g., WebView#loadUrl vs. CookieManager#setCookie), and it might give us a better perspective to answer questions like "how often do apps use the WebView APIs as opposed to CookieManager?"
,
May 11 2018
,
May 23 2018
Sorry for the delay on this! I thought that it might be easier to approach this class-by-class, rather than trying to find an exhaustive set of APIs across webview. It'd still be easy to compare UMA results across different histograms (as Nate mentions in #5). I'm sending out crrev/c/1070529 to add call counters to WebViewChromium.java; I tried to be exhaustive and only exclude callbacks and things related to rendering/input (that will be called very often). Let me know if there's a beter way to approach this.
,
Jun 18 2018
paulmiller@, could you take this over from jamwalla@?
,
Jun 27 2018
,
Sep 24
Moving to available because I think this is a great candidate to Make WebView Better. Anyone should feel free to steal this back.
,
Sep 24
Abandoned first attempt: https://chromium-review.googlesource.com/c/chromium/src/+/1070529
,
Sep 24
,
Nov 30
,
Dec 6
Changwan has a patch: https://chromium-review.googlesource.com/c/chromium/src/+/1343104
,
Dec 13
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1332ecc2ae47eed0da1fcfdb123907abea22009e commit 1332ecc2ae47eed0da1fcfdb123907abea22009e Author: Changwan Ryu <changwan@google.com> Date: Thu Dec 13 01:23:26 2018 Add UMA call counters for APIs in WebViewChromium Add the histogram WebView.ApiCall to count calls to WebView APIs in WebViewChromium.java Bug: 778422 Change-Id: If1ac5e4fbf6ca4f6066beaf66a52a5776280a5be Reviewed-on: https://chromium-review.googlesource.com/c/1343104 Commit-Queue: Changwan Ryu <changwan@chromium.org> Reviewed-by: Bo <boliu@chromium.org> Reviewed-by: Nate Fischer <ntfschr@chromium.org> Reviewed-by: Ilya Sherman <isherman@chromium.org> Cr-Commit-Position: refs/heads/master@{#616146} [modify] https://crrev.com/1332ecc2ae47eed0da1fcfdb123907abea22009e/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java [modify] https://crrev.com/1332ecc2ae47eed0da1fcfdb123907abea22009e/tools/metrics/histograms/enums.xml [modify] https://crrev.com/1332ecc2ae47eed0da1fcfdb123907abea22009e/tools/metrics/histograms/histograms.xml
,
Dec 13
|
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by ntfschr@chromium.org
, Oct 25 2017Status: Assigned (was: Available)