Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VimPerformanceState#capture - don't capture old deleted records
VimPerformanceState records only capture active objects and those deleted after this hour's time period This cuts down on the number of records processed. (by a lot) Numbers ======= ``` VimPerformanceState.first ; ExtManagementSystem.first ; ContainerImage.first ; Container.first ; nil bookend(gc:true) { Metric::Rollup.rollup_child_metrics(ContainerImage.find(627), Time.now.utc.iso8601, "historical", :containers) } ``` Numbers run for rollup_child_metrics for a parent object that hasn't been created yet. If the parent object has been run, then we don't need a capture, and we'll see no difference | ms | bytes | objects |query | qry ms | rows |` comments` | ---:| ---:| ---:| ---:| ---:| ---:| --- | 2,131.6 | 77,558,748* | 1,070,108 | 13 | 1,760.5 | 13,680 |`rollup-create-vps-before` | 1,632.5 | 5,139,458* | 393,268 | 13 | 1,517.7 | 174 |`rollup-create-vps-after` * Memory usage does not reflect 175,949 freed objects. * Memory usage does not reflect 59,056 freed objects. We've already merged code to reduce the number of records returned from VimPerformanceState#containers So removing archived from the VimPerformanceState will reduce the size of the query sent to fetch containers. This will reduce the query ms (simpler/smaller query), but this does not reduce the number of records returned And VPS#state_data went from 167,234 => 1,752 characters The savings there is due to the fact that capture does not download all the archived records. So this commit saves all the id downloads, and the commit from the fetch pr (just merged a few commits back), reduces all archived records fetch as part of the capture process
- Loading branch information