Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Period reports must always or never include today's statistics #5793

Closed
mattab opened this Issue · 6 comments

2 participants

@mattab
Owner

Reports for weeks, months and year do not include the most recent “today” data. Reports for weeks/month/year are only processed once per day, therefore are not ‘real time’ as such. This was done for performance optimization in the first place.

more info from Anton: I researched on this problem little more and I found real bug in the logic. Follow instructions below and you will see where the problem is:

1. Setup always_archive_data = false

2. Create new html page, add it as new site to Piwik and put JavaScript code to the page. DO NOT query for statistics for this site (actually it is only 1 page)

3. Make some visits from different browsers and/or machines.

4. Query for last day, then last week, month and for last year. You will see the same numbers for visits, actions etc. We are expecting weekly, monthly and yearly statistics do not include today’s statistics. BUG.

Actually Piwik can’t find archive built for last week, and it build it including today’s visits. So Piwik does not follow the same logic. See next…

5. Now you have all archives built. Try to make some more visits and query for last day, week, month and year again. You will see new visits in the last day, but you will not see them in last month and year, but you will see it for last week! So it is totally confusing. Now Piwik does not include new visits from today (just like you said in your previous message). But it does it if no archives built in the past.

P.S. If you set always_archive_data = true and ask Piwik for visits for last day, week, month and year again – it will be ok including all today’s visits.

So Piwik does not follow your logic described in the previous letter. It seems that the logic is that Piwik checks whether archive is built already and simply does not rebuild it.

It must NEVER include today’s statistics… or ALWAYS include today’s statistics. We can also contemplate a config file boolean setting include_today_statistics_in_period_archives

@mattab
Owner

Could replicate on this piwik server [red-sea](http://divezone.net/red-sea.htm) and other pages…

@anonymous-piwik-user

...so? Is it possible correct this bur or not ? I don't understand if it is "better" with this problem

@mattab
Owner

It is not 'better', just more performant as monthly/weekly archives are processed only once per day.

@mattab
Owner

There are so many messages of confusion about this in the forums over the months. It could be good to at least let the users know, what exactly is included in the report (even if we don't implement the full ticket yet).

the message is displayed when viewing "this current" week, month or year. It could say "This report does not include data between 4AM and 6:30pm today. "

@mattab
Owner

OK about time to tackle this one

@mattab
Owner

(In [4341]) Fixes #5793 it was really not that hard, I wonder why I postponed it for 2 years...
so now, any report that "contain" today, current week/month or date range containing today, will be processed every N seconds, N being the timeout set in General Settings
however if a report is requested for 'current month' eg., and archiving via browser is disabled, we will select 'any current month' archive that was processed today. So we might display out of date reports, ie. the oldest behavior, if archiving is disabled and crontab doesn't run as often as the timeout set in GEneral settings

@mattab mattab added this to the Piwik 1.3 milestone
@mattab mattab self-assigned this
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.