lp:~james-w/python-oops-tools/recent-oopses

Created by James Westby on 2012-11-29 and last modified on 2014-01-31
Get this branch:
bzr branch lp:~james-w/python-oops-tools/recent-oopses
Only James Westby can upload to this branch. If you are James Westby please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
James Westby
Project:
python-oops-tools
Status:
Development

Recent revisions

59. By James Westby on 2014-01-31

Correct the variable name.

58. By James Westby on 2014-01-30

Revert to old python syntax until tests are run on a modern python.

57. By James Westby on 2014-01-14

Use more expressions. Thanks nessita.

56. By James Westby on 2014-01-14

Modify the recent oopses query to perform better with lots of oopses.

When there is a report with many prefixes, and the most recent oopses are
not for any of those prefixes postgres will pick a query plan that performs
poorly (not using the most selective index, assuming that the prefix ids
are distributed fairly uniformly through the oopses.)

We instead trick postgres in to using the more selective index using a window
function. Thanks to stub for the query.

We do a second query to load all the infestations for these oopses, to prevent
the ORM from doing 50 queries as we iterate over the list of oopses.

We also drop the pagination because it is not as simple to implement with the
raw query. It could be re-instated if it was really needed, but usually
I find looking at the most recent 50 oopses is sufficient.

Lastly, I re-ordered the columns in the oops listing, to put the oops
first as that is usually what you want to click on. I also dropped the linking
of the URL, as the escaping meant that it never worked, and the URL is often
not something you can simply click on either. The fact that the URL was first
in the table and a link meant that I often clicked on that rather than the
oops, wasting time.

55. By Sidnei da Silva on 2013-07-02

Pin buildout version during bootstrap. Seems like there's a zc.buildout 2.x egg in the cache, which bootstrap prefers, thus causing the following error:

zc.buildout 2 needs distribute, not setuptools. Are you using an outdated bootstrap.py? Make sure you have the latest version downloaded from http://downloads.buildout.org/2/bootstrap.py

Since the version pinned in versions.cfg is 1.5.2, also use the same version when bootstrapping.

54. By James Westby on 2013-02-25

Ensure that statements are always strings.

Fixes a crash when adding an oops that doesn't have a string for one of
the statements. The data being sent is bad, but a crash means no further
oopses can be processed.

53. By James Westby on 2012-12-06

Add django_openid_auth.

Our production deployment hacks things such that django_openid_auth is used.
This adds it for real.

In addition it adds the common pattern of allowing a local_settings.py
that overrides values in settings.py so that prod can configure things like
the SSO server and the team mappings.

52. By James Westby on 2012-12-06

Set the version of lazr.restfulclient to pick up the cert fixes.

51. By James Westby on 2012-12-06

Improve the query performance of the recent oopses view.

Firstly the planner was picking a difficult plan because of the join, but
we expect few prefixes per-report, so getting the prefix ids first, then
using a simple IN rather than a join leads to an easier plan.

Once the easier plan is in use the indexes still aren't that helpful, as
it chooses the index on 'date', but it still has to filter based on the
prefix, so we add an index on (prefix_id, date) so that it can select the
right rows as quickly as possible.

Lastly lazy evaluation was causing 50 queries for the 'oopsinfestation'
info, so we use select_related() to include that in the main query.

There's a test that we do 1 query for the last point, but no test for
the speed of the query.

50. By James Westby on 2012-12-05

Decode the report when reading it to send the email.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:python-oops-tools
This branch contains Public information 
Everyone can see this information.

Subscribers