View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] |
ID | Project | Category | View Status | Date Submitted | Last Update |
0001973 | ClearOS | app-resource-report - Resource Report | public | 2014-09-29 05:57 | 2017-04-13 14:00 |
|
Reporter | NickH | |
Assigned To | | |
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | open | |
Platform | | OS | | OS Version | |
Product Version | | |
Target Version | 6.9.0 | Fixed in Version | | |
|
Summary | 0001973: The "resource" table in system-mysql grows indefinitely, but reports can only show 30 days of data |
Description | My resource table in system-mysql is currently 19.5MiB in size with entries going back to November 2012 - about 170,000 records (presumaly when app-resource-report was first installed). In the webconfig you can view a maximum of 30 days of data. There is a big mismatch between data logged and data viewable. If you can only view 30 days of data why keep all history? Alternatively if you keep all history why can you only view 30 days of it?
As far as I can see the database will grow indefinitely which I don't think is a good idea. I think a database pruning routine has been missed from the report. It can be achieved with the following one liner in cron.daily cron.weekly or cron.monthly:
/usr/clearos/sandbox/usr/bin/mysql -D reports -u reports -p`cut -f3 -d" " /var/clearos/system_database/reports` -e 'delete from resource where TIMESTAMPDIFF(MONTH,timestamp,curdate()) > 2 ;'
This would keep 3 months of data. It would be really easy to switch it to working in days. |
Steps To Reproduce | Install the app and wait a long time? |
Tags | No tags attached. |
|
Attached Files | |
|