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

When visits or pages are recorded in the past via the Tracking API, reports are not re-created/deleted #2328

Closed
mattab opened this issue Apr 18, 2011 · 2 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Apr 18, 2011

The Tracking API is more and more used. A new use case, is that when the function setForceVisitDateTime() is used, and a date recorded in the past, if Piwik reports are already processed for this date (and the week/month/year containing this date), then the reports are never re-processed. This causes discrepencies.

There are 2 main use cases for this problem:

We need a mechanism to force such visit/pages inserted in the past to 'flush' the past reports and they will be re-processed at the next archiving run.

The challenge is to make this efficient.

A proposal for this:

  • in Tracker, if the request being tracked is in the past (before today midnight), then we are in the case that some existing reports become out of date
    • when this is the case, we store in Option table, all the unique "days" that have been tracked in the past
  • Now, when a report is requested via API, the API we would if there are any dates that were loaded in the past recently
  • if there is such dates, loop and execute the query:
DELETE FROM archive WHERE date1 <= '$date' AND '$date' <= date2```
 on all archive tables.  
  * this should be optimized to only run on these archive tables that may contain such record (not good to loop over ALL archive tables for ALL dates to delete) 
  * might be better performance to run one query only per archive table, deleting records for all these dates in the past
  * once done, reset the flag. If deleting one day at a time, delete the flag for this day after being done.

Note
* it is important that piwik works when the Import apache log script is running, while archiving is also running (be careful about handling the flag of 'dates' and not lose the information that is being saved by Tracker while importing logs, while Archiving is reading/updating the flag as well)


I think this will work while not adding much overhead?


@mattab
Copy link
Member Author

mattab commented Apr 23, 2011

There is a potential issue with this functionnality if logs have been deleted, as per #5 (see #5425 )

@mattab
Copy link
Member Author

mattab commented Sep 7, 2011

Dupe of #2584

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

1 participant