rsnext/bench
Dale Bustad e27b7e996d
Telemetry-compatible tracing (#22713)
A number of changes here.  I recommend viewing the diff with the <a href="?w=1">whitespace flag enabled</a>.

- OpenTelemetry is replaced with a custom and lightweight tracing solution.
- Three trace targets are currently supported: console, Zipkin, and NextJS.
- Tracing is now governed by environment variables rather than `--require instrument.js`.
  + `TRACE_TARGET`: one of `CONSOLE`, `ZIPKIN`, or `TELEMETRY`; defaults to `TELEMETRY` if unset or invalid.
  + `TRACE_ID`: an 8-byte hex-encoded value used as the Zipkin trace ID; if not provided, this value will be randomly generated and passed down to subprocesses.

Other sundry:

- I'm missing something, probably a setup step, with the Zipkin target.  Traces are captured successfully, but you have to manually enter the Trace ID in order to view the trace - it doesn't show up in queries.
- I'm generally unhappy with [this commit](235cedcb3e).  It is... untidy to provide a telemetry object via `setGlobal`, but I don't have a ready alternative.  Is `distDir` strictly required when creating a new Telemetry object?  I didn't dig too deep here.

As noted, there are a lot of changes, so it'd be great if a reviewer could:

- [ ] pull down the branch and try to break it
- [ ] check the Zipkin traces and identify possible regressions in the functionality

Closes #22570
Fixes #22574
2021-03-10 21:00:20 +00:00
..
pages Improve linting rules to catch more errors (#9374) 2019-11-10 19:24:53 -08:00
readdir Improve linting rules to catch more errors (#9374) 2019-11-10 19:24:53 -08:00
recursive-copy Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
recursive-delete Improve linting rules to catch more errors (#9374) 2019-11-10 19:24:53 -08:00
capture-trace.js Add Zipkin trace capturing with output to JSON. (#22106) 2021-02-12 09:10:07 +00:00
package.json Replace recursive-copy with own implementation (#7263) 2019-06-06 12:33:11 +02:00
readme.md Move syntax formatting to prettier (#7454) 2019-05-29 13:57:26 +02:00

Next.js server-side benchmarks

Installation

Follow the steps in contributing.md

Both benchmarks use ab. So make sure you have that installed.

Usage

Before running the test:

npm run start

Then run one of these tests:

  • Stateless application which renders <h1>My component!</h1>. Runs 3000 http requests.
npm run bench:stateless
  • Stateless application which renders <li>This is row {i}</li> 10.000 times. Runs 500 http requests.
npm run bench:stateless-big