Skip to content

Commit d0ba98e

Browse files
Adam RaineDevtools-frontend LUCI CQ
authored andcommitted
[RPP Observations] Remove live metrics experiment
- This also removes the legacy performance panel landing page - Live metrics are explicitly disabled in node environments Bug: 377235479 Change-Id: I5bc34c72bf92f4ca0c657d503aae0e3a05cf8d9f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6035862 Reviewed-by: Jack Franklin <[email protected]> Auto-Submit: Adam Raine <[email protected]> Commit-Queue: Adam Raine <[email protected]>
1 parent 9d4bac6 commit d0ba98e

File tree

16 files changed

+31
-256
lines changed

16 files changed

+31
-256
lines changed

config/gni/devtools_grd_files.gni

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,6 @@ grd_files_debug_sources = [
18051805
"front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.js",
18061806
"front_end/panels/timeline/TimelineFlameChartView.js",
18071807
"front_end/panels/timeline/TimelineHistoryManager.js",
1808-
"front_end/panels/timeline/TimelineLandingPage.js",
18091808
"front_end/panels/timeline/TimelineLayersView.js",
18101809
"front_end/panels/timeline/TimelineLoader.js",
18111810
"front_end/panels/timeline/TimelineMiniMap.js",

front_end/core/host/UserMetrics.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,6 @@ export enum DevtoolsExperiments {
10141014
'timeline-compiled-sources' = 91,
10151015
'timeline-debug-mode' = 93,
10161016
'timeline-rpp-sidebar' = 95,
1017-
'timeline-observations' = 96,
10181017
'timeline-server-timings' = 98,
10191018
'floating-entry-points-for-ai-assistance' = 101,
10201019
'timeline-experimental-insights' = 102,

front_end/core/root/Runtime.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ export const enum ExperimentName {
295295
TIMELINE_SHOW_POST_MESSAGE_EVENTS = 'timeline-show-postmessage-events',
296296
TIMELINE_INSIGHTS = 'timeline-rpp-sidebar',
297297
TIMELINE_DEBUG_MODE = 'timeline-debug-mode',
298-
TIMELINE_OBSERVATIONS = 'timeline-observations',
299298
TIMELINE_ENHANCED_TRACES = 'timeline-enhanced-traces',
300299
TIMELINE_SERVER_TIMINGS = 'timeline-server-timings',
301300
FLOATING_ENTRY_POINTS_FOR_AI_ASSISTANCE = 'floating-entry-points-for-ai-assistance',

front_end/entrypoints/main/MainImpl.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,6 @@ export class MainImpl {
384384
'Performance panel: enable performance insights',
385385
);
386386

387-
Root.Runtime.experiments.register(
388-
Root.Runtime.ExperimentName.TIMELINE_OBSERVATIONS,
389-
'Performance panel: enable live metrics landing page',
390-
);
391-
392387
Root.Runtime.experiments.register(
393388
Root.Runtime.ExperimentName.TIMELINE_SERVER_TIMINGS,
394389
'Performance panel: enable server timings in the timeline',
@@ -422,7 +417,6 @@ export class MainImpl {
422417
'css-type-component-length-deprecate',
423418
Root.Runtime.ExperimentName.AUTOFILL_VIEW,
424419
Root.Runtime.ExperimentName.TIMELINE_INSIGHTS,
425-
Root.Runtime.ExperimentName.TIMELINE_OBSERVATIONS,
426420
Root.Runtime.ExperimentName.NETWORK_PANEL_FILTER_BAR_REDESIGN,
427421
Root.Runtime.ExperimentName.FLOATING_ENTRY_POINTS_FOR_AI_ASSISTANCE,
428422
...(Root.Runtime.Runtime.queryParam('isChromeForTesting') ? ['protocol-monitor'] : []),
@@ -550,10 +544,8 @@ export class MainImpl {
550544

551545
AutofillManager.AutofillManager.AutofillManager.instance();
552546

553-
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_OBSERVATIONS)) {
554-
LiveMetrics.LiveMetrics.instance({forceNew: true});
555-
CrUXManager.CrUXManager.instance({forceNew: true});
556-
}
547+
LiveMetrics.LiveMetrics.instance();
548+
CrUXManager.CrUXManager.instance();
557549

558550
new PauseListener();
559551

front_end/models/live-metrics/LiveMetrics.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as Common from '../../core/common/common.js';
66
import * as Host from '../../core/host/host.js';
77
import * as i18n from '../../core/i18n/i18n.js';
88
import * as Platform from '../../core/platform/platform.js';
9-
import * as Root from '../../core/root/root.js';
109
import * as SDK from '../../core/sdk/sdk.js';
1110
import type * as Protocol from '../../generated/protocol.js';
1211
import * as EmulationModel from '../../models/emulation/emulation.js';
@@ -62,7 +61,7 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
6261
SDK.TargetManager.TargetManager.instance().observeTargets(this);
6362
}
6463

65-
static instance(opts: {forceNew: boolean|null} = {forceNew: null}): LiveMetrics {
64+
static instance(opts: {forceNew?: boolean} = {forceNew: false}): LiveMetrics {
6665
const {forceNew} = opts;
6766
if (!liveMetricsInstance || forceNew) {
6867
liveMetricsInstance = new LiveMetrics();
@@ -472,10 +471,6 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
472471
}
473472

474473
async enable(): Promise<void> {
475-
if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_OBSERVATIONS)) {
476-
return;
477-
}
478-
479474
if (Host.InspectorFrontendHost.isUnderTest()) {
480475
// Enabling this impacts a lot of layout tests; we will work on fixing
481476
// them but for now it is easier to not run this page in layout tests.
@@ -487,6 +482,11 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
487482
return;
488483
}
489484

485+
// Only frame targets will actually give us CWV
486+
if (this.#target.type() !== SDK.Target.Type.FRAME) {
487+
return;
488+
}
489+
490490
const domModel = this.#target.model(SDK.DOMModel.DOMModel);
491491
if (!domModel) {
492492
return;

front_end/panels/timeline/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ devtools_module("timeline") {
8585
"TimelineFlameChartNetworkDataProvider.ts",
8686
"TimelineFlameChartView.ts",
8787
"TimelineHistoryManager.ts",
88-
"TimelineLandingPage.ts",
8988
"TimelineLayersView.ts",
9089
"TimelineLoader.ts",
9190
"TimelineMiniMap.ts",

front_end/panels/timeline/TimelineHistoryManager.test.ts

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import * as Root from '../../core/root/root.js';
65
import {
76
describeWithEnvironment,
87
registerNoopActions,
@@ -21,12 +20,9 @@ describeWithEnvironment('TimelineHistoryManager', function() {
2120

2221
afterEach(() => {
2322
UI.ActionRegistry.ActionRegistry.reset();
24-
Root.Runtime.experiments.disableForTest(Root.Runtime.ExperimentName.TIMELINE_OBSERVATIONS);
25-
historyManager.cancelIfShowing();
2623
});
2724

28-
it('shows the dropdown including a landing page link if the observations experiment is enabled', async function() {
29-
Root.Runtime.experiments.enableForTest(Root.Runtime.ExperimentName.TIMELINE_OBSERVATIONS);
25+
it('shows the dropdown including a landing page link', async function() {
3026
const {parsedTrace, metadata} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');
3127
historyManager.addRecording(
3228
{
@@ -57,76 +53,6 @@ describeWithEnvironment('TimelineHistoryManager', function() {
5753
await showPromise;
5854
});
5955

60-
it('does not show if observations experiment is disabled + the user has not imported 2 traces', async function() {
61-
const {parsedTrace, metadata} = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');
62-
historyManager.addRecording(
63-
{
64-
data: {
65-
parsedTraceIndex: 1,
66-
type: 'TRACE_INDEX',
67-
},
68-
filmStripForPreview: null,
69-
parsedTrace,
70-
metadata,
71-
},
72-
);
73-
74-
const promise = historyManager.showHistoryDropDown();
75-
const glassPane = document.querySelector('div[data-devtools-glass-pane]');
76-
assert.isNull(glassPane); // check that no DOM for the dropdown got created
77-
// check the result of calling showHistoryDropDown which should be `null` if it didn't show
78-
const result = await promise;
79-
assert.isNull(result);
80-
});
81-
82-
it('does not show the landing page link if the observations experiment is disabled', async function() {
83-
const {parsedTrace: parsedTrace1, metadata: metadata1} =
84-
await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');
85-
historyManager.addRecording(
86-
{
87-
data: {
88-
parsedTraceIndex: 1,
89-
type: 'TRACE_INDEX',
90-
},
91-
filmStripForPreview: null,
92-
parsedTrace: parsedTrace1,
93-
metadata: metadata1,
94-
},
95-
);
96-
const {parsedTrace: parsedTrace2, metadata: metadata2} =
97-
await TraceLoader.traceEngine(this, 'timings-track.json.gz');
98-
historyManager.addRecording(
99-
{
100-
data: {
101-
parsedTraceIndex: 2,
102-
type: 'TRACE_INDEX',
103-
},
104-
filmStripForPreview: null,
105-
parsedTrace: parsedTrace2,
106-
metadata: metadata2,
107-
},
108-
);
109-
110-
const showPromise = historyManager.showHistoryDropDown();
111-
const glassPane = document.querySelector('div[data-devtools-glass-pane]');
112-
const dropdown =
113-
glassPane?.shadowRoot?.querySelector('.widget')?.shadowRoot?.querySelector<HTMLElement>('.drop-down');
114-
assert.isOk(dropdown);
115-
116-
const menuItemText = Array.from(dropdown.querySelectorAll<HTMLDivElement>('[role="menuitem"]'), elem => {
117-
return elem.innerText.replaceAll('\n', '');
118-
});
119-
assert.deepEqual(menuItemText, [
120-
'localhost',
121-
'web.dev1× slowdown, No throttling',
122-
]);
123-
124-
// Cancel the dropdown, which also resolves the show() promise, meaning we
125-
// don't leak it into other tests.
126-
historyManager.cancelIfShowing();
127-
await showPromise;
128-
});
129-
13056
it('can select from multiple parsed data objects', async function() {
13157
// Add two parsed data objects to the history manager.
13258
const {parsedTrace: trace1Data, metadata: metadata1} =

front_end/panels/timeline/TimelineHistoryManager.ts

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import * as Common from '../../core/common/common.js';
66
import * as i18n from '../../core/i18n/i18n.js';
77
import * as Platform from '../../core/platform/platform.js';
8-
import * as Root from '../../core/root/root.js';
98
import * as CrUXManager from '../../models/crux-manager/crux-manager.js';
109
import type * as Trace from '../../models/trace/trace.js';
1110
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
@@ -40,10 +39,6 @@ const UIStrings = {
4039
*@description the title shown when the user is viewing the landing page which is showing live performance metrics that are updated automatically.
4140
*/
4241
landingPageTitle: 'Live metrics',
43-
/**
44-
*@description Text that shows there is no recording
45-
*/
46-
noRecordings: '(no recordings)',
4742
/**
4843
*@description Text in Timeline History Manager of the Performance panel
4944
*@example {example.com} PH1
@@ -230,28 +225,10 @@ export class TimelineHistoryManager {
230225
this.recordings = [];
231226
this.lastActiveTrace = null;
232227
this.updateState();
233-
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_OBSERVATIONS)) {
234-
this.buttonInternal.setText(i18nString(UIStrings.landingPageTitle));
235-
} else {
236-
this.buttonInternal.setText(i18nString(UIStrings.noRecordings));
237-
}
228+
this.buttonInternal.setText(i18nString(UIStrings.landingPageTitle));
238229
this.nextNumberByDomain.clear();
239230
}
240231

241-
/**
242-
* If the observations landing page experiment is enabled, we show the
243-
* dropdown when there is 1 or more traces active, as even with 1 trace we
244-
* need to give the user a way to get back to the index page. However, if that
245-
* experiment is disabled, there is no need to show the dropdown until there
246-
* are 2+ traces.
247-
*/
248-
#minimumRequiredRecordings(): number {
249-
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_OBSERVATIONS)) {
250-
return 1;
251-
}
252-
return 2;
253-
}
254-
255232
#getActiveTraceIndexForListControl(): number {
256233
if (!this.lastActiveTrace) {
257234
return -1;
@@ -263,7 +240,7 @@ export class TimelineHistoryManager {
263240
}
264241

265242
async showHistoryDropDown(): Promise<RecordingData|null> {
266-
if (this.recordings.length < this.#minimumRequiredRecordings() || !this.enabled) {
243+
if (this.recordings.length < 1 || !this.enabled) {
267244
return null;
268245
}
269246

@@ -346,7 +323,7 @@ export class TimelineHistoryManager {
346323
}
347324

348325
private updateState(): void {
349-
this.action.setEnabled(this.recordings.length >= this.#minimumRequiredRecordings() && this.enabled);
326+
this.action.setEnabled(this.recordings.length >= 1 && this.enabled);
350327
}
351328

352329
static previewElement(parsedTraceIndex: number): Element {
@@ -522,9 +499,7 @@ export class DropDown implements UI.ListControl.ListDelegate<number> {
522499
return Promise.resolve(null);
523500
}
524501
const availableDropdownChoices = [...availableparsedTraceIndexes];
525-
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_OBSERVATIONS)) {
526-
availableDropdownChoices.unshift(LANDING_PAGE_INDEX_DROPDOWN_CHOICE);
527-
}
502+
availableDropdownChoices.unshift(LANDING_PAGE_INDEX_DROPDOWN_CHOICE);
528503
const instance = new DropDown(availableDropdownChoices);
529504
return instance.show(anchor, activeparsedTraceIndex);
530505
}

front_end/panels/timeline/TimelineLandingPage.ts

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)