Nugget 6: Load Test WEB API with NBomber
This note incursions into load testing WEB API endpoints using a novel framework, designed to test Pull and Push scenarios regardless of the protocol used (HTTP/WebSockets/AMQP, etc). For this example, a Web API controller ( SuppliersController ) was created with two similar endpoints. The system is based on the Northwind database. The difference between these endpoints is that GetSuppliers() projects suppliers and their products into data transfer objects using AutoMapper, and the second one, GetUserSuppliers() returns a collection of entities ignoring reference looping and the context is configured for no proxy creation. To use NBomber create a console application and add the following packages: To load test the above endpoints a class SupplierControllerTest was added to the project. Note that the client requires authorization to use these endpoints This is not required but adds some realism to the test. NBomber collects information from the execution of the scenario lambd...