Skip to content

Conversation

@jdmarshall
Copy link

These changes came about as a result of trying and failing to write benchmarks for parts of prom-client that did not have coverage.

Getting async to work was tricky. Getting benchmark-regression to successfully run in a child process was a slog. The setup
function cannot decide to run only a particular version because it doesn't have any access to that information due to how setup() was implemented outside the normal benchmark.js lifecycle (presumably to support async setup and teardown functions).

This change makes it work well enough to do what I wanted.

In writing it I realized that it would also be useful for anyone writing a benchmark for a function that is missing or broken in one of the versions they are testing. Being able to skip one but keep the others seems useful to me.

Not all code that needs benchmarks is synchronous.
This will mostly be useful for adding benchmarks that cover
features that only exist in certain versions. However it was first
conceived when trying to write tests for cluster mode, where you
only want the child process to run the same tests as the parent
process is currently running.
@jdmarshall
Copy link
Author

Reference siimon/prom-client#680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant