Skip to content

Commit 1f17741

Browse files
committed
remove toggle tool. bump up timeouts while i investigate them
Change-Id: I921880b40788863151962d13dc9838c4793a840f
1 parent 31a6cf1 commit 1f17741

5 files changed

Lines changed: 7 additions & 51 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,10 @@ If you run into any issues, checkout our [troubleshooting guide](./docs/troubles
333333
- **Emulation** (2 tools)
334334
- [`emulate`](docs/tool-reference.md#emulate)
335335
- [`resize_page`](docs/tool-reference.md#resize_page)
336-
- **Performance** (4 tools)
336+
- **Performance** (3 tools)
337337
- [`performance_analyze_insight`](docs/tool-reference.md#performance_analyze_insight)
338338
- [`performance_start_trace`](docs/tool-reference.md#performance_start_trace)
339339
- [`performance_stop_trace`](docs/tool-reference.md#performance_stop_trace)
340-
- [`performance_toggle_crux`](docs/tool-reference.md#performance_toggle_crux)
341340
- **Network** (2 tools)
342341
- [`get_network_request`](docs/tool-reference.md#get_network_request)
343342
- [`list_network_requests`](docs/tool-reference.md#list_network_requests)

docs/tool-reference.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
- **[Emulation](#emulation)** (2 tools)
2222
- [`emulate`](#emulate)
2323
- [`resize_page`](#resize_page)
24-
- **[Performance](#performance)** (4 tools)
24+
- **[Performance](#performance)** (3 tools)
2525
- [`performance_analyze_insight`](#performance_analyze_insight)
2626
- [`performance_start_trace`](#performance_start_trace)
2727
- [`performance_stop_trace`](#performance_stop_trace)
28-
- [`performance_toggle_crux`](#performance_toggle_crux)
2928
- **[Network](#network)** (2 tools)
3029
- [`get_network_request`](#get_network_request)
3130
- [`list_network_requests`](#list_network_requests)
@@ -246,16 +245,6 @@
246245

247246
---
248247

249-
### `performance_toggle_crux`
250-
251-
**Description:** Enables or disables the fetching of real-user experience data from the Chrome User Experience Report (CrUX) API during performance traces. When enabled, performance summaries will include field data (LCP, INP, CLS) for the URLs in the trace.
252-
253-
**Parameters:**
254-
255-
- **enabled** (boolean) **(required)**: Whether to enable or disable CrUX data fetching.
256-
257-
---
258-
259248
## Network
260249

261250
### `get_network_request`

src/McpContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ interface McpContextOptions {
6060
experimentalIncludeAllPages?: boolean;
6161
}
6262

63-
const DEFAULT_TIMEOUT = 5_000;
64-
const NAVIGATION_TIMEOUT = 10_000;
63+
const DEFAULT_TIMEOUT = 30_000;
64+
const NAVIGATION_TIMEOUT = 60_000;
6565

6666
function getNetworkMultiplierFromString(condition: string | null): number {
6767
const puppeteerCondition =

src/tools/performance.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import {logger} from '../logger.js';
8-
import {DevTools, zod} from '../third_party/index.js';
8+
import {zod} from '../third_party/index.js';
99
import type {Page} from '../third_party/index.js';
1010
import type {InsightName} from '../trace-processing/parse.js';
1111
import {
@@ -162,39 +162,6 @@ export const analyzeInsight = defineTool({
162162
},
163163
});
164164

165-
export const toggleCrux = defineTool({
166-
name: 'performance_toggle_crux',
167-
description:
168-
'Enables or disables the fetching of real-user experience data from the Chrome User Experience Report (CrUX) API during performance traces. When enabled, performance summaries will include field data (LCP, INP, CLS) for the URLs in the trace.',
169-
annotations: {
170-
category: ToolCategory.PERFORMANCE,
171-
readOnlyHint: false,
172-
},
173-
schema: {
174-
enabled: zod
175-
.boolean()
176-
.describe('Whether to enable or disable CrUX data fetching.'),
177-
},
178-
handler: async (request, response) => {
179-
try {
180-
const settings = DevTools.Common.Settings.Settings.instance();
181-
const cruxSetting = settings.createSetting(
182-
'field-data',
183-
{enabled: false},
184-
DevTools.Common.Settings.SettingStorageType.GLOBAL,
185-
);
186-
cruxSetting.set({...cruxSetting.get(), enabled: request.params.enabled});
187-
response.appendResponseLine(
188-
`CrUX data fetching has been ${request.params.enabled ? 'enabled' : 'disabled'}.`,
189-
);
190-
} catch {
191-
response.appendResponseLine(
192-
'Error: Could not update the CrUX setting. It might not be available in this environment.',
193-
);
194-
}
195-
},
196-
});
197-
198165
async function stopTracingAndAppendOutput(
199166
page: Page,
200167
response: Response,

tests/utils/crux.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ describe('crux util', () => {
6565
const mockCrUXManager = {
6666
getSelectedScope: () => ({pageScope: 'url', deviceScope: 'ALL'}),
6767
};
68-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
68+
6969
sinon
7070
.stub(DevTools.CrUXManager.CrUXManager, 'instance')
71+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
7172
.returns(mockCrUXManager as any);
7273

7374
const settings = DevTools.Common.Settings.Settings.instance();

0 commit comments

Comments
 (0)