Skip to content

Speed up the RRS pages, and test them

Tim Orling yocto-patches 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4docker/run-tests.sh: run tests for the RRS app with RRS enabledREADME.devel.md docker/run-tests.sh tests/rrs/conftest.py +1 more+121 -10 replies
2/4rrs/views.py: fetch the recipe list's patch counts in a few queriesrrs/views.py tests/rrs/test_recipe_list.py+92 -90 replies
3/4rrs/views.py: fetch the maintainers page's statistics in a few queriesrrs/views.py tests/rrs/test_maintainers.py+168 -40 replies
4/4rrs/views.py: fetch the recipe detail page's upgrades in a few queriesrrs/views.py tests/rrs/test_recipe_detail.py+133 -140 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [layerindex-web][PATCH 0/4] Speed up the RRS pages, and test them

The RRS recipe list, report, maintainers and recipe detail pages ran queries per recipe, maintainer or upgrade: about 5,000 for the OE-Core recipe list, which took 4 s, and over 2,500 for linux-yocto's detail page. The database itself was busy for under 0.5 s of that, and the lookups already use indexes, so these batch the queries instead.

1: RRS views had no tests, because the test database is built without
the app. Add tests/rrs/, run by docker/run-tests.sh in a second pass with ENABLE_RRS=1 and --nomigrations (the RRS data migrations need the core layer first), plus a check for model changes without a migration. RRS stays optional: without it tests/rrs/ isn't collected.
2-4: Batch the queries of the recipe list and report, the maintainers
page and the recipe detail page. Each comes with tests of the page data and of the query count, which fail without the change.

On a copy of the production database on a test bench instance, the page data before and after is identical for 12 recipe list milestones, 9 maintainers pages and 153 recipe detail pages:

  Page (OE-Core 6.2)             Before    After
  recipes/                       4.3 s     0.32 s
  recipesreport/                 3.7 s     0.12 s
  maintainers/                   1.17 s    0.17 s
  recipedetail/ (linux-yocto)    3.7 s     0.30 s

Building the meta-openembedded recipe list goes from 9 s to 0.3 s.

This applies on master-next: patch 1 changes the lines of docker/run-tests.sh that "requirements-dev.txt: pin the development and test tools" changed:
https://lore.kernel.org/all/[email protected]/

Tim Orling (4):
docker/run-tests.sh: run tests for the RRS app with RRS enabled rrs/views.py: fetch the recipe list's patch counts in a few queries rrs/views.py: fetch the maintainers page's statistics in a few queries rrs/views.py: fetch the recipe detail page's upgrades in a few queries

 README.devel.md                 |   9 ++
 docker/run-tests.sh             |   9 +-
 rrs/views.py                    | 171 +++++++++++++++++++++++++++-----
 tests/rrs/conftest.py           |  52 ++++++++++
 tests/rrs/test_maintainers.py   |  94 ++++++++++++++++++
 tests/rrs/test_recipe_detail.py |  84 ++++++++++++++++
 tests/rrs/test_recipe_list.py   |  71 +++++++++++++
 tests/rrs/test_views.py         |  52 ++++++++++
 8 files changed, 514 insertions(+), 28 deletions(-)
 create mode 100644 tests/rrs/conftest.py
 create mode 100644 tests/rrs/test_maintainers.py
 create mode 100644 tests/rrs/test_recipe_detail.py
 create mode 100644 tests/rrs/test_recipe_list.py
 create mode 100644 tests/rrs/test_views.py
Signature · 1 line
2.56.1