modern template debug execution statistics aren't correct

Description

how can there be a count of 5, with an average the same as the total time?

Pretty sure this relates to the underlying problem with (duplicate stacktraces in modern debugging output)

https://github.com/lucee/Lucee/commit/1526fc9a94f8115c65a0d9189ec91c70cf747c05

a lot of the code doesn't make any sense and it's also super slow

https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/resource/context/admin/debug/Modern.cfc#L1079

  • pages.src is never a comma delimited list, it's the relative path to the file

  • page.stckTrace might as well be an ordered struct, as it's only deduped as an array later on

https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/resource/context/admin/debug/Modern.cfc#L1091

  • once again, pages.src is just a relative file path, it never contains a "$". maybe it's meant to be pages.path which sometimes contains fullpath$methodname (but often not)

https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/resource/context/admin/debug/Modern.cfc#L1167

  • this would all be redundant if you use an ordered struct to start with, instead of going from an array to a list and then finally back to an array

the actual method doesn't ever get shown, even tho it's already there in the source pages query, because page.stckTrace is extracted from pages.src which never contains a $ from what i can see, and then sometimes populated with a listlast $, so <cfif listLen(i, "$") gt 1> is always going to be false

https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/resource/context/admin/debug/Modern.cfc#L1180

Environment

None

Attachments

1

Activity

Zac Spitzer 6 July 2019 at 19:48

Part of this was coz the debug template modifies the debug log, so each time you view a log, the numbers go up.

I have submitted a patch with addresses that with a duplicate ()

But there are still problems outstanding

Zac Spitzer 5 July 2019 at 15:30

this is also very missing leading

 

it’s going to grab any other debug rows relating to this same file and adding them to the totals for the current row, which it then will count all over again when it hits the next file.

and it’s adding all the other references into the stack trace from other calls to the same file

 

and this group means that if you have multiple calls in a row, to methods in the same file only the first one is shown and then anyway, all the other calls get combined due to the QoQ.

so it all ends up being extremely misleading and confusing.

It would be a lot cleaner to split out the pre processing out from the display logic, i.e. prepare the resultset and then just display it, that would also solve LDEV-2360 i think, as it’s working on the underlying result set before it’s processed causing the confusion it think?

so, thinking about this, it’s now rather obvious that the resultQry QoQ which caused LDEV-2238 in the first place, which was added in this commit

 

 

 

 

Details

Assignee

Reporter

Priority

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 5 July 2019 at 15:03
Updated 23 October 2019 at 10:07