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

Side by Side Diff: chrome/renderer/page_load_histograms.cc

Issue 1363673004: [DRP] Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/page_load_histograms.h" 5 #include "chrome/renderer/page_load_histograms.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/metrics/field_trial.h" 12 #include "base/metrics/field_trial.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_split.h" 15 #include "base/strings/string_split.h"
16 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "base/time/time.h" 19 #include "base/time/time.h"
20 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
21 #include "chrome/renderer/chrome_content_renderer_client.h" 21 #include "chrome/renderer/chrome_content_renderer_client.h"
22 #include "chrome/renderer/searchbox/search_bouncer.h" 22 #include "chrome/renderer/searchbox/search_bouncer.h"
23 #include "components/data_reduction_proxy/content/common/data_reduction_proxy_me ssages.h" 23 #include "components/data_reduction_proxy/content/common/data_reduction_proxy_me ssages.h"
24 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
24 #include "content/public/common/content_constants.h" 25 #include "content/public/common/content_constants.h"
25 #include "content/public/renderer/document_state.h" 26 #include "content/public/renderer/document_state.h"
27 #include "content/public/renderer/render_frame.h"
26 #include "content/public/renderer/render_thread.h" 28 #include "content/public/renderer/render_thread.h"
27 #include "content/public/renderer/render_view.h" 29 #include "content/public/renderer/render_view.h"
28 #include "extensions/common/url_pattern.h" 30 #include "extensions/common/url_pattern.h"
29 #include "net/base/url_util.h" 31 #include "net/base/url_util.h"
30 #include "net/http/http_response_headers.h" 32 #include "net/http/http_response_headers.h"
31 #include "third_party/WebKit/public/platform/WebURLRequest.h" 33 #include "third_party/WebKit/public/platform/WebURLRequest.h"
32 #include "third_party/WebKit/public/platform/WebURLResponse.h" 34 #include "third_party/WebKit/public/platform/WebURLResponse.h"
33 #include "third_party/WebKit/public/web/WebDocument.h" 35 #include "third_party/WebKit/public/web/WebDocument.h"
34 #include "third_party/WebKit/public/web/WebFrame.h" 36 #include "third_party/WebKit/public/web/WebFrame.h"
35 #include "third_party/WebKit/public/web/WebPerformance.h" 37 #include "third_party/WebKit/public/web/WebPerformance.h"
36 #include "third_party/WebKit/public/web/WebView.h" 38 #include "third_party/WebKit/public/web/WebView.h"
37 #include "url/gurl.h" 39 #include "url/gurl.h"
38 40
39 using blink::WebDataSource; 41 using blink::WebDataSource;
40 using blink::WebFrame; 42 using blink::WebFrame;
41 using blink::WebPerformance; 43 using blink::WebPerformance;
42 using blink::WebString; 44 using blink::WebString;
43 using base::Time; 45 using base::Time;
44 using base::TimeDelta; 46 using base::TimeDelta;
45 using content::DocumentState; 47 using content::DocumentState;
46 48
47 const size_t kPLTCount = 100; 49 const size_t kPLTCount = 100;
48 50
49 namespace { 51 namespace {
50 52
53 const char kEnabled[] = "Enabled";
54 const char kControl[] = "Control";
55
51 // ID indicating that no GWS-Chrome joint experiment is active. 56 // ID indicating that no GWS-Chrome joint experiment is active.
52 const int kNoExperiment = 0; 57 const int kNoExperiment = 0;
53 58
54 // Max ID of GWS-Chrome joint experiment. If you change this value, please 59 // Max ID of GWS-Chrome joint experiment. If you change this value, please
55 // update PLT_HISTOGRAM_WITH_GWS_VARIANT accordingly. 60 // update PLT_HISTOGRAM_WITH_GWS_VARIANT accordingly.
56 const int kMaxExperimentID = 20; 61 const int kMaxExperimentID = 20;
57 62
58 TimeDelta kPLTMin() { 63 TimeDelta kPLTMin() {
59 return TimeDelta::FromMilliseconds(10); 64 return TimeDelta::FromMilliseconds(10);
60 } 65 }
61 TimeDelta kPLTMax() { 66 TimeDelta kPLTMax() {
62 return TimeDelta::FromMinutes(10); 67 return TimeDelta::FromMinutes(10);
63 } 68 }
64 69
70 bool IsInLoFiEnabledGroup() {
tbansal1 2015/09/28 17:49:02 It would be preferable if IsInLoFiEnabledGroup() i
megjablon 2015/09/28 22:43:37 Done.
71 return base::FieldTrialList::FindFullName(
72 data_reduction_proxy::params::GetLoFiFieldTrialName()) == kEnabled;
73 }
74
75 bool IsInLoFiControlGroup() {
76 return base::FieldTrialList::FindFullName(
77 data_reduction_proxy::params::GetLoFiFieldTrialName()) == kControl;
78 }
79
65 // This function corresponds to PLT_HISTOGRAM macro invocation without caching. 80 // This function corresponds to PLT_HISTOGRAM macro invocation without caching.
66 // Use this for PLT histograms with dynamically generated names, which 81 // Use this for PLT histograms with dynamically generated names, which
67 // otherwise can't use the caching PLT_HISTOGRAM macro without code duplication. 82 // otherwise can't use the caching PLT_HISTOGRAM macro without code duplication.
68 void PltHistogramWithNoMacroCaching(const std::string& name, 83 void PltHistogramWithNoMacroCaching(const std::string& name,
69 const TimeDelta& sample) { 84 const TimeDelta& sample) {
70 // The parameters should exacly match the parameters in 85 // The parameters should exacly match the parameters in
71 // UMA_HISTOGRAM_CUSTOM_TIMES macro. 86 // UMA_HISTOGRAM_CUSTOM_TIMES macro.
72 base::HistogramBase* histogram_pointer = base::Histogram::FactoryTimeGet( 87 base::HistogramBase* histogram_pointer = base::Histogram::FactoryTimeGet(
73 name, kPLTMin(), kPLTMax(), kPLTCount, 88 name, kPLTMin(), kPLTMax(), kPLTCount,
74 base::HistogramBase::kUmaTargetedHistogramFlag); 89 base::HistogramBase::kUmaTargetedHistogramFlag);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if (!base::StringToInt(value, &experiment_id)) 227 if (!base::StringToInt(value, &experiment_id))
213 return kNoExperiment; 228 return kNoExperiment;
214 if (0 < experiment_id && experiment_id <= kMaxExperimentID) 229 if (0 < experiment_id && experiment_id <= kMaxExperimentID)
215 return experiment_id; 230 return experiment_id;
216 return kNoExperiment; 231 return kNoExperiment;
217 } 232 }
218 233
219 void DumpHistograms(const WebPerformance& performance, 234 void DumpHistograms(const WebPerformance& performance,
220 DocumentState* document_state, 235 DocumentState* document_state,
221 bool data_reduction_proxy_was_used, 236 bool data_reduction_proxy_was_used,
222 data_reduction_proxy::LoFiStatus lofi_status, 237 bool lofi_on,
tbansal1 2015/09/28 17:49:02 Can you please explain what |lofi_on| in comments?
megjablon 2015/09/28 22:43:37 Done.
223 bool came_from_websearch, 238 bool came_from_websearch,
224 int websearch_chrome_joint_experiment_id, 239 int websearch_chrome_joint_experiment_id,
225 bool is_preview, 240 bool is_preview,
226 URLPattern::SchemeMasks scheme_type) { 241 URLPattern::SchemeMasks scheme_type) {
227 // This function records new histograms based on the Navigation Timing 242 // This function records new histograms based on the Navigation Timing
228 // records. As such, the histograms should not depend on the deprecated timing 243 // records. As such, the histograms should not depend on the deprecated timing
229 // information collected in DocumentState. However, here for some reason we 244 // information collected in DocumentState. However, here for some reason we
230 // check if document_state->request_time() is null. TODO(ppi): find out why 245 // check if document_state->request_time() is null. TODO(ppi): find out why
231 // and remove DocumentState from the parameter list. 246 // and remove DocumentState from the parameter list.
232 Time request = document_state->request_time(); 247 Time request = document_state->request_time();
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 load_event_end - navigation_start, 419 load_event_end - navigation_start,
405 came_from_websearch, 420 came_from_websearch,
406 websearch_chrome_joint_experiment_id, 421 websearch_chrome_joint_experiment_id,
407 is_preview); 422 is_preview);
408 PLT_HISTOGRAM_WITH_GWS_VARIANT("PLT.PT_StartToFinish", 423 PLT_HISTOGRAM_WITH_GWS_VARIANT("PLT.PT_StartToFinish",
409 load_event_end - request_start, 424 load_event_end - request_start,
410 came_from_websearch, 425 came_from_websearch,
411 websearch_chrome_joint_experiment_id, 426 websearch_chrome_joint_experiment_id,
412 is_preview); 427 is_preview);
413 if (data_reduction_proxy_was_used) { 428 if (data_reduction_proxy_was_used) {
429 bool in_lofi_enabled_group = IsInLoFiEnabledGroup();
430 bool in_lofi_control_group = IsInLoFiControlGroup();
414 if ((scheme_type & URLPattern::SCHEME_HTTPS) == 0) { 431 if ((scheme_type & URLPattern::SCHEME_HTTPS) == 0) {
415 PLT_HISTOGRAM("PLT.PT_BeginToFinish_DataReductionProxy", 432 PLT_HISTOGRAM("PLT.PT_BeginToFinish_DataReductionProxy",
416 load_event_end - begin); 433 load_event_end - begin);
417 PLT_HISTOGRAM("PLT.PT_CommitToFinish_DataReductionProxy", 434 PLT_HISTOGRAM("PLT.PT_CommitToFinish_DataReductionProxy",
418 load_event_end - response_start); 435 load_event_end - response_start);
419 PLT_HISTOGRAM("PLT.PT_RequestToFinish_DataReductionProxy", 436 PLT_HISTOGRAM("PLT.PT_RequestToFinish_DataReductionProxy",
420 load_event_end - navigation_start); 437 load_event_end - navigation_start);
421 PLT_HISTOGRAM("PLT.PT_StartToFinish_DataReductionProxy", 438 PLT_HISTOGRAM("PLT.PT_StartToFinish_DataReductionProxy",
422 load_event_end - request_start); 439 load_event_end - request_start);
423 if (lofi_status == data_reduction_proxy::LOFI_STATUS_ACTIVE) { 440 if (lofi_on && in_lofi_enabled_group) {
424 PLT_HISTOGRAM("PLT.PT_BeginToFinish_DataReductionProxy_AutoLoFiOn", 441 PLT_HISTOGRAM("PLT.PT_BeginToFinish_DataReductionProxy_AutoLoFiOn",
425 load_event_end - begin); 442 load_event_end - begin);
426 PLT_HISTOGRAM("PLT.PT_CommitToFinish_DataReductionProxy_AutoLoFiOn", 443 PLT_HISTOGRAM("PLT.PT_CommitToFinish_DataReductionProxy_AutoLoFiOn",
427 load_event_end - response_start); 444 load_event_end - response_start);
428 PLT_HISTOGRAM("PLT.PT_RequestToFinish_DataReductionProxy_AutoLoFiOn", 445 PLT_HISTOGRAM("PLT.PT_RequestToFinish_DataReductionProxy_AutoLoFiOn",
429 load_event_end - navigation_start); 446 load_event_end - navigation_start);
430 PLT_HISTOGRAM("PLT.PT_StartToFinish_DataReductionProxy_AutoLoFiOn", 447 PLT_HISTOGRAM("PLT.PT_StartToFinish_DataReductionProxy_AutoLoFiOn",
431 load_event_end - request_start); 448 load_event_end - request_start);
432 if (!first_paint.is_null()) { 449 if (!first_paint.is_null()) {
433 PLT_HISTOGRAM("PLT.BeginToFirstPaint_DataReductionProxy_AutoLoFiOn", 450 PLT_HISTOGRAM("PLT.BeginToFirstPaint_DataReductionProxy_AutoLoFiOn",
434 first_paint - begin); 451 first_paint - begin);
435 } 452 }
436 } else if (lofi_status == 453 } else if (lofi_on && in_lofi_control_group) {
437 data_reduction_proxy::LOFI_STATUS_ACTIVE_CONTROL) {
438 PLT_HISTOGRAM("PLT.PT_BeginToFinish_DataReductionProxy_AutoLoFiOff", 454 PLT_HISTOGRAM("PLT.PT_BeginToFinish_DataReductionProxy_AutoLoFiOff",
439 load_event_end - begin); 455 load_event_end - begin);
440 PLT_HISTOGRAM("PLT.PT_CommitToFinish_DataReductionProxy_AutoLoFiOff", 456 PLT_HISTOGRAM("PLT.PT_CommitToFinish_DataReductionProxy_AutoLoFiOff",
441 load_event_end - response_start); 457 load_event_end - response_start);
442 PLT_HISTOGRAM("PLT.PT_RequestToFinish_DataReductionProxy_AutoLoFiOff", 458 PLT_HISTOGRAM("PLT.PT_RequestToFinish_DataReductionProxy_AutoLoFiOff",
443 load_event_end - navigation_start); 459 load_event_end - navigation_start);
444 PLT_HISTOGRAM("PLT.PT_StartToFinish_DataReductionProxy_AutoLoFiOff", 460 PLT_HISTOGRAM("PLT.PT_StartToFinish_DataReductionProxy_AutoLoFiOff",
445 load_event_end - request_start); 461 load_event_end - request_start);
446 if (!first_paint.is_null()) { 462 if (!first_paint.is_null()) {
447 PLT_HISTOGRAM( 463 PLT_HISTOGRAM(
448 "PLT.BeginToFirstPaint_DataReductionProxy_AutoLoFiOff", 464 "PLT.BeginToFirstPaint_DataReductionProxy_AutoLoFiOff",
449 first_paint - begin); 465 first_paint - begin);
450 } 466 }
451 } 467 }
452 } else { 468 } else {
453 PLT_HISTOGRAM("PLT.PT_BeginToFinish_HTTPS_DataReductionProxy", 469 PLT_HISTOGRAM("PLT.PT_BeginToFinish_HTTPS_DataReductionProxy",
454 load_event_end - begin); 470 load_event_end - begin);
455 PLT_HISTOGRAM("PLT.PT_CommitToFinish_HTTPS_DataReductionProxy", 471 PLT_HISTOGRAM("PLT.PT_CommitToFinish_HTTPS_DataReductionProxy",
456 load_event_end - response_start); 472 load_event_end - response_start);
457 PLT_HISTOGRAM("PLT.PT_RequestToFinish_HTTPS_DataReductionProxy", 473 PLT_HISTOGRAM("PLT.PT_RequestToFinish_HTTPS_DataReductionProxy",
458 load_event_end - navigation_start); 474 load_event_end - navigation_start);
459 PLT_HISTOGRAM("PLT.PT_StartToFinish_HTTPS_DataReductionProxy", 475 PLT_HISTOGRAM("PLT.PT_StartToFinish_HTTPS_DataReductionProxy",
460 load_event_end - request_start); 476 load_event_end - request_start);
461 if (lofi_status == data_reduction_proxy::LOFI_STATUS_ACTIVE) { 477 if (lofi_on && in_lofi_enabled_group) {
462 PLT_HISTOGRAM( 478 PLT_HISTOGRAM(
463 "PLT.PT_BeginToFinish_HTTPS_DataReductionProxy_AutoLoFiOn", 479 "PLT.PT_BeginToFinish_HTTPS_DataReductionProxy_AutoLoFiOn",
464 load_event_end - begin); 480 load_event_end - begin);
465 PLT_HISTOGRAM( 481 PLT_HISTOGRAM(
466 "PLT.PT_CommitToFinish_HTTPS_DataReductionProxy_AutoLoFiOn", 482 "PLT.PT_CommitToFinish_HTTPS_DataReductionProxy_AutoLoFiOn",
467 load_event_end - response_start); 483 load_event_end - response_start);
468 PLT_HISTOGRAM( 484 PLT_HISTOGRAM(
469 "PLT.PT_RequestToFinish_HTTPS_DataReductionProxy_AutoLoFiOn", 485 "PLT.PT_RequestToFinish_HTTPS_DataReductionProxy_AutoLoFiOn",
470 load_event_end - navigation_start); 486 load_event_end - navigation_start);
471 PLT_HISTOGRAM( 487 PLT_HISTOGRAM(
472 "PLT.PT_StartToFinish_HTTPS_DataReductionProxy_AutoLoFiOn", 488 "PLT.PT_StartToFinish_HTTPS_DataReductionProxy_AutoLoFiOn",
473 load_event_end - request_start); 489 load_event_end - request_start);
474 if (!first_paint.is_null()) { 490 if (!first_paint.is_null()) {
475 PLT_HISTOGRAM( 491 PLT_HISTOGRAM(
476 "PLT.BeginToFirstPaint_HTTPS_DataReductionProxy_AutoLoFiOn", 492 "PLT.BeginToFirstPaint_HTTPS_DataReductionProxy_AutoLoFiOn",
477 first_paint - begin); 493 first_paint - begin);
478 } 494 }
479 } else if (lofi_status == 495 } else if (lofi_on && in_lofi_control_group) {
480 data_reduction_proxy::LOFI_STATUS_ACTIVE_CONTROL) {
481 PLT_HISTOGRAM( 496 PLT_HISTOGRAM(
482 "PLT.PT_BeginToFinish_HTTPS_DataReductionProxy_AutoLoFiOff", 497 "PLT.PT_BeginToFinish_HTTPS_DataReductionProxy_AutoLoFiOff",
483 load_event_end - begin); 498 load_event_end - begin);
484 PLT_HISTOGRAM( 499 PLT_HISTOGRAM(
485 "PLT.PT_CommitToFinish_HTTPS_DataReductionProxy_AutoLoFiOff", 500 "PLT.PT_CommitToFinish_HTTPS_DataReductionProxy_AutoLoFiOff",
486 load_event_end - response_start); 501 load_event_end - response_start);
487 PLT_HISTOGRAM( 502 PLT_HISTOGRAM(
488 "PLT.PT_RequestToFinish_HTTPS_DataReductionProxy_AutoLoFiOff", 503 "PLT.PT_RequestToFinish_HTTPS_DataReductionProxy_AutoLoFiOff",
489 load_event_end - navigation_start); 504 load_event_end - navigation_start);
490 PLT_HISTOGRAM( 505 PLT_HISTOGRAM(
(...skipping 26 matching lines...) Expand all
517 } 532 }
518 } 533 }
519 } 534 }
520 if (!dom_content_loaded_start.is_null()) { 535 if (!dom_content_loaded_start.is_null()) {
521 PLT_HISTOGRAM_WITH_GWS_VARIANT("PLT.PT_RequestToDomContentLoaded", 536 PLT_HISTOGRAM_WITH_GWS_VARIANT("PLT.PT_RequestToDomContentLoaded",
522 dom_content_loaded_start - navigation_start, 537 dom_content_loaded_start - navigation_start,
523 came_from_websearch, 538 came_from_websearch,
524 websearch_chrome_joint_experiment_id, 539 websearch_chrome_joint_experiment_id,
525 is_preview); 540 is_preview);
526 if (data_reduction_proxy_was_used) { 541 if (data_reduction_proxy_was_used) {
542 bool in_lofi_enabled_group = IsInLoFiEnabledGroup();
543 bool in_lofi_control_group = IsInLoFiControlGroup();
527 if ((scheme_type & URLPattern::SCHEME_HTTPS) == 0) { 544 if ((scheme_type & URLPattern::SCHEME_HTTPS) == 0) {
528 PLT_HISTOGRAM("PLT.PT_RequestToDomContentLoaded_DataReductionProxy", 545 PLT_HISTOGRAM("PLT.PT_RequestToDomContentLoaded_DataReductionProxy",
529 dom_content_loaded_start - navigation_start); 546 dom_content_loaded_start - navigation_start);
530 if (lofi_status == data_reduction_proxy::LOFI_STATUS_ACTIVE) { 547 if (lofi_on && in_lofi_enabled_group) {
531 PLT_HISTOGRAM( 548 PLT_HISTOGRAM(
532 "PLT.PT_RequestToDomContentLoaded_DataReductionProxy_AutoLoFiOn", 549 "PLT.PT_RequestToDomContentLoaded_DataReductionProxy_AutoLoFiOn",
533 dom_content_loaded_start - navigation_start); 550 dom_content_loaded_start - navigation_start);
534 } else if (lofi_status == 551 } else if (lofi_on && in_lofi_control_group) {
535 data_reduction_proxy::LOFI_STATUS_ACTIVE_CONTROL) {
536 PLT_HISTOGRAM( 552 PLT_HISTOGRAM(
537 "PLT.PT_RequestToDomContentLoaded_DataReductionProxy_AutoLoFiOff", 553 "PLT.PT_RequestToDomContentLoaded_DataReductionProxy_AutoLoFiOff",
538 dom_content_loaded_start - navigation_start); 554 dom_content_loaded_start - navigation_start);
539 } 555 }
540 } else { 556 } else {
541 PLT_HISTOGRAM( 557 PLT_HISTOGRAM(
542 "PLT.PT_RequestToDomContentLoaded_HTTPS_DataReductionProxy", 558 "PLT.PT_RequestToDomContentLoaded_HTTPS_DataReductionProxy",
543 dom_content_loaded_start - navigation_start); 559 dom_content_loaded_start - navigation_start);
544 if (lofi_status == data_reduction_proxy::LOFI_STATUS_ACTIVE) { 560 if (lofi_on && in_lofi_enabled_group) {
545 PLT_HISTOGRAM( 561 PLT_HISTOGRAM(
546 "PLT.PT_RequestToDomContentLoaded_HTTPS_DataReductionProxy_" 562 "PLT.PT_RequestToDomContentLoaded_HTTPS_DataReductionProxy_"
547 "AutoLoFiOn", 563 "AutoLoFiOn",
548 dom_content_loaded_start - navigation_start); 564 dom_content_loaded_start - navigation_start);
549 } else if (lofi_status == 565 } else if (lofi_on && in_lofi_control_group) {
550 data_reduction_proxy::LOFI_STATUS_ACTIVE_CONTROL) {
551 PLT_HISTOGRAM( 566 PLT_HISTOGRAM(
552 "PLT.PT_RequestToDomContentLoaded_HTTPS_DataReductionProxy_" 567 "PLT.PT_RequestToDomContentLoaded_HTTPS_DataReductionProxy_"
553 "AutoLoFiOff", 568 "AutoLoFiOff",
554 dom_content_loaded_start - navigation_start); 569 dom_content_loaded_start - navigation_start);
555 } 570 }
556 } 571 }
557 } 572 }
558 } 573 }
559 PLT_HISTOGRAM_WITH_GWS_VARIANT("PLT.PT_BeginToCommit", 574 PLT_HISTOGRAM_WITH_GWS_VARIANT("PLT.PT_BeginToCommit",
560 response_start - begin, 575 response_start - begin,
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 if (!ShouldDump(frame)) 886 if (!ShouldDump(frame))
872 return; 887 return;
873 888
874 URLPattern::SchemeMasks scheme_type = 889 URLPattern::SchemeMasks scheme_type =
875 GetSupportedSchemeType(frame->document().url()); 890 GetSupportedSchemeType(frame->document().url());
876 891
877 DocumentState* document_state = 892 DocumentState* document_state =
878 DocumentState::FromDataSource(frame->dataSource()); 893 DocumentState::FromDataSource(frame->dataSource());
879 894
880 bool data_reduction_proxy_was_used = false; 895 bool data_reduction_proxy_was_used = false;
881 data_reduction_proxy::LoFiStatus lofi_status =
882 data_reduction_proxy::LOFI_STATUS_TEMPORARILY_OFF;
883 if (!document_state->proxy_server().IsEmpty()) { 896 if (!document_state->proxy_server().IsEmpty()) {
884 bool handled = 897 bool handled =
885 Send(new DataReductionProxyViewHostMsg_DataReductionProxyStatus( 898 Send(new DataReductionProxyViewHostMsg_IsDataReductionProxy(
886 document_state->proxy_server(), &data_reduction_proxy_was_used, 899 document_state->proxy_server(), &data_reduction_proxy_was_used));
887 &lofi_status));
888 // If the IPC call is not handled, then |data_reduction_proxy_was_used| 900 // If the IPC call is not handled, then |data_reduction_proxy_was_used|
889 // should remain |false|. 901 // should remain |false|.
890 DCHECK(handled || !data_reduction_proxy_was_used); 902 DCHECK(handled || !data_reduction_proxy_was_used);
891 } 903 }
892 904
893 bool came_from_websearch = 905 bool came_from_websearch =
894 IsFromGoogleSearchResult(frame->document().url(), 906 IsFromGoogleSearchResult(frame->document().url(),
895 GURL(frame->document().referrer())); 907 GURL(frame->document().referrer()));
896 int websearch_chrome_joint_experiment_id = kNoExperiment; 908 int websearch_chrome_joint_experiment_id = kNoExperiment;
897 bool is_preview = false; 909 bool is_preview = false;
898 if (came_from_websearch) { 910 if (came_from_websearch) {
899 websearch_chrome_joint_experiment_id = 911 websearch_chrome_joint_experiment_id =
900 GetQueryStringBasedExperiment(GURL(frame->document().referrer())); 912 GetQueryStringBasedExperiment(GURL(frame->document().referrer()));
901 is_preview = ViaHeaderContains(frame, "1.1 Google Instant Proxy Preview"); 913 is_preview = ViaHeaderContains(frame, "1.1 Google Instant Proxy Preview");
902 } 914 }
903 915
904 MaybeDumpFirstLayoutHistograms(); 916 MaybeDumpFirstLayoutHistograms();
905 917
906 // Metrics based on the timing information recorded for the Navigation Timing 918 // Metrics based on the timing information recorded for the Navigation Timing
907 // API - http://www.w3.org/TR/navigation-timing/. 919 // API - http://www.w3.org/TR/navigation-timing/.
908 DumpHistograms(frame->performance(), document_state, 920 DumpHistograms(
909 data_reduction_proxy_was_used, lofi_status, 921 frame->performance(), document_state, data_reduction_proxy_was_used,
910 came_from_websearch, websearch_chrome_joint_experiment_id, 922 false /* TODO: render_frame->IsLoFiOn() */, came_from_websearch,
911 is_preview, scheme_type); 923 websearch_chrome_joint_experiment_id, is_preview, scheme_type);
912 924
913 // Old metrics based on the timing information stored in DocumentState. These 925 // Old metrics based on the timing information stored in DocumentState. These
914 // are deprecated and should go away. 926 // are deprecated and should go away.
915 DumpDeprecatedHistograms(frame->performance(), document_state, 927 DumpDeprecatedHistograms(frame->performance(), document_state,
916 data_reduction_proxy_was_used, 928 data_reduction_proxy_was_used,
917 came_from_websearch, 929 came_from_websearch,
918 websearch_chrome_joint_experiment_id, 930 websearch_chrome_joint_experiment_id,
919 is_preview, 931 is_preview,
920 scheme_type); 932 scheme_type);
921 933
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 1032
1021 DCHECK(document_state); 1033 DCHECK(document_state);
1022 DCHECK(ds); 1034 DCHECK(ds);
1023 GURL url(ds->request().url()); 1035 GURL url(ds->request().url());
1024 Time start = document_state->start_load_time(); 1036 Time start = document_state->start_load_time();
1025 Time finish = document_state->finish_load_time(); 1037 Time finish = document_state->finish_load_time();
1026 // TODO(mbelshe): should we log more stats? 1038 // TODO(mbelshe): should we log more stats?
1027 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " 1039 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms "
1028 << url.spec(); 1040 << url.spec();
1029 } 1041 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698