Merge lp://staging/~intellectronica/launchpad/bug-heat-days-active into lp://staging/launchpad/db-devel

Proposed by Eleanor Berger
Status: Merged
Approved by: Eleanor Berger
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~intellectronica/launchpad/bug-heat-days-active
Merge into: lp://staging/launchpad/db-devel
Prerequisite: lp://staging/~intellectronica/launchpad/bug-heat-degrade
Diff against target: 1026 lines (+959/-2)
8 files modified
lib/launchpad_loggerhead/__init__.py (+1/-0)
lib/launchpad_loggerhead/app.py (+215/-0)
lib/launchpad_loggerhead/debug.py (+120/-0)
lib/launchpad_loggerhead/session.py (+73/-0)
lib/launchpad_loggerhead/static/robots.txt (+2/-0)
lib/lp/bugs/scripts/bugheat.py (+16/-1)
lib/lp/bugs/scripts/tests/test_bugheat.py (+21/-1)
lib/lp/code/model/tests/test_sourcepackagerecipe.py (+511/-0)
To merge this branch: bzr merge lp://staging/~intellectronica/launchpad/bug-heat-days-active
Reviewer Review Type Date Requested Status
Michael Nelson (community) code Approve
Review via email: mp+23921@code.staging.launchpad.net

Commit message

Add a proportion of the maximum bug heat to a bug's heat for every day since the bug was created.

Description of the change

This branch is the last in a series of branches to make bug heat more sensitive to bug activity. In this branch we change the formula so that a proportion of the maximum heat for a bug is added for every day since it was created (this is offset by the decrease in bug heat for time since last activity, already in place).

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

There seems to be an inconsistency between the comment about the formula and the formula itself (regarding days_since_last_activity). From our IRC chat (below) and the related bug title, the comment should be:

> === modified file 'lib/lp/bugs/scripts/bugheat.py'
> --- lib/lp/bugs/scripts/bugheat.py 2010-04-22 12:14:18 +0000
> +++ lib/lp/bugs/scripts/bugheat.py 2010-04-22 12:14:19 +0000
> @@ -86,5 +86,19 @@
> self.bug.date_last_updated.replace(tzinfo=None)).days
> total_heat = int(total_heat * (0.99 ** days))
>
> - return total_heat
> + # Bug heat increases by a quarter of the maximum bug heat divided by
> + # the number of days between the bug's creating and its last activity.

         # the number of days since the bugs last activity.

> + days_since_last_activity = (
> + datetime.utcnow() -
> + max(self.bug.date_last_updated.replace(tzinfo=None),
> + self.bug.date_last_message.replace(tzinfo=None))).days
> + days_since_created = (
> + datetime.utcnow() - self.bug.datecreated.replace(tzinfo=None)).days
> + if days_since_created > 0:
> + max_heat = max(
> + task.target.max_bug_heat for task in self.bug.bugtasks)
> + if max_heat is not None:
> + total_heat = total_heat + (max_heat * 0.25 / days_since_created)

s/days_since_created/days_since_last_activity

> +
> + return int(total_heat)

Similarly in the test:

> + expected = int((fresh_heat * (0.99 ** 10)) + (100 * 0.25 / 20))
s/20/10

{{{
14:17 < noodles775> intellectronica: I can't see that days_since_last_activity is being used for anything?
14:18 < noodles775> Did you mean to do (max_heat * 0.25 / (days_since_created - days_since_last_activity)) or something similar, looking at the comment?
14:19 < noodles775> Ah, or looking at the related bug title, I'm guessing it should be s/dasy_since_created/days_since_last_activity on line 21 on the MP diff?
14:21 < intellectronica> noodles775: no, i think that's a cut-n-paste error.
14:27 < noodles775> intellectronica: so should it be divided by the number of days *since* the bugs last activity (as stated in the bug title), or divided by the difference between the days since the bug was created and it's last activity (as the comment seems to suggest?)
14:28 < intellectronica> noodles775: it should be divided by the days since the bug's creation
14:28 < noodles775> intellectronica: so the bug 567439 title is wrong then, ok.
14:28 < mup> Bug #567439: Add MAX_HEAT / 4 / days since last activity to bug heat <story-bug-heat> <Launchpad Bugs:In Progress by intellectronica> <https://launchpad.net/bugs/567439>
14:29 < intellectronica> noodles775: oh, right, it is. there's another bug for a calculation based on time since last activity, i must have confused them.
}}}

review: Approve (code)

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: