Conversation
This comment was marked as resolved.
This comment was marked as resolved.
2afc4f8 to
b4ee696
Compare
This comment was marked as resolved.
This comment was marked as resolved.
b4ee696 to
dca5cbc
Compare
This comment was marked as resolved.
This comment was marked as resolved.
dca5cbc to
a4b0d88
Compare
a4b0d88 to
c06f337
Compare
| # Common case: it exists, we verify and move on. | ||
| if DetectorGroup.objects.filter(group_id=group.id).exists(): | ||
| try: | ||
| DetectorGroup.objects.get_from_cache(group=group) |
There was a problem hiding this comment.
Any sense of expected hit rate here? Even just "avg num events / avg num groups" or something would be interesting. Not a requirement, just curious..
There was a problem hiding this comment.
No idea--it's a pretty hot query according to datadog, though, so tracking this to see if there's improvement should be easy.
There was a problem hiding this comment.
There was a problem hiding this comment.
actually, at this point this method is probably a no op. every error group should be created with a Detector Group. maybe we can also call it dramatically less
There was a problem hiding this comment.
agree that we could probably reduce the number of times we're calling this method, should that be a separate ticket / investigation so we can merge this and reduce the DB load while we investigate a more holistic solution?
There was a problem hiding this comment.
Ah yes, sorry, I lost track of this because my pr tracking filtered it for not indicating it needs review, will fix.
To close the loop on usage, current data shows us typically getting value out of this code 0% of the time, and peaking at around 0.00049% of the time. Which is to say, at this point, new groups basically always have a DetectorGroup.
We see a handful per day (9 in datadog typically, but we can't go lower) and yesterday was the only spike this month with ~200 (out of >250m).
So, I guess this code is useful for turning "basically always" to "always", though I'm not sure if that's worth enough to be running this as often as we are, but caching sure helps either way (assuming a decent hit rate).
saponifi3d
left a comment
There was a problem hiding this comment.
lgtm as a way to reduce load on the DB -- it'd be cool if we could determine a way to remove or reduce this being called though. mind also adding a backlog ticket so we can track this work for after launch? (can add it to the aci backlog milestone)
No description provided.