Track and display middleware time in the toolbar
Description
CPU time includes the debug toolbar's own time so this PR aims to track how long the middleware takes to run and display that time on the panel.
Fixes #1903
Checklist:
- [x] I have added the relevant tests for this change.
- [x] I have added an item to the Pending section of
docs/changes.rst.
Would it make sense to include a stat with the middleware time deducted from the total for the user? Or deduct it from the existing total?
@robhudson the thinking I had earlier was that the toolbar changes the application so we shouldn't try to extract the toolbar itself from the timing.
@earthcomfy do you have time to pick this back up? If not, @robhudson could ask a Djangonaut from the next session of Djangonaut Space to get it over the finish line.
@tim-schilling Thanks for following up! I don’t think I’ll have time to return to this, so feel free to reassign it:)