Closed Bug 963236 Opened 11 years ago Closed 11 years ago

uses of TCBS model in crashstats view are getting cold cache

Categories

(Socorro :: Webapp, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rhelmer, Assigned: rhelmer)

References

Details

The current three users of the TCBS model in the view of the crashstats app are passing in a full datetime (down to the second) to the model, which is causing them to get a cold cache (the underlying data here only updates once per day). I am not sure if the model should enforce this, but at the very least we should format this down to "%Y-%m-%d" to more effectively cache the TCBS model, which currently uses a very expensive underlying query.
I think the model should enforce this with the `possible_params` which is currently set to `datetime.date` [0]. I don't remember exactly how it works but that would be the place to start. [0] https://github.com/mozilla/socorro/blob/master/webapp-django/crashstats/crashstats/models.py#L656
(In reply to Peter Bengtsson [:peterbe] from comment #1) > I think the model should enforce this with the `possible_params` which is > currently set to `datetime.date` [0]. I don't remember exactly how it works > but that would be the place to start. > > [0] > https://github.com/mozilla/socorro/blob/master/webapp-django/crashstats/ > crashstats/models.py#L656 OK, so either we can silently cast or raise an exception if the type does not match exactly - I think the latter is the way to go.
Currently the types are only used by the API, there's no type checking of required params that I can see. Going to split this out to a separate bug.
(In reply to Robert Helmer [:rhelmer] from comment #3) > Currently the types are only used by the API, there's no type checking of > required params that I can see. Going to split this out to a separate bug. Split out to bug 963297
Status: NEW → ASSIGNED
Commits pushed to master at https://github.com/mozilla/socorro https://github.com/mozilla/socorro/commit/2074f9747d4dcb88c93efaa6db5eaaf317eed1bc bug 963236 - tcbs cache is not being used effectively due to over-precise end_date https://github.com/mozilla/socorro/commit/7e3909a533db77173cc184778904adee8f28390f Merge pull request #1816 from rhelmer/bug963236-effectively-cache-tcbs fixes bug 963236 - tcbs cache is not used due to over-precise end_date
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Blocks: 952199
Target Milestone: --- → 72
You need to log in before you can comment on or make changes to this bug.