| OLD | NEW |
| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 if (document_state->was_after_preconnect_request()) { | 589 if (document_state->was_after_preconnect_request()) { |
| 590 PLT_HISTOGRAM("PLT.BeginToFinishDoc_AfterPreconnectRequest", | 590 PLT_HISTOGRAM("PLT.BeginToFinishDoc_AfterPreconnectRequest", |
| 591 begin_to_finish_doc); | 591 begin_to_finish_doc); |
| 592 PLT_HISTOGRAM("PLT.BeginToFinish_AfterPreconnectRequest", | 592 PLT_HISTOGRAM("PLT.BeginToFinish_AfterPreconnectRequest", |
| 593 begin_to_finish_all_loads); | 593 begin_to_finish_all_loads); |
| 594 } | 594 } |
| 595 | 595 |
| 596 // TODO(mpcomplete): remove the extension-related histograms after we collect | 596 // TODO(mpcomplete): remove the extension-related histograms after we collect |
| 597 // enough data. http://crbug.com/100411 | 597 // enough data. http://crbug.com/100411 |
| 598 const bool use_adblock_histogram = | 598 const bool use_adblock_histogram = |
| 599 chrome::ChromeContentRendererClient::IsAdblockInstalled(); | 599 ChromeContentRendererClient::IsAdblockInstalled(); |
| 600 if (use_adblock_histogram) { | 600 if (use_adblock_histogram) { |
| 601 UMA_HISTOGRAM_ENUMERATION( | 601 UMA_HISTOGRAM_ENUMERATION( |
| 602 "PLT.Abandoned_ExtensionAdblock", | 602 "PLT.Abandoned_ExtensionAdblock", |
| 603 abandoned_page ? 1 : 0, 2); | 603 abandoned_page ? 1 : 0, 2); |
| 604 switch (load_type) { | 604 switch (load_type) { |
| 605 case DocumentState::NORMAL_LOAD: | 605 case DocumentState::NORMAL_LOAD: |
| 606 PLT_HISTOGRAM( | 606 PLT_HISTOGRAM( |
| 607 "PLT.BeginToFinish_NormalLoad_ExtensionAdblock", | 607 "PLT.BeginToFinish_NormalLoad_ExtensionAdblock", |
| 608 begin_to_finish_all_loads); | 608 begin_to_finish_all_loads); |
| 609 break; | 609 break; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 621 PLT_HISTOGRAM( | 621 PLT_HISTOGRAM( |
| 622 "PLT.BeginToFinish_LinkLoadStaleOk_ExtensionAdblock", | 622 "PLT.BeginToFinish_LinkLoadStaleOk_ExtensionAdblock", |
| 623 begin_to_finish_all_loads); | 623 begin_to_finish_all_loads); |
| 624 break; | 624 break; |
| 625 default: | 625 default: |
| 626 break; | 626 break; |
| 627 } | 627 } |
| 628 } | 628 } |
| 629 | 629 |
| 630 const bool use_adblockplus_histogram = | 630 const bool use_adblockplus_histogram = |
| 631 chrome::ChromeContentRendererClient::IsAdblockPlusInstalled(); | 631 ChromeContentRendererClient::IsAdblockPlusInstalled(); |
| 632 if (use_adblockplus_histogram) { | 632 if (use_adblockplus_histogram) { |
| 633 UMA_HISTOGRAM_ENUMERATION( | 633 UMA_HISTOGRAM_ENUMERATION( |
| 634 "PLT.Abandoned_ExtensionAdblockPlus", | 634 "PLT.Abandoned_ExtensionAdblockPlus", |
| 635 abandoned_page ? 1 : 0, 2); | 635 abandoned_page ? 1 : 0, 2); |
| 636 switch (load_type) { | 636 switch (load_type) { |
| 637 case DocumentState::NORMAL_LOAD: | 637 case DocumentState::NORMAL_LOAD: |
| 638 PLT_HISTOGRAM( | 638 PLT_HISTOGRAM( |
| 639 "PLT.BeginToFinish_NormalLoad_ExtensionAdblockPlus", | 639 "PLT.BeginToFinish_NormalLoad_ExtensionAdblockPlus", |
| 640 begin_to_finish_all_loads); | 640 begin_to_finish_all_loads); |
| 641 break; | 641 break; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 653 PLT_HISTOGRAM( | 653 PLT_HISTOGRAM( |
| 654 "PLT.BeginToFinish_LinkLoadStaleOk_ExtensionAdblockPlus", | 654 "PLT.BeginToFinish_LinkLoadStaleOk_ExtensionAdblockPlus", |
| 655 begin_to_finish_all_loads); | 655 begin_to_finish_all_loads); |
| 656 break; | 656 break; |
| 657 default: | 657 default: |
| 658 break; | 658 break; |
| 659 } | 659 } |
| 660 } | 660 } |
| 661 | 661 |
| 662 const bool use_webrequest_adblock_histogram = | 662 const bool use_webrequest_adblock_histogram = |
| 663 chrome::ChromeContentRendererClient::IsAdblockWithWebRequestInstalled(); | 663 ChromeContentRendererClient::IsAdblockWithWebRequestInstalled(); |
| 664 if (use_webrequest_adblock_histogram) { | 664 if (use_webrequest_adblock_histogram) { |
| 665 UMA_HISTOGRAM_ENUMERATION( | 665 UMA_HISTOGRAM_ENUMERATION( |
| 666 "PLT.Abandoned_ExtensionWebRequestAdblock", | 666 "PLT.Abandoned_ExtensionWebRequestAdblock", |
| 667 abandoned_page ? 1 : 0, 2); | 667 abandoned_page ? 1 : 0, 2); |
| 668 switch (load_type) { | 668 switch (load_type) { |
| 669 case DocumentState::NORMAL_LOAD: | 669 case DocumentState::NORMAL_LOAD: |
| 670 PLT_HISTOGRAM( | 670 PLT_HISTOGRAM( |
| 671 "PLT.BeginToFinish_NormalLoad_ExtensionWebRequestAdblock", | 671 "PLT.BeginToFinish_NormalLoad_ExtensionWebRequestAdblock", |
| 672 begin_to_finish_all_loads); | 672 begin_to_finish_all_loads); |
| 673 break; | 673 break; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 685 PLT_HISTOGRAM( | 685 PLT_HISTOGRAM( |
| 686 "PLT.BeginToFinish_LinkLoadStaleOk_ExtensionWebRequestAdblock", | 686 "PLT.BeginToFinish_LinkLoadStaleOk_ExtensionWebRequestAdblock", |
| 687 begin_to_finish_all_loads); | 687 begin_to_finish_all_loads); |
| 688 break; | 688 break; |
| 689 default: | 689 default: |
| 690 break; | 690 break; |
| 691 } | 691 } |
| 692 } | 692 } |
| 693 | 693 |
| 694 const bool use_webrequest_adblockplus_histogram = | 694 const bool use_webrequest_adblockplus_histogram = |
| 695 chrome::ChromeContentRendererClient:: | 695 ChromeContentRendererClient:: |
| 696 IsAdblockPlusWithWebRequestInstalled(); | 696 IsAdblockPlusWithWebRequestInstalled(); |
| 697 if (use_webrequest_adblockplus_histogram) { | 697 if (use_webrequest_adblockplus_histogram) { |
| 698 UMA_HISTOGRAM_ENUMERATION( | 698 UMA_HISTOGRAM_ENUMERATION( |
| 699 "PLT.Abandoned_ExtensionWebRequestAdblockPlus", | 699 "PLT.Abandoned_ExtensionWebRequestAdblockPlus", |
| 700 abandoned_page ? 1 : 0, 2); | 700 abandoned_page ? 1 : 0, 2); |
| 701 switch (load_type) { | 701 switch (load_type) { |
| 702 case DocumentState::NORMAL_LOAD: | 702 case DocumentState::NORMAL_LOAD: |
| 703 PLT_HISTOGRAM( | 703 PLT_HISTOGRAM( |
| 704 "PLT.BeginToFinish_NormalLoad_ExtensionWebRequestAdblockPlus", | 704 "PLT.BeginToFinish_NormalLoad_ExtensionWebRequestAdblockPlus", |
| 705 begin_to_finish_all_loads); | 705 begin_to_finish_all_loads); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 718 PLT_HISTOGRAM( | 718 PLT_HISTOGRAM( |
| 719 "PLT.BeginToFinish_LinkLoadStaleOk_ExtensionWebRequestAdblockPlus", | 719 "PLT.BeginToFinish_LinkLoadStaleOk_ExtensionWebRequestAdblockPlus", |
| 720 begin_to_finish_all_loads); | 720 begin_to_finish_all_loads); |
| 721 break; | 721 break; |
| 722 default: | 722 default: |
| 723 break; | 723 break; |
| 724 } | 724 } |
| 725 } | 725 } |
| 726 | 726 |
| 727 const bool use_webrequest_other_histogram = | 727 const bool use_webrequest_other_histogram = |
| 728 chrome::ChromeContentRendererClient:: | 728 ChromeContentRendererClient:: |
| 729 IsOtherExtensionWithWebRequestInstalled(); | 729 IsOtherExtensionWithWebRequestInstalled(); |
| 730 if (use_webrequest_other_histogram) { | 730 if (use_webrequest_other_histogram) { |
| 731 UMA_HISTOGRAM_ENUMERATION( | 731 UMA_HISTOGRAM_ENUMERATION( |
| 732 "PLT.Abandoned_ExtensionWebRequestOther", | 732 "PLT.Abandoned_ExtensionWebRequestOther", |
| 733 abandoned_page ? 1 : 0, 2); | 733 abandoned_page ? 1 : 0, 2); |
| 734 switch (load_type) { | 734 switch (load_type) { |
| 735 case DocumentState::NORMAL_LOAD: | 735 case DocumentState::NORMAL_LOAD: |
| 736 PLT_HISTOGRAM( | 736 PLT_HISTOGRAM( |
| 737 "PLT.BeginToFinish_NormalLoad_ExtensionWebRequestOther", | 737 "PLT.BeginToFinish_NormalLoad_ExtensionWebRequestOther", |
| 738 begin_to_finish_all_loads); | 738 begin_to_finish_all_loads); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 | 855 |
| 856 DCHECK(document_state); | 856 DCHECK(document_state); |
| 857 DCHECK(ds); | 857 DCHECK(ds); |
| 858 GURL url(ds->request().url()); | 858 GURL url(ds->request().url()); |
| 859 Time start = document_state->start_load_time(); | 859 Time start = document_state->start_load_time(); |
| 860 Time finish = document_state->finish_load_time(); | 860 Time finish = document_state->finish_load_time(); |
| 861 // TODO(mbelshe): should we log more stats? | 861 // TODO(mbelshe): should we log more stats? |
| 862 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " | 862 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " |
| 863 << url.spec(); | 863 << url.spec(); |
| 864 } | 864 } |
| OLD | NEW |