Commit 1e5a1bb6 authored by John Delaney's avatar John Delaney Committed by Chromium LUCI CQ

Update expiry of heavy ads histograms

Update expiry of PageLoad.HeavyAds.ComputedTypeWithThresholdNoise and
PageLoad.HeavyAds.InterventionType as they are still used to measure
impact of heavy ad intervention.

PageLoad.HeavyAds.ComputedType2 is no longer needed and is obsoleted.

Bug: 1160766,1160767,1160768
Change-Id: I5bdc902b7fee7915741d80110dc64c3c2ecde933
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2638104Reviewed-by: default avatarJosh Karlin <jkarlin@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Commit-Queue: John Delaney <johnidel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845269}
parent cc309e31
......@@ -1203,8 +1203,6 @@ void AdsPageLoadMetricsObserver::RecordPerFrameHistogramsForHeavyAds(
// Record per-frame histograms to the appropriate visibility prefixes.
for (const auto visibility : {ad_metrics::FrameVisibility::kAnyVisibility,
ad_frame_data.visibility()}) {
ADS_HISTOGRAM("HeavyAds.ComputedType2", UMA_HISTOGRAM_ENUMERATION,
visibility, ad_frame_data.heavy_ad_status());
ADS_HISTOGRAM("HeavyAds.ComputedTypeWithThresholdNoise",
UMA_HISTOGRAM_ENUMERATION, visibility,
ad_frame_data.heavy_ad_status_with_noise());
......@@ -1378,7 +1376,8 @@ void AdsPageLoadMetricsObserver::MaybeTriggerHeavyAdIntervention(
// Record heavy ad network size only when an ad is unloaded as a result of
// network usage.
if (frame_data->heavy_ad_status() == ad_metrics::HeavyAdStatus::kNetwork) {
if (frame_data->heavy_ad_status_with_noise() ==
ad_metrics::HeavyAdStatus::kNetwork) {
ADS_HISTOGRAM("HeavyAds.NetworkBytesAtFrameUnload", PAGE_BYTES_HISTOGRAM,
ad_metrics::kAnyVisibility,
frame_data->resource_data().network_bytes());
......
......@@ -2042,17 +2042,6 @@ TEST_F(AdsPageLoadMetricsObserverTest, HeavyAdFeatureOff_UMARecorded) {
NavigateFrame(kNonAdUrl, main_frame);
using HeavyAdStatus = ad_metrics::HeavyAdStatus;
histogram_tester().ExpectTotalCount(
SuffixedHistogram("HeavyAds.ComputedType2"), 4);
histogram_tester().ExpectBucketCount(
SuffixedHistogram("HeavyAds.ComputedType2"), HeavyAdStatus::kNone, 1);
histogram_tester().ExpectBucketCount(
SuffixedHistogram("HeavyAds.ComputedType2"), HeavyAdStatus::kNetwork, 1);
histogram_tester().ExpectBucketCount(
SuffixedHistogram("HeavyAds.ComputedType2"), HeavyAdStatus::kPeakCpu, 1);
histogram_tester().ExpectBucketCount(
SuffixedHistogram("HeavyAds.ComputedType2"), HeavyAdStatus::kTotalCpu, 1);
histogram_tester().ExpectTotalCount(
SuffixedHistogram("HeavyAds.ComputedTypeWithThresholdNoise"), 4);
histogram_tester().ExpectBucketCount(
......@@ -2304,9 +2293,6 @@ TEST_F(AdsPageLoadMetricsObserverTest,
// Navigate again to trigger histograms.
NavigateFrame(kNonAdUrl, main_frame);
histogram_tester().ExpectUniqueSample(
SuffixedHistogram("HeavyAds.ComputedType2"),
ad_metrics::HeavyAdStatus::kNetwork, 1);
histogram_tester().ExpectUniqueSample(
SuffixedHistogram("HeavyAds.ComputedTypeWithThresholdNoise"),
ad_metrics::HeavyAdStatus::kNone, 1);
......@@ -2360,9 +2346,6 @@ TEST_F(AdsPageLoadMetricsObserverTest,
// Navigate again to trigger histograms.
NavigateFrame(kNonAdUrl, main_frame);
histogram_tester().ExpectUniqueSample(
SuffixedHistogram("HeavyAds.ComputedType2"),
ad_metrics::HeavyAdStatus::kNetwork, 1);
histogram_tester().ExpectUniqueSample(
SuffixedHistogram("HeavyAds.ComputedTypeWithThresholdNoise"),
ad_metrics::HeavyAdStatus::kTotalCpu, 1);
......@@ -2494,7 +2477,7 @@ TEST_F(AdsPageLoadMetricsObserverTest,
NavigateFrame(kNonAdUrl, main_frame);
histogram_tester().ExpectUniqueSample(
SuffixedHistogram("HeavyAds.ComputedType2"),
SuffixedHistogram("HeavyAds.ComputedTypeWithThresholdNoise"),
ad_metrics::HeavyAdStatus::kNone, 1);
}
......
......@@ -368,12 +368,6 @@ HeavyAdAction FrameTreeData::MaybeTriggerHeavyAdIntervention() {
return HeavyAdAction::kNone;
}
// Update heavy ad related metrics. Metrics are reported for all thresholds,
// regardless of unload policy.
if (heavy_ad_status_ == HeavyAdStatus::kNone) {
heavy_ad_status_ = ComputeHeavyAdStatus(
false /* use_network_threshold_noise */, HeavyAdUnloadPolicy::kAll);
}
if (heavy_ad_status_with_noise_ == HeavyAdStatus::kNone) {
heavy_ad_status_with_noise_ = ComputeHeavyAdStatus(
true /* use_network_threshold_noise */, HeavyAdUnloadPolicy::kAll);
......
......@@ -378,8 +378,6 @@ class FrameTreeData : public base::SupportsWeakPtr<FrameTreeData> {
bool SetEarliestFirstContentfulPaint(
base::Optional<base::TimeDelta> time_stamp);
HeavyAdStatus heavy_ad_status() const { return heavy_ad_status_; }
HeavyAdStatus heavy_ad_status_with_noise() const {
return heavy_ad_status_with_noise_;
}
......@@ -460,10 +458,7 @@ class FrameTreeData : public base::SupportsWeakPtr<FrameTreeData> {
base::Optional<base::TimeDelta> earliest_first_contentful_paint_;
// Indicates whether or not this frame met the criteria for the heavy ad
// intervention.
HeavyAdStatus heavy_ad_status_ = HeavyAdStatus::kNone;
// Same as |heavy_ad_status_| but uses additional additive noise for the
// intervention with additional additive noise for the
// network threshold. A frame can be considered a heavy ad by
// |heavy_ad_status_| but not |heavy_ad_status_with_noise_|. The noised
// threshold is used when determining whether to actually trigger the
......
......@@ -1358,6 +1358,10 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram base="true" name="PageLoad.HeavyAds.ComputedType2"
enum="HeavyAdStatus2" expires_after="2021-02-01">
<obsolete>
Removed 01/2020, use PageLoad.HeavyAds.ComputedTypeWithThresholdNoise
instead.
</obsolete>
<owner>johnidel@chromium.org</owner>
<owner>jkarlin@chromium.org</owner>
<summary>
......@@ -1373,7 +1377,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</histogram>
<histogram base="true" name="PageLoad.HeavyAds.ComputedTypeWithThresholdNoise"
enum="HeavyAdStatus2" expires_after="2021-02-01">
enum="HeavyAdStatus2" expires_after="2022-02-01">
<owner>johnidel@chromium.org</owner>
<owner>jkarlin@chromium.org</owner>
<summary>
......@@ -1393,7 +1397,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</histogram>
<histogram base="true" name="PageLoad.HeavyAds.InterventionType2"
enum="HeavyAdStatus2" expires_after="2021-02-01">
enum="HeavyAdStatus2" expires_after="2022-02-01">
<owner>johnidel@chromium.org</owner>
<owner>jkarlin@chromium.org</owner>
<summary>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment