zip-it-and-ship-it
zip-it-and-ship-it copied to clipboard
Compile metrics about bundling process
Netlify Build shows the duration of the functions bundling process, but we have no granular view that allows us to see where that time is spent across the various functions and the different stages of the process.
This capability would allow developers to identify (and potentially self-serve solutions for) offenders in a slow bundling process, and it would allow us to better troubleshoot problems like #968.
I propose a new metadata
object to be returned by zipFunction
and zipFunctions
, containing a metrics
array of tasks and their duration. Something like:
{
"metadata": {
"metrics": [
{
"function": "function-1",
"stage": "discovery",
"duration": 123
},
{
"function": "function-1",
"stage": "parsing",
"duration": 234
},
{
"function": "function-1",
"stage": "isc",
"duration": 345
},
{
"function": "function-1",
"stage": "traversing",
"duration": 456
},
{
"function": "function-1",
"stage": "zipping",
"duration": 567
}
]
}
}
Netlify Build could then print this object when the verbose mode is enabled.
Nice idea!