Do the stats home page backend

RESOLVED FIXED in 6.4.2

Status

P5
normal
RESOLVED FIXED
7 years ago
3 years ago

People

(Reporter: clouserw, Assigned: andy+bugzilla)

Tracking

unspecified
6.4.2

Details

(Reporter)

Description

7 years ago
Potch started looking at this in bug 697358 but needs a hand with the backend stuff.

Right now we have a bunch of stats pages coming out in csvs and json for the stats graphs.  We want to use those same methods and URL structures to create suitable output for addons.mozilla.org/statistics.  An example of the current output is https://addons.mozilla.org/en-US/statistics/sitecsv/week.

These are all effectively coming directly out of the global_stats table so translation shouldn't be too rough, although you will have to load them into ES first (look at the current add-on stats to see examples).

This is a low priority thing.
Target Milestone: 6.3.9 → ---
(Assignee)

Updated

7 years ago
Assignee: kumar.mcmillan → amckay
(Assignee)

Updated

7 years ago
Target Milestone: --- → 6.4.1

Comment 1

7 years ago
looking at the global_stats table, we have the following schema:

+-------+------------------+------+-----+------------+----------------+
| Field | Type             | Null | Key | Default    | Extra          |
+-------+------------------+------+-----+------------+----------------+
| id    | int(11) unsigned | NO   | PRI | NULL       | auto_increment |
| name  | varchar(255)     | NO   | MUL |            |                |
| count | int(10) unsigned | NO   |     | 0          |                |
| date  | date             | NO   |     | 0000-00-00 |                |
+-------+------------------+------+-----+------------+----------------+

The stats pages like their data as a json blob of rows by date, like the following:

[{"date": "2010-01-08", "downloads": 108919} ...]

Using the fields from the above table, the ideal json structure coming out of a request for collection stats data should look something like this:

[
    {
        'date': '<date>',
        // do this for each DB record grouped by the `date` field.
        '<name>': '<count>'
    }
    ... // repeat for all dates in requested range.
]
(Reporter)

Updated

7 years ago
Target Milestone: 6.4.1 → 6.4.2
(Assignee)

Comment 2

7 years ago
https://github.com/mozilla/zamboni/commit/5e67ad
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.