ClearOS Bug Tracker


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001975ClearOSapp-resource-report - Resource Reportpublic2014-09-29 07:372016-12-23 11:24
Reporterpbaldwin 
Assigned Topbaldwin 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version7.3.0 Beta 1Fixed in Version7.3.0 Beta 1 
Summary0001975: The "resource" table in system-mysql grows indefinitely, but reports can only show 30 days of data
DescriptionMy 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 ReproduceInstall the app and wait a long time?
TagsNo tags attached.
Attached Files

- Relationships
related to 0001973closed The "resource" table in system-mysql grows indefinitely, but reports can only show 30 days of data 
related to 0011501closedpbaldwin Add reports database purge script 
related to 0011511closedpbaldwin The "network" table in system-mysql grows indefinitely, but reports can only show 30 days of data 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2014-09-29 07:37 pbaldwin New Issue
2014-09-29 07:37 pbaldwin Issue generated from: 0001973
2014-09-29 07:37 pbaldwin Relationship added related to 0001973
2014-09-29 07:40 pbaldwin Status new => confirmed
2014-10-21 15:35 pbaldwin Target Version 7.0.0 Alpha 2 => 7.1.0 Beta 2
2015-05-25 05:18 pbaldwin Target Version 7.1.0 Beta 2 => 7.1.0 Beta 3
2015-07-12 11:26 pbaldwin Target Version 7.1.0 Beta 3 => 7.1.0 RC1
2015-07-28 18:17 pbaldwin Target Version 7.1.0 RC1 => 7.1.1
2015-10-08 15:15 pbaldwin Target Version 7.1.1 => 7.1.0 Updates
2015-11-22 20:40 pbaldwin Target Version 7.1.0 Updates => 7.2.0 Updates
2016-08-30 09:57 pbaldwin Target Version 7.2.0 Updates => 7.3.0 Beta 1
2016-11-16 09:12 pbaldwin Target Version 7.3.0 Beta 1 => 7.3.0 Beta 1
2016-12-09 09:50 pbaldwin Issue cloned: 0011501
2016-12-09 09:50 pbaldwin Relationship added related to 0011501
2016-12-09 09:52 pbaldwin Issue cloned: 0011511
2016-12-09 09:52 pbaldwin Relationship added related to 0011511
2016-12-09 10:07 pbaldwin Status confirmed => resolved
2016-12-09 10:07 pbaldwin Fixed in Version => 7.3.0 Beta 1
2016-12-09 10:07 pbaldwin Resolution open => fixed
2016-12-09 10:07 pbaldwin Assigned To => pbaldwin
2016-12-23 11:24 pbaldwin Status resolved => closed