zip-it-and-ship-it icon indicating copy to clipboard operation
zip-it-and-ship-it copied to clipboard

Compile metrics about bundling process

Open eduardoboucas opened this issue 2 years ago • 1 comments

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.

eduardoboucas avatar Jan 28 '22 11:01 eduardoboucas

Nice idea!

ehmicky avatar Jan 28 '22 14:01 ehmicky