An example project that utilizes JMeter to simulate client requests for an Express.js server.
JMeter
- Install JMeter
- Symlink jmeter to your
/usr/local/bin/directory
ln -s ~/Downloads/apache-jmeter-5.4.1/bin/jmeter /usr/local/bin/jmeterNode.js
Run the following from the root directory
- Install dependencies,
npm install
Run the following from the node-example-api directory
- Install dependencies,
npm install - To run a dev build,
npm run dev - To create a production build,
npm run build - To run a production build,
npm start
- To start a load test, ensure the Express server is running.
- Run
npm run ntland select one ofjmeter:simulate:<command>scripts. May require achmodto change file permissions to execute the shell scripts. - Monitor and observe any of the following:
- JMeter reports in the
reportsdirectory. Runnpm run ntland select a report to view in browser - Sample logs in
samplesdirectory - Output logs in
logs/jmeter.log - Express server logs in its running terminal
- JMeter reports in the
Looking for what each npm script does? Try npm run ntl to select a script to run from a list of commands and their descriptions.
2021_08_13_jmeter_example_run.mov
Logs are recorded in the logs directory and sample results are recorded in the samples directory.
Thread group specific dashboard reports are output to the reports directory.
Note: The reports directory and its subdirectories are created by the postinstall npm script.