Add histogram for OnSwitchesToHttpStreamPool post task
To investigate the linked bug. We use PostTask() to switch to the HttpStreamPool. This post task could be a source of HttpStream creation delay when the network service's IO thread is busy. Bug: 414173943 Change-Id: I73f17617051c5bcbe5d08582d9947c8bb3681edb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6490976 Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org> Commit-Queue: Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1453076}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
c7749f0831
commit
7d12c72ae4
net/http
tools/metrics/histograms/metadata/net
@ -1525,7 +1525,8 @@ void HttpStreamFactory::JobController::SwitchToHttpStreamPool() {
|
||||
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&JobController::CallOnSwitchesToHttpStreamPool,
|
||||
ptr_factory_.GetWeakPtr(), std::move(pool_request_info)));
|
||||
ptr_factory_.GetWeakPtr(), std::move(pool_request_info),
|
||||
base::TimeTicks::Now()));
|
||||
}
|
||||
|
||||
void HttpStreamFactory::JobController::OnPoolPreconnectsComplete(int rv) {
|
||||
@ -1535,10 +1536,14 @@ void HttpStreamFactory::JobController::OnPoolPreconnectsComplete(int rv) {
|
||||
}
|
||||
|
||||
void HttpStreamFactory::JobController::CallOnSwitchesToHttpStreamPool(
|
||||
HttpStreamPoolRequestInfo request_info) {
|
||||
HttpStreamPoolRequestInfo request_info,
|
||||
base::TimeTicks post_task_time) {
|
||||
CHECK(request_);
|
||||
CHECK(delegate_);
|
||||
|
||||
base::UmaHistogramTimes("Net.HttpStreamPool.SwitchesToPoolPostTaskTime",
|
||||
base::TimeTicks::Now() - post_task_time);
|
||||
|
||||
// `request_` and `delegate_` will be reset later.
|
||||
|
||||
delegate_->OnSwitchesToHttpStreamPool(std::move(request_info));
|
||||
|
@ -302,7 +302,8 @@ class HttpStreamFactory::JobController
|
||||
void OnPoolPreconnectsComplete(int rv);
|
||||
|
||||
// Used to call HttpStreamRequest::OnSwitchesToHttpStreamPool() later.
|
||||
void CallOnSwitchesToHttpStreamPool(HttpStreamPoolRequestInfo request_info);
|
||||
void CallOnSwitchesToHttpStreamPool(HttpStreamPoolRequestInfo request_info,
|
||||
base::TimeTicks post_task_time);
|
||||
|
||||
const raw_ptr<HttpStreamFactory> factory_;
|
||||
const raw_ptr<HttpNetworkSession> session_;
|
||||
|
@ -3115,6 +3115,17 @@ chromium-metrics-reviews@google.com.
|
||||
</token>
|
||||
</histogram>
|
||||
|
||||
<histogram name="Net.HttpStreamPool.SwitchesToPoolPostTaskTime" units="ms"
|
||||
expires_after="2025-07-27">
|
||||
<owner>bashi@chromium.org</owner>
|
||||
<owner>blink-network-stack@google.com</owner>
|
||||
<summary>
|
||||
Record the time between when a task to switch to the HttpStreamPool is
|
||||
posted and when it is executed. Recorded when an HttpStreamRequest switched
|
||||
to the HttpStreamPool.
|
||||
</summary>
|
||||
</histogram>
|
||||
|
||||
<histogram name="Net.HttpStreamPool.TcpBasedAttemptCancelCount.{Reason}"
|
||||
units="attempts" expires_after="2025-07-13">
|
||||
<owner>bashi@chromium.org</owner>
|
||||
|
Reference in New Issue
Block a user