Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tool to remove grouping from report results
https://bugzilla.redhat.com/show_bug.cgi?id=1590908 Some aggregation information was persisted into the miq_report_results table in the report column's `extras[:grouping]` section. We don't need the grouping after we've generated the html data. This tool removes this from each row in the table. The default options will process the whole table in batches of 50 at a time and will persist all changes. If you run it with -h, you'll receive a help banner: ``` Remove extras[:grouping] from MiqReportResult#report column. Usage: ruby tools/remove_grouping_from_report_results.rb [options] Options: --dry-run For testing, rollback any changes when the script exits. -b, --batch-size=<i> Limit memory usage by process this number of report results at a time. (Default: 50) -c, --count=<i> Stop checking after this number of report results. (Default: 0) -h, --help Show this message ``` Example output looks like this: ``` ruby tools/remove_grouping_from_report_results.rb -c 11 Using options: {:dry_run=>false, :batch_size=>50, :count=>11, :help=>false, :count_given=>true} ** Using session_store: ActionDispatch::Session::MemCacheStore MiqReportResult: 22000000000001 doesn't need fixing MiqReportResult: 22000000000002 doesn't need fixing MiqReportResult: 22000000000003 fixed MiqReportResult: 22000000000004 doesn't need fixing MiqReportResult: 22000000000005 doesn't need fixing MiqReportResult: 22000000000006 fixed MiqReportResult: 22000000000007 doesn't need fixing MiqReportResult: 22000000000008 doesn't need fixing MiqReportResult: 22000000000009 doesn't need fixing MiqReportResult: 22000000000010 doesn't need fixing MiqReportResult: 22000000000011 fixed Processed 11 rows. 1 were fixed. 13.170998 seconds ```
- Loading branch information