Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First day of "Projects Created Each Day" graph is always negative #905

Open
cpeel opened this issue May 28, 2023 · 2 comments
Open

First day of "Projects Created Each Day" graph is always negative #905

cpeel opened this issue May 28, 2023 · 2 comments

Comments

@cpeel
Copy link
Member

cpeel commented May 28, 2023

@srjfoo noticed that the first day of the Projects Created Each Day graph is negative, and by the looks of the code it will always be. That's because the code works by using the project_state_stats table which records the total number of projects in a state in a day. The graph_data.inc script pulls that info for every day in the month, and then uses array_successive_difference() to subtract one day from the other -- but we never actually have the value of the day before the current month, so there's no way for the first value to not be <0.

@windymilla
Copy link
Collaborator

Interesting - I wonder why the same doesn't happen for Projects Proofed Each Day
According to the comment in cumulative_month_proj

    // snapshot is taken just after midnight,
    // so day = 1 has total at beginning of month

so, the bar for the first day of the month should be the difference between the value for day 2 and the value for day 1.
It appears correct at the other end of the graph in the sense that there is an entry for 26th (on 27th July)

Not easy to look at on TEST since there's very little data

@srjfoo
Copy link
Member

srjfoo commented Jul 27, 2023

Not easy to look at on TEST since there's very little data

Yeah -- we could make a point of creating a project or two a day for the next several days, rolling over into August. That's likely to be the best test.

Edit: actually, what's probably needed is some warning before the test suite is needed so that we can set up a run of several days straddling the beginning of the month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants