Closed Bug 758480 Opened 12 years ago Closed 12 years ago

Missing daily stats should be listed as 0 in graph/JSON

Categories

(Marketplace Graveyard :: Statistics, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED
2012-05-31

People

(Reporter: cvan, Assigned: kngo)

References

()

Details

Attachments

(2 files)

Attached image Empty data
Because the JSON is being generated from whatever we have in Installed.search() we're not filling in the gaps for missing dates:

https://marketplace-dev.allizom.org/en-US/app/seevans-underworld-adventur/statistics/installs-day-20120225-20120525.json

[
    ...,
    {
        "date": "2012-04-16",
        "count": 13,
        "end": "2012-04-16"
    },
    {
        "date": "2012-04-15",
        "count": 1,
        "end": "2012-04-15"
    },
    {
        "date": "2012-04-13",
        "count": 15,
        "end": "2012-04-13"
    },
    ...
]

(See attached image for clarification. Incidentally, it looks like the graph is not matching the install counts in the table.)

Expected result:
(Case 1) If you have no data for the entire range, return nothing. For example:

   April 14: no data
   April 15: no data
   April 16: no data

The JSON feed should be empty: []

(Case 2) If you have any missing days for a date range, assume those gaps had 0 installs. For example:

   April 13: 15
   April 14: no data
   April 15: 1
   April 16: 6

The JSON feed should return this:

[
    {
        "date": "2012-04-16",
        "count": 13,
        "end": "2012-04-16"
    },
    {
        "date": "2012-04-15",
        "count": 1,
        "end": "2012-04-15"
    },
    {
        "date": "2012-04-14",
        "count": 0,
        "end": "2012-04-13"
    },
    {
        "date": "2012-04-13",
        "count": 15,
        "end": "2012-04-13"
    },
]
Priority: -- → P3
https://github.com/mozilla/zamboni/commit/d220b40e7506a7143b5bb8aca9531152e8a51937
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Is there any way we can get the items to be in chronological order:

[
...
{
    "date": "2012-04-06",
    "count": 0,
    "end": "2012-04-06"
},
{
    "date": "2012-04-14",
    "count": 0,
    "end": "2012-04-14"
},
{
    "date": "2012-04-22",
    "count": 0,
    "end": "2012-04-22"
},
...
]
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Chris Van Wiemeersch [:cvan] from comment #2)
> Is there any way we can get the items to be in chronological order:
> 
> [
> ...
> {
>     "date": "2012-04-06",
>     "count": 0,
>     "end": "2012-04-06"
> },
> {
>     "date": "2012-04-14",
>     "count": 0,
>     "end": "2012-04-14"
> },
> {
>     "date": "2012-04-22",
>     "count": 0,
>     "end": "2012-04-22"
> },
> ...
> ]

Crap...I had it like that before I modularized it :(
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Verified as fixed.
Status: RESOLVED → VERIFIED
Attached image Postfix Screenshot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: