Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance testing of dotnet core WebAPI

I was wondering if there are any tools worth of trying to test dotnet core WebAPI performance during high load.

In the past I used jMeter of Apache, but configuring that alongside with TeamCity and dotnet core builds is a bit of pain.

I am looking for something that could deliver statistics, so automated run of tests can give me information if recent changes have or haven't decreased performance etc.

I also did a quick google, VisualStudio has something on board, but first of all it requires Enterprise edition of software, and I am not convinced if that tool is good enough.

Thank you

like image 525
madoxdev Avatar asked Sep 22 '17 20:09

madoxdev


People also ask

How do you do performance testing with API?

To run API performance tests well, you'll need to write multiple types of tests. The good news is that you can simplify this process by extending your API functional tests into API functional load tests, which provide the most nuanced level of insight into your API's overall performance.


1 Answers

Take a look at https://github.com/dotnet/BenchmarkDotNet - it's a widely used and respected library.

If your goal is to test WebAPI you can create a HttpClient and use it for making calls to the API, wrap it in a benchmark and run it on TeamCity as a simple dotnet step.

The tool also can create reports in HTML which then can be added to TeamCity as a custom tab.

If it's not enough then you can extract performance metrics e.g. from PlainExporter and integrate it with TeamCity built-in Service Messages and create Custom Charts from those stats so TeamCity will help you track performance trends.

You could even act on those measures and e.g. fail the build if there is a significant performance degradation.

like image 81
Chris Najda Avatar answered Oct 24 '22 10:10

Chris Najda