-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Lightweight Piwik mode: Setting to purge aggregated reports older than N days from the database #5473
Comments
Updating description for proposal first version. I think this would be extremely useful to a LOT of Piwik users! This would fix a major complaint with Piwik: DB size. |
Improving feature description (usability) |
Attachment: Proposed modifications |
I'd like to implement this by modifying the 'Delete old visitor logs from database' section. I've attached an image laying out what the changes would be. Some notes:
What do you think? |
Along with a few other key feature we're currently working on, I am confident this one in particular will have a HUGE impact. Because, it is in the top 3 critical feedback, that Piwik uses too much DB size. Many shared host will be relieved with this. Great that you're working on this amazing feature!! Review:
|
UX Request:
|
Attachment: Patch for this issue. (1st) |
Just attached a patch for this issue. Some notes:
Let me know what you think. |
Forgot to mention, the patch is for rev 6123. |
Great work cappedfuzz! Nice to read...
|
Some questions: Replying to matt:
There's an issue with this since the purge settings can be changed. So it could be set to reports older than 6 months, a purge could run, and it could be reset to reports older than, say, 8 months. In which case, some reports won't have the message when they should. I think, though, that this can be solved w/ the following: If the table for the report does not exist, then it has been purged. This should be more accurate and keep purging effective (as opposed to not deleting rows).
Actually, I think over-thought. An AJAX request would work. |
I think it's an acceptable solution. I propose that the message is displayed, only for dates older than the current deletion threshold. It is just an estimate anyway. The good thing is not to show the message to normal users, or for recent dates :)
Yes it would, if you can please use the standard "Loading data..." helper during the request (or maybe even a better message "Deleting old reports, please wait..." |
Attachment: Patch for this issue. (2nd) |
Attached another patch for this issue. Let me know what you think of it. |
Good work Benaka!! :) Code review:
Idem in test_purgeData_deleteReportsKeepBasicMetrics and other tests
If you can apply these last feedback then commit it would be great! Cool feature to have.. We will have to do a bit of marketing around it. |
(In [6174]) Fixes #5473. Augmented the log data deletion feature. Added the ability to purge old reports and metrics. Other changes:
|
(In [6175]) Refs #5473, UI & security tweaks along w/ one bug fix ('delete_logs_max_rows_per_query' was not set in getPurgeSettingsFromRequest). |
(In [6176]) Refs #5473, show 'data was purged' message for every user type, not just super user. |
Commit [6177] deals with this ticket. (forgot to add the Refs) |
Very nice! it looks perfect now :) |
(In [6179]) Refs #5473 labels html |
I just noticed the metrcs picker is not working on the visitors overview anymore. I guess this problem has been introduced in [6174]. The problem is that Piwik_Date::factory doesn't recognize a date. This is the backtrace (from the XHR response):
|
(In [6195]) Refs #5473, fix issue of failure in purged report message logic when a set of dates is requested. |
@ezdesign Just committed a fix for the problem, the metrics picker works for me now. Let me know if you still encounter a problem. |
Thanks for the quick fix! It works now. |
(In [6197]) Refs #5473 reusing a function |
There is a similar bug with date=last7 reported in #3107 |
Thanks for the good work, capedfuzz! I have a request for this feature. I hope you can do it... Piwik creates archives for every custom date range you pick. It would be cool if there would be a setting to only delete those archives - keeping days,weeks,months,years and also segments intact. There could be a similar setting do delete segments and keep days,weeks,months,years but I would only need the option to delete period=range archives. Is that possible? |
@ezdesign Yes, it's possible, and likely easy to do. I should be able to get to it soon. |
(In [6218]) Refs #5473, Added ability to purge range reports and ability to keep segment data for saved reports. Other changes:
|
(In [6219]) Refs #5473, fixes build? |
(In [6220]) Refs #5473, removed Piwik_FetchCol function as mysqli seems to have a problem w/ fetchCol. |
kaboom, so good! |
(In [6557]) Refs #5473, show DB purged message after successful purge. |
(In [6559]) Refs #5473, internationalize db purged message. |
The main reason that people stop using Piwik on small websites is because the DB grows out of control. Often users have 25Mb or 50m for the whole Mysql database. After installing the CMS, it is common for Piwik to have only 20M of space. We should try to make it easy to run Piwik with basic history and keep DB space below 20M.
Proposal “Lightweight Piwik” feature
- Display the current DB size. Reuse API code from: #3004
- Have a new setting “General settings” to select number of months to keep data for
– By default, keep all historical data
– In the dropdown selecting the number of months, put estimate of DB size that will be freed
- When setting enabled,
– Delete old archive_blob tables that are older than N months
– delete from all archive_numeric all rows except a critical metrics (visits, pageviews, ecommerce/goal metrics).
– also delete all segment data, numeric and blob
– Propose a dropdown to select number of months
– For each month choice “delete older than [years,4 years,custom](3,6,9,12,18,2)”. Once entry is selected, refresh the space free “delete older than [months](18) (N Gb will be deleted, Total Piwik DB size will become MGb)”
– When the feature is enabled, execute it as a scheduled task (safer for huge DBs). But on page reload, we could also display a link to let the user execute the purge code NOW (when in a hurry to get the DB size under control).
Note: it would be very nice to also get rid of #2805 – just one SQL query away after all…
PS: and this one too #3003
V2 of this feature (to be put as “feature request” ticket)
- User could choose exactly which reports to purge.
- Have a “less agressive” purge mode that would keep more data, but still delete a lot of useless old reports nobody would care about
– The list would be pre-selected with our estimate of the most useful reports (eg. Keywords, Page URLs/Page Titles, Websites, Campaigns, All goal reports…) and delete all others. Call our selection “Recommended historical reports to keep”
– The list would handle numeric and blob.
– “Delete data for segmented reports” or “Keep reports for segmented data”
The text was updated successfully, but these errors were encountered: