Unverified Commit 34a40fd9 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Development: Implement request time for Pages Router (#85012)

## What?

Implemented #84906 for Pages Router.
parent b02583b7
......@@ -13,6 +13,7 @@ import * as userland from 'VAR_USERLAND'
import { getTracer, SpanKind } from '../../server/lib/trace/tracer'
import { BaseServerSpan } from '../../server/lib/trace/constants'
import type { InstrumentationOnRequestError } from '../../server/instrumentation/types'
import { addRequestMeta } from '../../server/request-meta'
// Re-export the handler (should be the default export).
export default hoist(userland, 'default')
......@@ -42,6 +43,9 @@ export async function handler(
waitUntil?: (prom: Promise<void>) => void
}
): Promise<void> {
if (routeModule.isDev) {
addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())
}
let srcPage = 'VAR_DEFINITION_PAGE'
// turbopack doesn't normalize `/index` in the page name
......
......@@ -69,6 +69,13 @@ export const getHandler = ({
waitUntil: (prom: Promise<void>) => void
}
): Promise<void> {
if (routeModule.isDev) {
addRequestMeta(
req,
'devRequestTimingInternalsEnd',
process.hrtime.bigint()
)
}
let srcPage = originalSrcPage
// turbopack doesn't normalize `/index` in the page name
// so we need to to process dynamic routes properly
......
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