Skip to content

Commit

Permalink
Fix router CPU profiling (#54497)
Browse files Browse the repository at this point in the history
Since we've merged the app and router processes, the `__NEXT_PRIVATE_CPU_PROFILE` env was missing.
  • Loading branch information
shuding authored Aug 27, 2023
1 parent 40b3226 commit 52e0b1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/next/src/server/lib/start-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import {
import { checkIsNodeDebugging } from './is-node-debugging'
const debug = setupDebug('next:start-server')

if (process.env.NEXT_CPU_PROF) {
process.env.__NEXT_PRIVATE_CPU_PROFILE = `CPU.router`
require('./cpu-profile')
}

export interface StartServerOptions {
dir: string
port: number
Expand Down

0 comments on commit 52e0b1d

Please sign in to comment.