4

I am using Locust to fire a large number of queries to an api. The results of this process are saved as the normal csv files. Since I am running Locust through command line, I have rewritten the response writer and used it directly in my test code.

The only problem I am facing currently is how do I plug this csv with the performance plugin of jenkins so that I have a graph that shows me a graphical result. I have been looking around but it seems jmeter and junit are the only two options that I have. Anyone who has been through this ordeal off lately?

Abhinav
  • 992
  • 2
  • 11
  • 26
  • 1
    As you've noted, the Performance plugin supports only jmeter jtl and junit xml formats. You need to somehow translate your Locust output into one of these formats, or look for a different plugin. Or maybe you can extend your response writer to do this? If plotting is all your care about, there is also the jenkins plot plugin which can consume a CSV file: https://wiki.jenkins-ci.org/display/JENKINS/Plot+Plugin – RaGe Nov 16 '15 at 17:05
  • @RaGe this works!! Can you put your comment as the answer please. – Abhinav Nov 17 '15 at 09:12
  • Glad it worked out for you, how do you find Locust BTW? – RaGe Nov 17 '15 at 15:53
  • Its a powerful tool. The downside being, I cannot export a report directly using CLI, had to copy the export from source and override it to fit my app. If only we could specify load patterns like we can do in Gatling, it will be the best thing out there. – Abhinav Nov 17 '15 at 15:55

2 Answers2

2

The Jenkins performance plugin, as you've noted, is geared towards JMeter and JUnit. It has built in capabilities for JMeter's .jtl files, which are internally XML, and JUnit's .xml files. As far as I can tell there is no capability for .csv files.

You have a couple of options:

  1. You can further modify your response writer to write out XML files that the performance plugin can directly consume

  2. If plot are really all you care about there is the Jenkins Plot plugin that can consume CSV files and draw pretty graphs. Note though that the performance plugin has other features such as response time tracking across builds, which the simpler plot plugin wont do.

RaGe
  • 22,696
  • 11
  • 72
  • 104
1

If the problem is running Locust by Jenkins and seeing the result of the performance test, you can solve the problem by the following:

create a job in Jenkins and add the following shell command:

cd /path/to/locust/file
/usr/local/bin/locust -f myhabit_locust.py --clients=2 --hatch-rate=1 --num-request=50 --no-web --print-stats --only-summary

it gives the result of the test and Jenkins can check it fails or not.

enter image description here

Mesut GUNES
  • 7,089
  • 2
  • 32
  • 49