2

I have a Django-app built in API style, and I need benchmark it. I want to use django unitetesting library to build becnhmarks as tests for API endpoints. They will use Django-test-client for querying endpoints and collect data about SQL queries and their timing, and save it somwhere.

Is it sane idea at all? Also I want to see timings for Python code with stacktraces, and see which code causes which SQL queries. Could somebody know approaches to collect such information without modifications in code of app?

Gill Bates
  • 14,330
  • 23
  • 70
  • 138

1 Answers1

1

Just an option, that I've used before: nose and it's --with-xunit plugin:

This plugin provides test results in the standard XUnit XML format.

In the test results you'll see running time for each test case, stack traces for failures etc.

Also, django-debug-toolbar and django database logging might help you with getting data about SQL queries.

Also there are other suggestions here:

Hope that helps.

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195