Merge lp:~wgrant/launchpad/bprdc into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Henning Eggers on 2010-03-15 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | not available |
| Proposed branch: | lp:~wgrant/launchpad/bprdc |
| Merge into: | lp:launchpad/db-devel |
| Prerequisite: | lp:~wgrant/launchpad/get-bpr-by-filename |
| Diff against target: |
343 lines (+204/-7) 7 files modified
database/schema/patch-2207-36-0.sql (+15/-0) database/schema/security.cfg (+1/-0) lib/lp/soyuz/interfaces/archive.py (+14/-0) lib/lp/soyuz/interfaces/binarypackagerelease.py (+23/-4) lib/lp/soyuz/model/archive.py (+15/-0) lib/lp/soyuz/model/binarypackagerelease.py (+33/-2) lib/lp/soyuz/tests/test_archive.py (+103/-1) |
| To merge this branch: | bzr merge lp:~wgrant/launchpad/bprdc |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Julian Edwards (community) | Approve on 2010-03-15 | ||
| Henning Eggers (community) | code | 2010-03-12 | Approve on 2010-03-15 |
| Björn Tillenius (community) | db | 2010-03-12 | Approve on 2010-03-12 |
| Stuart Bishop | db | 2010-03-12 | Approve on 2010-03-12 |
|
Review via email:
|
|||
Commit Message
Add the model for PPA download stats. Landed by henninge.
Description of the Change
This branch adds the model for PPA binary download stats. BinaryPackageRe
BinaryPackageRe
| Björn Tillenius (bjornt) wrote : | # |
On Fri, Mar 12, 2010 at 07:20:53AM -0000, William Grant wrote:
> William Grant has proposed merging lp:~wgrant/launchpad/bprdc into lp:launchpad with lp:~wgrant/launchpad/get-bpr-by-filename as a prerequisite.
>
> Requested reviews:
> Björn Tillenius (bjornt): db
> Stuart Bishop (stub): db
> Canonical Launchpad Engineering (launchpad)
>
>
> This branch adds the model for PPA binary download stats.
> BinaryPackageRe
> Archive.
> #139855 for discussion on the issue -- the only thing with which
> everybody is agreed about collecting is counts for each binary package
> release in each archive.
I think this patch is ok, although I have a few questions (and a comment
on the patch itself further down). I'll be on vacation next week, so I
won't block a landing of the patch, waiting for the replies, as long as
my comments are considered, but I'm marking it as needsinfo so that I
can track the discussion more easily.
vote needsinfo
Can you explain shortly how BinaryPackageRe
series? As I understand it, this is only for PPAs, right, since we can't
track the downloads of other archives? Would it make sense to make the
name a bit more specific in that case? At the very least, comments.sql
should explain this. Or will this be used by other archives than PPA
ones?
I couldn't find where everybody agreed about collecting counts for each
binary package release. Can you point me to the right place?
What other things are we likely to want to track in the future, if any?
> === added file 'database/
> --- database/
> +++ database/
> @@ -0,0 +1,15 @@
> +SET client_
> +
> +CREATE TABLE BinaryPackageRe
> + id serial PRIMARY KEY,
> + archive integer NOT NULL REFERENCES Archive,
> + binary_
> + day date NOT NULL,
> + country integer,
> + count integer NOT NULL
> +);
> +
> +ALTER TABLE BinaryPackageRe
> + UNIQUE (archive, binary_
> +
> +INSERT INTO LaunchpadDataba
Shouldn't country be a foreign key to Country?
And looking at the tests, I didn't see any tests for not specifying the
country. That would be good to have.
--
Björn Tillenius | https:/
| William Grant (wgrant) wrote : | # |
On Fri, 2010-03-12 at 09:42 +0000, Björn Tillenius wrote:
> Review: Needs Information
> On Fri, Mar 12, 2010 at 07:20:53AM -0000, William Grant wrote:
> > William Grant has proposed merging lp:~wgrant/launchpad/bprdc into lp:launchpad with lp:~wgrant/launchpad/get-bpr-by-filename as a prerequisite.
> >
> > Requested reviews:
> > Björn Tillenius (bjornt): db
> > Stuart Bishop (stub): db
> > Canonical Launchpad Engineering (launchpad)
> >
> >
> > This branch adds the model for PPA binary download stats.
> > BinaryPackageRe
> > Archive.
> > #139855 for discussion on the issue -- the only thing with which
> > everybody is agreed about collecting is counts for each binary package
> > release in each archive.
>
> I think this patch is ok, although I have a few questions (and a comment
> on the patch itself further down). I'll be on vacation next week, so I
> won't block a landing of the patch, waiting for the replies, as long as
> my comments are considered, but I'm marking it as needsinfo so that I
> can track the discussion more easily.
Thanks.
> vote needsinfo
>
> Can you explain shortly how BinaryPackageRe
> series? As I understand it, this is only for PPAs, right, since we can't
> track the downloads of other archives? Would it make sense to make the
> name a bit more specific in that case? At the very least, comments.sql
> should explain this. Or will this be used by other archives than PPA
> ones?
A BinaryPackageRe
distribution series (linked by BinaryPackagePu
was talk a couple of months ago about a desire to use this for the
partner archive too -- I'm not sure if that's still on the cards, but
this schema works fine for that too, and the subsequent branches would
need only slight extension.
The primarily archive is more impossible, since it is heavily mirrored
across hundreds of hosts.
> I couldn't find where everybody agreed about collecting counts for each
> binary package release. Can you point me to the right place?
>
> What other things are we likely to want to track in the future, if any?
The last few comments all speak of counting binaries and indices, but no
concrete method of usefully counting index downloads has yet been
mentioned, and it's much much harder to get right (it involves lots of
guessing). Binary counting is easy and a good first step.
>
> > === added file 'database/
> > --- database/
> > +++ database/
> > @@ -0,0 +1,15 @@
> > +SET client_
> > +
> > +CREATE TABLE BinaryPackageRe
> > + id serial PRIMARY KEY,
> > + archive integer NOT NULL REFERENCES Archive,
> > + binary_
> > + day date NOT NULL,
> > + country integer,
> > + count integer NOT NULL
> > +);
> > +
> > +ALTER TABLE BinaryPackageRe
| Stuart Bishop (stub) wrote : | # |
The FOREIGN KEY reference to Country is correct. Thanks.

Looks good. DB patch approved by me as patch-2207- 36-0.sql.
We might need an extra index or three depending on what reports we generate from this information. I think the reports I think we will generate will be fine with the index from the UNIQUE constraint so no worries for now.