Performance improvements for metrics#5575
Conversation
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. @carolromero & @xabier feel free to chime in. |
|
Keep open! |
16b75b8 to
55588de
Compare
|
Hi @Leusev @ivan-mr Also, @tramuntanal, do you think that we need to start having performance testing to check for this kind of issue and especially for possible regressions in the future? (That could be developed on another issue to keep small the scope of this one) |
|
Hi @andreslucena , Although this problem was a design problem rather a bad performing query, performance testing would be great of course, not only for worker processes but for specially slow loading views. Probably not to be implemented up-front but as regression tests as you said. I also plan to backport this PR to v0.22 so we can start testing it in real environments. Waiting for your approval in order to merge and backport |
| record.save! | ||
| end | ||
| @registry.each(&:save!) | ||
| @registry |
There was a problem hiding this comment.
Note that this is changing the API of the method (you were returning the list of records, now it's returning the list of cumulative), I don't know if this affects somewhere else down the line 😄
There was a problem hiding this comment.
Yes, it changes the returned value but it was used by tests (which are already refactored) but not by the background jobs, which rely on the persisted records. 👍
I can't review it but if you are confident that this improves what we already have is OK for me |
This question wasn't answered... Just to understand it, because I'm seeing lots of billed hours on PR reviews from @Leusev and @ivan-mr, but I actually don't see any comment from them in your PRs. |
Hi @andreslucena
After that, I checked that in almost all other files were replaced its own method's calls by this new one. as well as was changed the way records are saved at the moment instead of being accumulated into an instance variable Finally, I saw it was created a shared_example included/changed in _spec.rb's files in order to speed up testing too:
In other hand, I also spoke with @tramuntanal and he explained me he tested it in on Heroku environment 'cause many records were needed and in order to have an environment as close to real as possible was needed too, so I accepted it. Hope this is what you were asking for |
Ok, thanks for the clarification! |
* Retrieve component ids instead of whole objects. * Do not retain all metrics records in *MetricManage#save artifacts * Make tests succeed



🎩 What? Why?
Metrics are extremely slow in Heroku, but execute correctly in dedicated servers.
Let's see if we can improve performance and avoid workers being killed.
📌 Related Issues
📋 Subtasks
CHANGELOGentry