HTTPArchive / custom-metrics

Custom metrics to use with WebPageTest agents
Apache License 2.0
19 stars 22 forks source link

Observe constructor calls #31

Closed kevinfarrugia closed 2 years ago

kevinfarrugia commented 2 years ago

Required for JavaScript 2022

Added support to count the number of times the Worker constructor is called. Code is setup to support additional constructors if needed.

Test: https://webpagetest.httparchive.org/result/220527_E9_5/1/details/#waterfall_view_step1

Uses custom metric:

[worker]
return JSON.stringify(httparchive_observers.constructor_stacks["Worker"]);

Results include:

worker 1
kevinfarrugia commented 2 years ago

@rviscomi The linter might be too lenient. On the source branch there was no indentation and it was not flagged.

rviscomi commented 2 years ago

Oh sorry I didn't realize merging the other PR would close this 😞

Is there a way to change the destination to main to reopen the PR?

kevinfarrugia commented 2 years ago

Created a new PR #35