Understanding build trace file
Unanswered
Yellow croaker posted this in #help-forum
Yellow croakerOP
Hello, I am trying to understand and improve my build time.
I have an app that uses SSG and I have +/- 2000 pages. It takes nearly 25minutes to build.
I am looking to my .next/trace file and i see something like this ( It's just a bit ):
{
"traceId": "4294deaff51d960b",
"parentId": 136,
"name": "export-page",
"id": 1527,
"timestamp": 457547305423,
"duration": 713952097,
"tags": {
"path": "/en/abc"
},
"startTime": 1703624373633
}, {
"traceId": "4294deaff51d960b",
"parentId": 136,
"name": "export-page",
"id": 1530,
"timestamp": 457547305440,
"duration": 714952827,
"tags": {
"path": "/en/abcd"
},
"startTime": 1703624373633
}, {
"traceId": "4294deaff51d960b",
"parentId": 136,
"name": "export-page",
"id": 1522,
"timestamp": 457547305394,
"duration": 715170184,
"tags": {
"path": "/en/abcde"
},
"startTime": 1703624373633
}
so, the startTime is the same for 150 pages, is this right ? in build time does next make 150 request's at the same time ?
another question, the duration property, example 715170184. this is what ? ( it is not milliseconds, that I am sure )
and the timestamp property, what is ?
thank you all 🙂
I have an app that uses SSG and I have +/- 2000 pages. It takes nearly 25minutes to build.
I am looking to my .next/trace file and i see something like this ( It's just a bit ):
{
"traceId": "4294deaff51d960b",
"parentId": 136,
"name": "export-page",
"id": 1527,
"timestamp": 457547305423,
"duration": 713952097,
"tags": {
"path": "/en/abc"
},
"startTime": 1703624373633
}, {
"traceId": "4294deaff51d960b",
"parentId": 136,
"name": "export-page",
"id": 1530,
"timestamp": 457547305440,
"duration": 714952827,
"tags": {
"path": "/en/abcd"
},
"startTime": 1703624373633
}, {
"traceId": "4294deaff51d960b",
"parentId": 136,
"name": "export-page",
"id": 1522,
"timestamp": 457547305394,
"duration": 715170184,
"tags": {
"path": "/en/abcde"
},
"startTime": 1703624373633
}
so, the startTime is the same for 150 pages, is this right ? in build time does next make 150 request's at the same time ?
another question, the duration property, example 715170184. this is what ? ( it is not milliseconds, that I am sure )
and the timestamp property, what is ?
thank you all 🙂
1 Reply
Toyger
nextjs use process.hrtime for this
https://nodejs.org/api/process.html#processhrtimetime
so duration is nanoseconds
and timestamp is inner value from hrtime, from their docs
and startTime can be possibly same for all
https://nodejs.org/api/process.html#processhrtimetime
so duration is nanoseconds
and timestamp is inner value from hrtime, from their docs
These times are relative to an arbitrary time in the past, and not related to the time of day and therefore not subject to clock drift. The primary use is for measuring performance between intervals:and startTime can be possibly same for all