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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.h

Issue 2951643003: Add UMA that periodically logs number of outstanding requests (Closed)
Patch Set: Created 3 years, 6 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 // This is the browser side of the resource dispatcher, it receives requests 5 // This is the browser side of the resource dispatcher, it receives requests
6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and 6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and
7 // dispatches them to URLRequests. It then forwards the messages from the 7 // dispatches them to URLRequests. It then forwards the messages from the
8 // URLRequests back to the correct process for handling. 8 // URLRequests back to the correct process for handling.
9 // 9 //
10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 // WebContents. 506 // WebContents.
507 static std::unique_ptr<LoadInfoMap> PickMoreInterestingLoadInfos( 507 static std::unique_ptr<LoadInfoMap> PickMoreInterestingLoadInfos(
508 std::unique_ptr<LoadInfoList> infos); 508 std::unique_ptr<LoadInfoList> infos);
509 509
510 // Gets all the LoadInfos for each pending request. 510 // Gets all the LoadInfos for each pending request.
511 std::unique_ptr<LoadInfoList> GetLoadInfoForAllRoutes(); 511 std::unique_ptr<LoadInfoList> GetLoadInfoForAllRoutes();
512 512
513 // Checks all pending requests and updates the load info if necessary. 513 // Checks all pending requests and updates the load info if necessary.
514 void UpdateLoadInfo(); 514 void UpdateLoadInfo();
515 515
516 // Records statistics about outstanding requests since last call, and reset
Takashi Toyoshima 2017/06/20 07:39:22 s/last/the last/ ?
Kunihiko Sakamoto 2017/06/20 08:39:28 Done.
517 // the stats.
518 void RecordOutstandingRequestsStats();
519
516 // Resumes or cancels (if |cancel_requests| is true) any blocked requests. 520 // Resumes or cancels (if |cancel_requests| is true) any blocked requests.
517 void ProcessBlockedRequestsForRoute( 521 void ProcessBlockedRequestsForRoute(
518 const GlobalFrameRoutingId& global_routing_id, 522 const GlobalFrameRoutingId& global_routing_id,
519 bool cancel_requests); 523 bool cancel_requests);
520 524
521 void OnRequestResource(ResourceRequesterInfo* requester_info, 525 void OnRequestResource(ResourceRequesterInfo* requester_info,
522 int routing_id, 526 int routing_id,
523 int request_id, 527 int request_id,
524 const ResourceRequest& request_data); 528 const ResourceRequest& request_data);
525 529
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 typedef std::map<int, scoped_refptr<storage::ShareableFileReference> > 707 typedef std::map<int, scoped_refptr<storage::ShareableFileReference> >
704 DeletableFilesMap; // key is request id 708 DeletableFilesMap; // key is request id
705 typedef std::map<int, DeletableFilesMap> 709 typedef std::map<int, DeletableFilesMap>
706 RegisteredTempFiles; // key is child process id 710 RegisteredTempFiles; // key is child process id
707 RegisteredTempFiles registered_temp_files_; 711 RegisteredTempFiles registered_temp_files_;
708 712
709 // A timer that periodically calls UpdateLoadInfo while pending_loaders_ is 713 // A timer that periodically calls UpdateLoadInfo while pending_loaders_ is
710 // not empty and at least one RenderViewHost is loading. 714 // not empty and at least one RenderViewHost is loading.
711 std::unique_ptr<base::RepeatingTimer> update_load_states_timer_; 715 std::unique_ptr<base::RepeatingTimer> update_load_states_timer_;
712 716
717 // A timer that periodically calls RecordOutstandingRequestsStats.
718 std::unique_ptr<base::RepeatingTimer>
719 record_outstanding_requests_stats_timer_;
720
713 // Request ID for browser initiated requests. request_ids generated by 721 // Request ID for browser initiated requests. request_ids generated by
714 // child processes are counted up from 0, while browser created requests 722 // child processes are counted up from 0, while browser created requests
715 // start at -2 and go down from there. (We need to start at -2 because -1 is 723 // start at -2 and go down from there. (We need to start at -2 because -1 is
716 // used as a special value all over the resource_dispatcher_host for 724 // used as a special value all over the resource_dispatcher_host for
717 // uninitialized variables.) This way, we no longer have the unlikely (but 725 // uninitialized variables.) This way, we no longer have the unlikely (but
718 // observed in the real world!) event where we have two requests with the same 726 // observed in the real world!) event where we have two requests with the same
719 // request_id_. 727 // request_id_.
720 int request_id_; 728 int request_id_;
721 729
722 // True if the resource dispatcher host has been shut down. 730 // True if the resource dispatcher host has been shut down.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 // (max_outstanding_requests_cost_per_process_ / 764 // (max_outstanding_requests_cost_per_process_ /
757 // kAvgBytesPerOutstandingRequest) 765 // kAvgBytesPerOutstandingRequest)
758 int max_outstanding_requests_cost_per_process_; 766 int max_outstanding_requests_cost_per_process_;
759 767
760 // Largest number of outstanding requests seen so far across all processes. 768 // Largest number of outstanding requests seen so far across all processes.
761 int largest_outstanding_request_count_seen_; 769 int largest_outstanding_request_count_seen_;
762 770
763 // Largest number of outstanding requests seen so far in any single process. 771 // Largest number of outstanding requests seen so far in any single process.
764 int largest_outstanding_request_per_process_count_seen_; 772 int largest_outstanding_request_per_process_count_seen_;
765 773
774 // Largest number of outstanding requests seen since last call to
Takashi Toyoshima 2017/06/20 07:39:22 the last
Kunihiko Sakamoto 2017/06/20 08:39:28 Done.
775 // RecordOutstandingRequestsStats.
776 int peak_outstanding_request_count_;
777
778 // Largest number of outstanding requests seen while there are outstanding
779 // requests from two or more processes, since last call to
Takashi Toyoshima 2017/06/20 07:39:21 the last
Kunihiko Sakamoto 2017/06/20 08:39:28 Done.
780 // RecordOutstandingRequestsStats.
781 int peak_outstanding_request_count_multitab_ = 0;
782
766 // Time of the last user gesture. Stored so that we can add a load 783 // Time of the last user gesture. Stored so that we can add a load
767 // flag to requests occurring soon after a gesture to indicate they 784 // flag to requests occurring soon after a gesture to indicate they
768 // may be because of explicit user action. 785 // may be because of explicit user action.
769 base::TimeTicks last_user_gesture_time_; 786 base::TimeTicks last_user_gesture_time_;
770 787
771 ResourceDispatcherHostDelegate* delegate_; 788 ResourceDispatcherHostDelegate* delegate_;
772 789
773 LoaderDelegate* loader_delegate_; 790 LoaderDelegate* loader_delegate_;
774 791
775 bool allow_cross_origin_auth_prompt_; 792 bool allow_cross_origin_auth_prompt_;
(...skipping 18 matching lines...) Expand all
794 811
795 // Whether experimental web platform features are enabled. 812 // Whether experimental web platform features are enabled.
796 bool experimental_web_features_enabled_; 813 bool experimental_web_features_enabled_;
797 814
798 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); 815 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
799 }; 816 };
800 817
801 } // namespace content 818 } // namespace content
802 819
803 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ 820 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698