Skip to content

Comments

[4.4] Invalid timings in debug plugin#35655

Merged
MacJoom merged 45 commits intojoomla:4.4-devfrom
Denitz:_4.0]_Wrong_timings_in_debug_plugin
Sep 11, 2023
Merged

[4.4] Invalid timings in debug plugin#35655
MacJoom merged 45 commits intojoomla:4.4-devfrom
Denitz:_4.0]_Wrong_timings_in_debug_plugin

Conversation

@Denitz
Copy link
Contributor

@Denitz Denitz commented Sep 24, 2021

Summary of Changes

The time and memory displayed in debug bar (right position) incorrectly includes the usage of debug plugin itself: it's always much bigger than the sum of all timings in Profile tab.

We can't measure 100% correctly but at least should get closer: the most recent profile mark should have right border as closer to right as possible.

See that afterRender profile mark is not close the the right, hence we have incorrectly logged total time: it includes the time spent in debug plugin itself and we don't see the real state of page generation.

  1. Debug plugin refactored to Joomla\Event\SubscriberInterface
  2. Fixed problem with the time spent for onAfterRespond event is not counted.
  3. Added afterRespond profiler mark.
  4. Fixed problem with the time spent in onAfterDisconnect event by debug plugin is included in request time.
  5. Remove unused PlgSystemDebug::$totalQueries variable
  6. Change PlgSystemDebug::sqlShowProfiles to local variable because it's the only usage.
  7. Custom MemoryCollector to display the peak memory usage before debug data collecting routines.
  8. Display main memory usage with 3 digits.

Testing Instructions

Apply patch, see more accurate timings in debug. Profile tab marks are now more proportionally to the 100% width.

Actual result BEFORE applying this Pull Request

See issues in Changes above.

Expected result AFTER applying this Pull Request

See issues in Changes above.

Documentation Changes Required

No.

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>
Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>
@Denitz Denitz requested a review from bembelimen September 27, 2021 13:32
@Quy Quy removed the PR-4.2-dev label Mar 27, 2023
@Hackwar Hackwar added the bug label Apr 6, 2023
@laoneo laoneo changed the base branch from 4.3-dev to 4.4-dev June 9, 2023 06:20
@laoneo
Copy link
Member

laoneo commented Jun 9, 2023

Can you fix the conflicts here?

@obuisard obuisard changed the title [4.1] Invalid timings in debug plugin [4.4] Invalid timings in debug plugin Jun 9, 2023
@Denitz
Copy link
Contributor Author

Denitz commented Jun 16, 2023

@laoneo Please restart drone, smth is wrong with the tests and I can't find any relationship with the code itself.

@Denitz
Copy link
Contributor Author

Denitz commented Aug 17, 2023

Sorry, still weird issue with databases in drone

@MacJoom MacJoom merged commit 0469fac into joomla:4.4-dev Sep 11, 2023
@MacJoom MacJoom added this to the Joomla! 4.4.0 milestone Sep 11, 2023
brianteeman added a commit to brianteeman/joomla-cms that referenced this pull request Sep 22, 2023
Enable debug and then trigger a 404 on the frontend

Instead of the regular 404 page we get a 404 and a 500

This is caused by the line commented out in this PR.

That line was added by joomla#35655

Sorry I can't contribute a _real_ solution as I don't understand the code. I was just able to locate the source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.