Merge lp://staging/~gmb/launchpad/stored-proc-for-bug-heat-bug-582195 into lp://staging/launchpad/db-devel

Proposed by Graham Binns
Status: Superseded
Proposed branch: lp://staging/~gmb/launchpad/stored-proc-for-bug-heat-bug-582195
Merge into: lp://staging/launchpad/db-devel
Diff against target: 154 lines (+150/-0)
1 file modified
database/schema/pending/stored-proc-for-bug-heat.sql (+150/-0)
To merge this branch: bzr merge lp://staging/~gmb/launchpad/stored-proc-for-bug-heat-bug-582195
Reviewer Review Type Date Requested Status
Björn Tillenius db Pending
Stuart Bishop db Pending
Canonical Launchpad Engineering code Pending
Review via email: mp+26032@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2010-05-26.

Commit message

A stored procedure has been added for calculating bug heat in the database rather than in code.

Description of the change

This branch takes the code in lib/lp/bugs/scripts/bugheat.py and converts it into a plpython stored procedure.

The idea behind this is that we need to do bug heat calculations in the DB rather than in code, since the setup and teardown surrounding doing the calculations in code is far to slow and cumbersome.

The stored procedure is currently not hooked up to anything, but once the patch is applied it's easy to check the results of the stored procedure against the existing code using psql and an iharness session, thus:

In psql:

  SELECT calculate_bug_heat(1);

In iharness:

  >>> from lp.bugs.scripts.bugheat import BugHeatCalculator
  >>> bug_1 = getUtility(IBugSet).get(1)
  >>> calculator = BugHeatCalculator(bug_1)
  >>> calculator.getBugHeat()

To post a comment you must log in.
Revision history for this message
Björn Tillenius (bjornt) wrote :

On Wed, May 26, 2010 at 10:50:49AM -0000, Graham Binns wrote:
> The stored procedure is currently not hooked up to anything, but once
> the patch is applied it's easy to check the results of the stored
> procedure against the existing code using psql and an iharness session,
> thus:

Why not hook it up directly? It would be useful to have this tested,
since it's hard to check that it's doing what it should be doing.

--
Björn Tillenius | https://launchpad.net/~bjornt

Revision history for this message
Graham Binns (gmb) wrote :

2010/5/26 Björn Tillenius <email address hidden>:
> On Wed, May 26, 2010 at 10:50:49AM -0000, Graham Binns wrote:
>> The stored procedure is currently not hooked up to anything, but once
>> the patch is applied it's easy to check the results of the stored
>> procedure against the existing code using psql and an iharness session,
>> thus:
>
> Why not hook it up directly? It would be useful to have this tested,
> since it's hard to check that it's doing what it should be doing.
>

I was going to do it in a subsequent branch, but since it's now late
in stub's day anyway I'll do it in this one and resubmit.

--
Graham Binns | PGP Key: EC66FA7D

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: