Skip to content

The result visualizing tools are now implemented

Pre-release
Pre-release
Compare
Choose a tag to compare
@NyanKiyoshi NyanKiyoshi released this 12 May 16:43
· 58 commits to master since this release
  • Introduced the cli (#3) with two commands:
    • show that process a given benchmark result to render a summary table
    • html render the table in HTML, the template can be customized using --template <path>
Usage: django-queries [OPTIONS] COMMAND [ARGS]...

  Command line tool for pytest-django-queries.

Options:
  --help  Show this message and exit.

Commands:
  html  Render the results as HTML instead of a raw table.
  show  View a given rapport.

Visualising Results

You can generate a table from the tests results by using the show command:

django-queries show <json file>

You will get something like this to represent the results:

+---------+-------------------------+
| Module  |          Tests          |
+---------+-------------------------+
| module1 | +-----------+---------+ |
|         | | Test Name | Queries | |
|         | +-----------+---------+ |
|         | |   test1   |    0    | |
|         | +-----------+---------+ |
|         | |   test2   |    1    | |
|         | +-----------+---------+ |
+---------+-------------------------+
| module2 | +-----------+---------+ |
|         | | Test Name | Queries | |
|         | +-----------+---------+ |
|         | |   test1   |   123   | |
|         | +-----------+---------+ |
+---------+-------------------------+
| module3 |                         |
+---------+-------------------------+

Exporting the results (HTML)

For a nicer presentation, use the html command, to export the results as HTML.

django-queries html <json file> > results.html