diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-20 13:40:20 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-22 12:41:23 +0000 |
commit | 7961cea6d1041e3e454dae6a1da660b453efd238 (patch) | |
tree | c0eeb4a9ff9ba32986289c1653d9608e53ccb444 /chromium/services/network/keepalive_statistics_recorder.cc | |
parent | b7034d0803538058e5c9d904ef03cf5eab34f6ef (diff) | |
download | qtwebengine-chromium-7961cea6d1041e3e454dae6a1da660b453efd238.tar.gz |
BASELINE: Update Chromium to 78.0.3904.130
Change-Id: If185e0c0061b3437531c97c9c8c78f239352a68b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/services/network/keepalive_statistics_recorder.cc')
-rw-r--r-- | chromium/services/network/keepalive_statistics_recorder.cc | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/chromium/services/network/keepalive_statistics_recorder.cc b/chromium/services/network/keepalive_statistics_recorder.cc index 8bb6f4e548d..df2c209957f 100644 --- a/chromium/services/network/keepalive_statistics_recorder.cc +++ b/chromium/services/network/keepalive_statistics_recorder.cc @@ -6,13 +6,17 @@ #include <algorithm> +#include "base/feature_list.h" #include "base/metrics/histogram_macros.h" +#include "services/network/public/cpp/features.h" namespace network { KeepaliveStatisticsRecorder::KeepaliveStatisticsRecorder() { - UMA_HISTOGRAM_COUNTS_1000( - "Net.KeepaliveStatisticsRecorder.PeakInflightRequests2", 0); + if (!base::FeatureList::IsEnabled(features::kDisableKeepaliveFetch)) { + UMA_HISTOGRAM_COUNTS_1000( + "Net.KeepaliveStatisticsRecorder.PeakInflightRequests2", 0); + } } KeepaliveStatisticsRecorder::~KeepaliveStatisticsRecorder() = default; @@ -20,8 +24,10 @@ void KeepaliveStatisticsRecorder::Register(int process_id) { auto it = per_process_records_.find(process_id); if (it == per_process_records_.end()) { per_process_records_.insert(std::make_pair(process_id, PerProcessStats())); - UMA_HISTOGRAM_COUNTS_100( - "Net.KeepaliveStatisticsRecorder.PeakInflightRequestsPerProcess2", 0); + if (!base::FeatureList::IsEnabled(features::kDisableKeepaliveFetch)) { + UMA_HISTOGRAM_COUNTS_100( + "Net.KeepaliveStatisticsRecorder.PeakInflightRequestsPerProcess2", 0); + } return; } @@ -33,9 +39,11 @@ void KeepaliveStatisticsRecorder::Unregister(int process_id) { DCHECK(it != per_process_records_.end()); if (it->second.num_registrations == 1) { - UMA_HISTOGRAM_COUNTS_100( - "Net.KeepaliveStatisticsRecorder.PeakInflightRequestsPerProcess", - it->second.peak_inflight_requests); + if (!base::FeatureList::IsEnabled(features::kDisableKeepaliveFetch)) { + UMA_HISTOGRAM_COUNTS_100( + "Net.KeepaliveStatisticsRecorder.PeakInflightRequestsPerProcess", + it->second.peak_inflight_requests); + } per_process_records_.erase(it); return; @@ -49,17 +57,21 @@ void KeepaliveStatisticsRecorder::OnLoadStarted(int process_id) { ++it->second.num_inflight_requests; if (it->second.peak_inflight_requests < it->second.num_inflight_requests) { it->second.peak_inflight_requests = it->second.num_inflight_requests; - UMA_HISTOGRAM_COUNTS_100( - "Net.KeepaliveStatisticsRecorder.PeakInflightRequestsPerProcess2", - it->second.peak_inflight_requests); + if (!base::FeatureList::IsEnabled(features::kDisableKeepaliveFetch)) { + UMA_HISTOGRAM_COUNTS_100( + "Net.KeepaliveStatisticsRecorder.PeakInflightRequestsPerProcess2", + it->second.peak_inflight_requests); + } } } ++num_inflight_requests_; if (peak_inflight_requests_ < num_inflight_requests_) { peak_inflight_requests_ = num_inflight_requests_; - UMA_HISTOGRAM_COUNTS_1000( - "Net.KeepaliveStatisticsRecorder.PeakInflightRequests2", - peak_inflight_requests_); + if (!base::FeatureList::IsEnabled(features::kDisableKeepaliveFetch)) { + UMA_HISTOGRAM_COUNTS_1000( + "Net.KeepaliveStatisticsRecorder.PeakInflightRequests2", + peak_inflight_requests_); + } } } |