|
|
Created:
7 years, 5 months ago by bolian Modified:
7 years, 4 months ago Reviewers:
jar (doing other things), Lei Zhang, asvitkine_google, Ted C, bengr, Ilya Sherman, mmenke CC:
chromium-reviews, cbentzel+watch_chromium.org, jar (doing other things) Base URL:
https://chromium.googlesource.com/chromium/src.git@master Visibility:
Public. |
DescriptionAdded UMA metrics for daily data reduction.
BUG=226138
isherman: for histogram.xml.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=216224
Patch Set 1 #Patch Set 2 : Updated histograms.xml #Patch Set 3 : . #Patch Set 4 : . #Patch Set 5 : . #
Total comments: 28
Patch Set 6 : 'Addressed some comments (not done)' #
Total comments: 16
Patch Set 7 : Address comments. #
Total comments: 17
Patch Set 8 : Revision on comments. #
Total comments: 14
Patch Set 9 : mmenke's comments #Patch Set 10 : lint #
Total comments: 9
Patch Set 11 : bengr comments. #
Total comments: 4
Patch Set 12 : Record bytes in KB #Patch Set 13 : . #
Total comments: 2
Patch Set 14 : s/KBytes/KB in histograms.xml #Patch Set 15 : s/KBytes/KB #
Total comments: 3
Messages
Total messages: 40 (0 generated)
Hello Ben, Jim, and Matt, Please take a look at this UMA CL for bytes saving stats. Thanks, Bolian
On 2013/07/25 00:33:48, bolian wrote: > Hello Ben, Jim, and Matt, > > Please take a look at this UMA CL for bytes saving stats. > > Thanks, > Bolian Just a heads up that I'm taking two days off - Happy to review Monday.
If you add defined(OS_IOS), please verify that the reporting is correct for IOS. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:233: int64 ListPrefInt64Value(ListPrefUpdate& list_update, size_t index) { I don't remember why I didn't do it in AddInt64ToListPref, but list_update should really be passed in as a pointer, since it's being modified. We really shouldn't be using non-const references. If you make a change here, could you also change AddInt64ToListPref? https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:235: if(!list_update->GetString(index, &value)) return -1; I don't think you'll ever want to report -1 as a daily size. I think you have two options, return 0 if there's no entry, or return success and write the size as a parameter. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:244: if (list_update->GetSize() == 0) return; Why are all of these guarded on this condition? Is this to prevent reporting on the previous day on the first time chrome is used? If so, can we just have the caller of all these functions do that check once? https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:262: original_update, original_update->GetSize() - 1); remove space between '...update,' and 'original...' https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:263: UMA_HISTOGRAM_COUNTS("Net.DailyHttpOriginalContentLength", ocl); If you change ListPrefInt64Value to return 0 on a failed lookup, then I'd get rid of the local variable, e.g.: UMA_HISTOGRAM_COUNTS("Net.DailyHttpOriginalContentLength", ListPrefInt64Value( original_update, original_update->GetSize() - 1)); I'd repeat this pattern everywhere. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:286: DCHECK(ocl >= rcl); This isn't always true, so I wouldn't DCHECK. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:288: "Net.DailyHttpContentSavingPercentage", (100 * (ocl - rcl)) / ocl); We say the savings is 0 if ocl is < rcl, so you can either use that logic here too (preferred), or report negative percents. If you set all negative savings to 0, then add that to the histogram description. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/common/pref_... File chrome/common/pref_names.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/common/pref_... chrome/common/pref_names.cc:2025: // Note: this is different than "Note this is different from kDaily..., because content doesn't necessarily go through the data reduction proxy when it is enabled. E.g., the proxy doesn't handle HTTPS traffic." https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/common/pref_... File chrome/common/pref_names.h (right): https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/common/pref_... chrome/common/pref_names.h:809: extern const char kDailyHttpReceivedContentLengthDataReductionProxyEnabled[]; Is there any way to shrink the name of this constant? I can't think of any good ways. E.g., "DailyHttpReceivedContentLength" --> "DailyContentReceived." https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... File tools/metrics/histograms/histograms.xml (right): https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5677: <histogram name="Net.DailyHttpContentSavingPercentage" units="bytes"> Units shouldn't be 'bytes' on all the 'Percentage' UMA. Since the units should tell us that this is a percentage, you could rename as "Net.DailyHttpContentDataReductionProxySavings". Be sure to add "DataReductionProxy" somewhere in the name. Also we should probably create a UMA category called "DataReductionProxy" for all such UMA. E.g., this UMA would be: "DataReductionProxy.DailyHttpContentSavings" https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5681: <histogram name="Net.DailyHttpContentSavingPercentage_DataReductionProxy" Change units and remove "percentage" from the description if it is obvious from the units. https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5684: The percentage of data saving in the previous calendar day when the data This seems like overkill. I think what we want is: 1) some UMA that tells us what fraction of users have the proxy enabled. This we can get by looking at the count of something not conditioned on the proxy being in use (e.g., Net.DailyHttpReceivedContentLength) and the count of something conditioned on the proxy being in use (e.g. "Net.DailyHttpContentLengthViaDataReductionProxy"). 2) a distribution of savings for users of the proxy. This we get from Net.DailyHttpContentSavingsPercentage. This we get from Net.DailyHttpContentDataReductionProxySavings. https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5703: <histogram name="Net.DailyReceivedContentDataReductionProxyEnabledPercentage" Change units and remove "percentage" from the description if it is obvious from the units. https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5711: <histogram name="Net.DailyReceivedContentViaDataReductionProxyPercentage" Change units and remove "percentage" from the description if it is obvious from the units.
https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:235: if(!list_update->GetString(index, &value)) return -1; returning 0 now. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:244: if (list_update->GetSize() == 0) return; This function is now removed. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:262: original_update, original_update->GetSize() - 1); On 2013/07/26 19:17:05, bengr1 wrote: > remove space between '...update,' and 'original...' Done. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:263: UMA_HISTOGRAM_COUNTS("Net.DailyHttpOriginalContentLength", ocl); I need the var to calculate percent later. But I can remove the if. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:286: DCHECK(ocl >= rcl); On 2013/07/26 19:17:05, bengr1 wrote: > This isn't always true, so I wouldn't DCHECK. Done. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:288: "Net.DailyHttpContentSavingPercentage", (100 * (ocl - rcl)) / ocl); I keep negative and add it that to description. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/common/pref_... File chrome/common/pref_names.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/common/pref_... chrome/common/pref_names.cc:2025: // Note: this is different than Done. Thanks. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/common/pref_... File chrome/common/pref_names.h (right): https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/common/pref_... chrome/common/pref_names.h:809: extern const char kDailyHttpReceivedContentLengthDataReductionProxyEnabled[]; This looks still fits now, so I prefer keeping it consistent with old names for now. https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... File tools/metrics/histograms/histograms.xml (right): https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5677: <histogram name="Net.DailyHttpContentSavingPercentage" units="bytes"> Done with renaming and fix units https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5681: <histogram name="Net.DailyHttpContentSavingPercentage_DataReductionProxy" On 2013/07/26 19:17:05, bengr1 wrote: > Change units and remove "percentage" from the description if it is obvious from > the units. Done. https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5684: The percentage of data saving in the previous calendar day when the data I think we want this because this is the actual saving users can see when they enable the data reduction proxy. https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5703: <histogram name="Net.DailyReceivedContentDataReductionProxyEnabledPercentage" On 2013/07/26 19:17:05, bengr1 wrote: > Change units and remove "percentage" from the description if it is obvious from > the units. Done. https://chromiumcodereview.appspot.com/19656006/diff/9001/tools/metrics/histo... tools/metrics/histograms/histograms.xml:5711: <histogram name="Net.DailyReceivedContentViaDataReductionProxyPercentage" On 2013/07/26 19:17:05, bengr1 wrote: > Change units and remove "percentage" from the description if it is obvious from > the units. Done.
Just a couple very quick nits. https://codereview.chromium.org/19656006/diff/20001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/20001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:234: std::string value; nit: Just to be consistent with the above function, suggest using "string_value" for the string, and "value" for the int64. https://codereview.chromium.org/19656006/diff/20001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:235: if(!list_update->GetString(index, &value)) return 0; nit: Space after if. https://codereview.chromium.org/19656006/diff/20001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:235: if(!list_update->GetString(index, &value)) return 0; nit: "return 0;" should go its own line. https://codereview.chromium.org/19656006/diff/20001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:245: ListPrefUpdate& drp_enabled_update, ListPrefUpdate& via_drp_update) { Google style prohibits uncommon abbreviations. I have no idea what a drp is, or via_drp_update is. Also not sure what the others mean, for that matter. https://codereview.chromium.org/19656006/diff/20001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:245: ListPrefUpdate& drp_enabled_update, ListPrefUpdate& via_drp_update) { You generally should not pass by reference like this. If things aren't modified (As is the case here), they should be const &. If they are modified, they should be passed as pointers. https://codereview.chromium.org/19656006/diff/20001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:247: int64 ocl = ListPrefInt64Value( Again, no clue what ocl or rcl are. https://codereview.chromium.org/19656006/diff/20001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:275: DCHECK(rcl >= drp_enabled_rcl); nit: DCHECK_GE is preferred. https://codereview.chromium.org/19656006/diff/20001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:281: DCHECK(rcl >= via_drp_rcl); nit: DCHECK_GE is preferred.
Thanks. Ptal. https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/9001/chrome/browser/net/... chrome/browser/net/chrome_network_delegate.cc:233: int64 ListPrefInt64Value(ListPrefUpdate& list_update, size_t index) { On 2013/07/26 19:17:05, bengr1 wrote: > I don't remember why I didn't do it in AddInt64ToListPref, but list_update > should really be passed in as a pointer, since it's being modified. We really > shouldn't be using non-const references. If you make a change here, could you > also change AddInt64ToListPref? Done. https://chromiumcodereview.appspot.com/19656006/diff/20001/chrome/browser/net... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/20001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:234: std::string value; On 2013/07/29 18:58:30, mmenke wrote: > nit: Just to be consistent with the above function, suggest using > "string_value" for the string, and "value" for the int64. Done. https://chromiumcodereview.appspot.com/19656006/diff/20001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:235: if(!list_update->GetString(index, &value)) return 0; On 2013/07/29 18:58:30, mmenke wrote: > nit: Space after if. Done. https://chromiumcodereview.appspot.com/19656006/diff/20001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:235: if(!list_update->GetString(index, &value)) return 0; On 2013/07/29 18:58:30, mmenke wrote: > nit: "return 0;" should go its own line. Done. https://chromiumcodereview.appspot.com/19656006/diff/20001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:245: ListPrefUpdate& drp_enabled_update, ListPrefUpdate& via_drp_update) { On 2013/07/29 18:58:30, mmenke wrote: > Google style prohibits uncommon abbreviations. I have no idea what a drp is, or > via_drp_update is. Also not sure what the others mean, for that matter. Done. https://chromiumcodereview.appspot.com/19656006/diff/20001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:245: ListPrefUpdate& drp_enabled_update, ListPrefUpdate& via_drp_update) { On 2013/07/29 18:58:30, mmenke wrote: > You generally should not pass by reference like this. If things aren't modified > (As is the case here), they should be const &. If they are modified, they > should be passed as pointers. Done. https://chromiumcodereview.appspot.com/19656006/diff/20001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:247: int64 ocl = ListPrefInt64Value( On 2013/07/29 18:58:30, mmenke wrote: > Again, no clue what ocl or rcl are. Done. https://chromiumcodereview.appspot.com/19656006/diff/20001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:275: DCHECK(rcl >= drp_enabled_rcl); On 2013/07/29 18:58:30, mmenke wrote: > nit: DCHECK_GE is preferred. Done. https://chromiumcodereview.appspot.com/19656006/diff/20001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:281: DCHECK(rcl >= via_drp_rcl); On 2013/07/29 18:58:30, mmenke wrote: > nit: DCHECK_GE is preferred. Done.
https://codereview.chromium.org/19656006/diff/28001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/19656006/diff/28001/chrome/browser/io_thread.... chrome/browser/io_thread.cc:804: registry->RegisterBooleanPref(prefs::kSpdyProxyAuthEnabled, false); Why is this pref now being registered here? https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:259: int data_reduction_enabled_received_content_length = Why not have the variable mirror the UMA name? E.g., "daily_http_content_length_data_reduction_proxy_enabled" for "Net.DailyHttpContentLengthDataReductionProxyEnabled" I suppose you could shorten the variable to be: "content_length_data_reduction_enabled" Also, I like "With" and "with_" being inserted before "DataReduction" and "data_reduction" https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:266: int via_data_reduction_received_content_length = ListPrefInt64Value( See above comment. At the very least, swap "received_content_length" and "via_data_reduction" https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:273: UMA_HISTOGRAM_PERCENTAGE( I don't think you can use UMA_HISTOGRAM_PERCENTAGE with negative percentages. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:280: (100 * (original_content_length - received_content_length)) / See above. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:383: if (days_since_last_update == 1) { I don't think this is right. What if I use Chrome on day 0 and on day 2. On day 2 I will not report day 0's data since days_sinec_last_update != 1. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:703: "via", "1.1 Chrome Compression Proxy"); page_load_histograms.cc defines constants for this header name and value. It would be good to put these in some common place so both can use. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.h (right): https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.h:170: int64 received_payload_byte_count, int64 original_payload_byte_count, nit: move 'int64 original_payload_byte_count' to new line. https://codereview.chromium.org/19656006/diff/28001/chrome/common/pref_names.cc File chrome/common/pref_names.cc (right): https://codereview.chromium.org/19656006/diff/28001/chrome/common/pref_names.... chrome/common/pref_names.cc:2029: const char kDailyHttpReceivedContentLengthDataReductionProxyEnabled[] = I'd change the names to: kDailyHttpReceivedContentLengthWithDataReductionProxyEnabled and "data_reduction.daily_received_length_with_data_reduction_proxy_enabled"
Thanks, ptal. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/19656006/diff/28001/chrome/browser/io_thread.... chrome/browser/io_thread.cc:804: registry->RegisterBooleanPref(prefs::kSpdyProxyAuthEnabled, false); I thought all referenced prefs are registered here. Where should I register it? https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:259: int data_reduction_enabled_received_content_length = On 2013/07/30 21:14:04, bengr1 wrote: > Why not have the variable mirror the UMA name? E.g., > "daily_http_content_length_data_reduction_proxy_enabled" > for "Net.DailyHttpContentLengthDataReductionProxyEnabled" > > I suppose you could shorten the variable to be: > > "content_length_data_reduction_enabled" > > Also, I like "With" and "with_" being inserted before "DataReduction" and > "data_reduction" Done. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:266: int via_data_reduction_received_content_length = ListPrefInt64Value( On 2013/07/30 21:14:04, bengr1 wrote: > See above comment. At the very least, swap "received_content_length" and > "via_data_reduction" Done. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:273: UMA_HISTOGRAM_PERCENTAGE( Yes, you are correct. Capped at 0. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:280: (100 * (original_content_length - received_content_length)) / On 2013/07/30 21:14:04, bengr1 wrote: > See above. Done. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:383: if (days_since_last_update == 1) { As we chatted, my assumption here is that we'll use the UMA report timestamp to refer the the usage of previous day. But we will lose some data. But I feel losing part of data might be fine if we still end up with "enough" samples. https://codereview.chromium.org/19656006/diff/28001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:703: "via", "1.1 Chrome Compression Proxy"); I can add a chrome/common/data_reduction_constants.h/cc for this. Will that be an overkill? https://codereview.chromium.org/19656006/diff/28001/chrome/common/pref_names.cc File chrome/common/pref_names.cc (right): https://codereview.chromium.org/19656006/diff/28001/chrome/common/pref_names.... chrome/common/pref_names.cc:2029: const char kDailyHttpReceivedContentLengthDataReductionProxyEnabled[] = On 2013/07/30 21:14:04, bengr1 wrote: > I'd change the names to: > kDailyHttpReceivedContentLengthWithDataReductionProxyEnabled and > > > "data_reduction.daily_received_length_with_data_reduction_proxy_enabled" Done.
https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:244: void UmaDailyContentLength( Function names should generally be verbs or verb phrases, with the possible exception of accessors. Maybe RecordDailyContentLengthHistograms? https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:248: const base::ListValue& via_data_reduction_update) { I think we should just pass these in as int64, calling ListPrefInt64Value in the call to this function. Makes for much easier to read code to have all the calls together, rather than interspersed with histograms. Also removes knowledge of the original storage format from this function, which it doesn't need, and is non-obvious. Can also replace the "update" in the names with "content_length" or just "length", which also makes this function clearer. Suggest replacing "update" in all of these names with "length". Think it makes this much clearer. https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:386: if (days_since_last_update == 1) { So if Chrome isn't run for a day, we never record histograms? There are, admittedly, problems with recording histograms after the data is stale, just wonder if you've looked into this. https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:408: while (original_update->GetSize() > kNumDaysInHistory) data_reduction_enabled_update->GetSize(). Lack of tests of this code makes it easy to make this sort of mistake. :( https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:410: while (original_update->GetSize() > kNumDaysInHistory) via_data_reduction_update https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:426: GetPrefs()->GetBoolean(prefs::kSpdyProxyAuthEnabled)) { nit: When you cross lines with a non-boolean operator like this, I think indenting the next line by 4 more than this makes it clearer that it's continued from the previous line.
https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:248: const base::ListValue& via_data_reduction_update) { On 2013/07/31 14:59:32, mmenke wrote: > I think we should just pass these in as int64, calling ListPrefInt64Value in the > call to this function. Makes for much easier to read code to have all the calls > together, rather than interspersed with histograms. Also removes knowledge of > the original storage format from this function, which it doesn't need, and is > non-obvious. > > Can also replace the "update" in the names with "content_length" or just > "length", which also makes this function clearer. > > Suggest replacing "update" in all of these names with "length". Think it makes > this much clearer. (Ignore the last sentence, forgot to delete it before publishing comments)
Thank you! Please take another look. https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:244: void UmaDailyContentLength( On 2013/07/31 14:59:32, mmenke wrote: > Function names should generally be verbs or verb phrases, with the possible > exception of accessors. Maybe RecordDailyContentLengthHistograms? Done. https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:248: const base::ListValue& via_data_reduction_update) { Done. Yes, I think this looks much better. Thanks! https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:248: const base::ListValue& via_data_reduction_update) { On 2013/07/31 15:03:00, mmenke wrote: > On 2013/07/31 14:59:32, mmenke wrote: > > I think we should just pass these in as int64, calling ListPrefInt64Value in > the > > call to this function. Makes for much easier to read code to have all the > calls > > together, rather than interspersed with histograms. Also removes knowledge of > > the original storage format from this function, which it doesn't need, and is > > non-obvious. > > > > Can also replace the "update" in the names with "content_length" or just > > "length", which also makes this function clearer. > > > > Suggest replacing "update" in all of these names with "length". Think it > makes > > this much clearer. > > (Ignore the last sentence, forgot to delete it before publishing comments) Done. https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:386: if (days_since_last_update == 1) { Yes, Ben and I chatted about this. I prefer collecting less data but the data are associated with an accurate date. So that when we look at UMA data reported 7/30, we know it is allfor daily usage on 7/29. The alternative is to report previous unreported data, but then we don't have a clear idea what date the usage is and we can associate it with some events, like new versions, etc (unless we can overwrite the timestamp for the data point, is that possbile?). Added comments for that. https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:408: while (original_update->GetSize() > kNumDaysInHistory) Done. Yes :(. It seems we don't have unite tests for UMA in general. https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:410: while (original_update->GetSize() > kNumDaysInHistory) On 2013/07/31 14:59:32, mmenke wrote: > via_data_reduction_update Done. https://chromiumcodereview.appspot.com/19656006/diff/35001/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:426: GetPrefs()->GetBoolean(prefs::kSpdyProxyAuthEnabled)) { Done.
LGTM https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:275: (100 * length_with_data_reduction_enabled) / received_length); Given any thought to whether we should be recording original length or received length here? I'm not really sure, just curious if you've thought about it.
On 2013/08/02 15:56:40, mmenke wrote: > LGTM > > https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... > File chrome/browser/net/chrome_network_delegate.cc (right): > > https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... > chrome/browser/net/chrome_network_delegate.cc:275: (100 * > length_with_data_reduction_enabled) / received_length); > Given any thought to whether we should be recording original length or received > length here? I'm not really sure, just curious if you've thought about it. browser/net LGTM rather, didn't review the rest of the code.
Thanks! https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:275: (100 * length_with_data_reduction_enabled) / received_length); Yes, received length is what we talked about recording here( and below), because we want to know whether user enable data reduction for whole day or part of the day (and below, how much traffic actually go through the proxy). This information can give us more sense when looking at the reported saving percent above.
https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:275: (100 * length_with_data_reduction_enabled) / received_length); replied above.
https://codereview.chromium.org/19656006/diff/43001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/19656006/diff/43001/chrome/browser/io_thread.... chrome/browser/io_thread.cc:804: registry->RegisterBooleanPref(prefs::kSpdyProxyAuthEnabled, false); Is this necessary? https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:261: if (percent < 0) { remove curly braces https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:264: UMA_HISTOGRAM_PERCENTAGE("Net.DailyHttpContentSaving", percent); Change name to Net.DailyHttpContentSavings
thanks. https://codereview.chromium.org/19656006/diff/43001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/19656006/diff/43001/chrome/browser/io_thread.... chrome/browser/io_thread.cc:804: registry->RegisterBooleanPref(prefs::kSpdyProxyAuthEnabled, false); I tested it and I think you are right. This does not belong here. Removed. https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:261: if (percent < 0) { On 2013/08/02 18:00:46, bengr1 wrote: > remove curly braces Done. https://codereview.chromium.org/19656006/diff/43001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:264: UMA_HISTOGRAM_PERCENTAGE("Net.DailyHttpContentSaving", percent); On 2013/08/02 18:00:46, bengr1 wrote: > Change name to Net.DailyHttpContentSavings Done.
ping? Ilya, I added you to review the histograms.xml change since jar is OOO.
lgtm
https://codereview.chromium.org/19656006/diff/57001/tools/metrics/histograms/... File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/19656006/diff/57001/tools/metrics/histograms/... tools/metrics/histograms/histograms.xml:5662: <histogram name="Net.DailyHttpContentLengthViaDataReductionProxy" units="bytes"> Hmm, would KB or MB perhaps be a more useful measure? It seems like this histogram will be clipped off *very* low otherwise. Ditto below. https://codereview.chromium.org/19656006/diff/57001/tools/metrics/histograms/... tools/metrics/histograms/histograms.xml:5665: received through the data reduction proxy. Out of curiosity, why do you measure this per-day, rather than per-response?
On 2013/08/05 18:06:32, bolian wrote: > ping? Ilya, I added you to review the histograms.xml change since jar is OOO. Apologies for missing this. For future reference, it's helpful if you include a message like "isherman, PTAL at histograms.xml" when adding reviewers -- otherwise, Rietveld makes it pretty hard for reviewers to notice that they've been added to a thread they were already auto-cc'ed on. (Sorry if you did send a message like that that I just missed.)
https://codereview.chromium.org/19656006/diff/57001/tools/metrics/histograms/... File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/19656006/diff/57001/tools/metrics/histograms/... tools/metrics/histograms/histograms.xml:5662: <histogram name="Net.DailyHttpContentLengthViaDataReductionProxy" units="bytes"> Wow, I did not realize it is capped at 1,000,000. Changed to KB. Thanks! https://codereview.chromium.org/19656006/diff/57001/tools/metrics/histograms/... tools/metrics/histograms/histograms.xml:5665: received through the data reduction proxy. We already have Net.HttpConentLength* for each response. We want additional metrics to know typical daily usage of the data reduction proxy in comparison with not using the proxy.
hey, no problem. I did put "isherman: for histogram.xml" in description. But now I know it would be more noticeable to put that in a new message. Thanks!
lgtm, thanks https://codereview.chromium.org/19656006/diff/72001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/72001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:249: // Record metrics in KBytes. Optional nit: "KBytes" looks a little weird; I'd recommend going with either "KB" or "KiloBytes"
Thanks! https://codereview.chromium.org/19656006/diff/72001/chrome/browser/net/chrome... File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/19656006/diff/72001/chrome/browser/net/chrome... chrome/browser/net/chrome_network_delegate.cc:249: // Record metrics in KBytes. On 2013/08/06 07:48:56, Ilya Sherman (Away Aug. 9-25) wrote: > Optional nit: "KBytes" looks a little weird; I'd recommend going with either > "KB" or "KiloBytes" Done.
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/19656006/71002
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_p...
Looks like I still miss an owner lgtm for chrome/browser/io_thread.cc. thestig@, Could you take a look on that? Thanks.
chrome/browser/io_thread.cc lgtm
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/19656006/71002
Retried try job too often on mac_rel for step(s) remoting_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&nu...
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/19656006/71002
Retried try job too often on mac_rel for step(s) remoting_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&nu...
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/19656006/71002
Message was sent while issue was closed.
Change committed as 216224
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/19656006/diff/71002/chrome/browser/net... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/71002/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:404: DCHECK_EQ(kNumDaysInHistory, data_reduction_enabled_update->GetSize()); I just updated my local android build, and it's DCHECK failing on this line. Any thoughts on why? [FATAL:chrome_network_delegate.cc(404)] Check failed: kNumDaysInHistory == data_reduction_enabled_update->GetSize() (60 vs. 0) UpdateContentLengthPrefs -chrome/browser/net/chrome_network_delegate.cc:404
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/19656006/diff/71002/chrome/browser/net... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/71002/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:404: DCHECK_EQ(kNumDaysInHistory, data_reduction_enabled_update->GetSize()); This is a bug. I think what's going on is that before the chrome update, |days_since_last_update| was 0 on your phone, so no new entries were added to |data_reduction_enabled_update|. On 2013/08/09 19:14:17, Ted C wrote: > I just updated my local android build, and it's DCHECK failing on this line. > Any thoughts on why? > > [FATAL:chrome_network_delegate.cc(404)] Check failed: kNumDaysInHistory == > data_reduction_enabled_update->GetSize() (60 vs. 0) > > UpdateContentLengthPrefs -chrome/browser/net/chrome_network_delegate.cc:404
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/19656006/diff/71002/chrome/browser/net... File chrome/browser/net/chrome_network_delegate.cc (right): https://chromiumcodereview.appspot.com/19656006/diff/71002/chrome/browser/net... chrome/browser/net/chrome_network_delegate.cc:328: I'd do this to fix: // Add an invariant that the number of entries in each of the list pref updates should be the same, and correct if not. #include <algorithm> int max_size = std::max(std::max(original_update->GetSize(), received_update->GetSize()), std::max(data_reduction_enabled_update->GetSize(), via_data_reduction_update->GetSize())); int min_size = std::min(std::min(original_update->GetSize(), received_update->GetSize()), std::min(data_reduction_enabled_update->GetSize(), via_data_reduction_update->GetSize())); // Handle only the case that new list pref was introduced after // some list prefs were in use. if (max_size == kNumDaysInHistory || min_size == 0) { if (!original_update->GetSize()) for (int i = 0; i < static_cast<int>(kNumDaysInHistory); ++i) original_update->AppendString(base::int64ToString(0); // repeat for the other list prefs. } I'd also suggest moving this padding to new function: AddEntriesToListPrefForDaysSinceLastUpdate(const int days_since_last_update, ListPrefUpdate* update);
Message was sent while issue was closed.
Sorry, folks. I am sending a CL for review: https://codereview.chromium.org/22495008 |