MCPcopy
hub / github.com/vercel/next.js / reload

Method reload

turbopack/packages/devlow-bench/src/browser.ts:313–341  ·  view source on GitHub ↗
(metricName: string)

Source from the content-addressed store, hash-verified

311 }
312
313 async reload(metricName: string) {
314 const page = this.page
315 if (!page) {
316 throw new Error('reload() must be called after hardNavigation()')
317 }
318 await withRequestMetrics(metricName, page, async () => {
319 await measureTime(`${metricName}/start`)
320 const idle = networkIdle(page, 3000)
321 await page.reload({
322 waitUntil: 'commit',
323 })
324 await measureTime(`${metricName}/html`, {
325 relativeTo: `${metricName}/start`,
326 })
327 await page.waitForLoadState('domcontentloaded')
328 await measureTime(`${metricName}/dom`, {
329 relativeTo: `${metricName}/start`,
330 })
331 await page.waitForLoadState('load')
332 await measureTime(`${metricName}/load`, {
333 relativeTo: `${metricName}/start`,
334 })
335 await idle
336 await measureTime(`${metricName}`, {
337 offset: 3000,
338 relativeTo: `${metricName}/start`,
339 })
340 })
341 }
342}
343
344export async function newBrowserSession(options: {

Callers

nothing calls this directly

Calls 4

measureTimeFunction · 0.90
withRequestMetricsFunction · 0.85
networkIdleFunction · 0.85
reloadMethod · 0.65

Tested by

no test coverage detected