adrian

Tracy Debugger

Recommended Posts

I have latest PW+Tracy installed and when I go to edit a page in the admin I randomly get these notifications

Quote

 404 occurred: /wire/modules/Inputfield/InputfieldFile/InputfieldFile.css.map
 404 occurred: /wire/modules/LanguageSupport/LanguageTabs.css.map

I looked in those folders and there are no map files, not sure why PW is trying to find them or why they would be missing.

This seems occur when I use the "inspector" in the browser to look at elements.

Share this post


Link to post
Share on other sites
On 3/19/2018 at 9:20 PM, Robin S said:

I'm seeing an issue in the Console panel where the indentation (tabs) of saved snippets gets lost when the page is reloaded.

Thanks @Robin S - I am seeing it too - the solution however I am not seeing :) I'll try to take another look tomorrow.

 

14 hours ago, neosin said:

I looked in those folders and there are no map files, not sure why PW is trying to find them or why they would be missing.

Hi @neosin - this is not related to Tracy. Have a read: 

 

  • Like 1

Share this post


Link to post
Share on other sites
On 3/19/2018 at 9:20 PM, Robin S said:

I'm seeing an issue in the Console panel where the indentation (tabs) of saved snippets gets lost when the page is reloaded.

Hey Robin - sorry for the delay on this, but it should now be fixed - please let me know if it works for you.

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

Hey Robin - sorry for the delay on this, but it should now be fixed - please let me know if it works for you.

Thanks. Did you push the changes to GitHub? It's still showing 4.9.31 which is the version I was seeing the issue with.

  • Like 1

Share this post


Link to post
Share on other sites
31 minutes ago, Robin S said:

Thanks. Did you push the changes to GitHub? It's still showing 4.9.31 which is the version I was seeing the issue with.

Oops - sorry, I committed the tag and release for 4.9.32 but not the actual code :)

Try again now!

  • Like 1

Share this post


Link to post
Share on other sites
15 minutes ago, adrian said:

Try again now!

Working great, thanks!

  • Like 1

Share this post


Link to post
Share on other sites

hey @adrian

I'm working on my DataTables module (that might get renamed to RockGrid btw because I'm experimenting with another grid software :) ) and have 30k sample data pages (basic-page with only title field). When I open such a page in the admin, the page load takes very long (around 10s). I looked at the network tab and saw that the request for initial page load (?id=1017) loads 5.7MB of data.

Cookie: pagelist_open=JSON%5B%221-0%22%2C%221016-0%22%2C%221017-0%22%2C%227-0%22%5D;
wire=...;
wire_challenge=...;
tracyCodeError=ERROR%3A+Maximum+execution+time+of+120+seconds+exceeded+on+line%3A+454+in+D%3A%5Claragon%5Cwww%5Caggrid1%5Cwire%5Ccore%5CWireDatabasePDO.php

When i switch off tracy the page load is instant.

The code for the debug bar is huge:

5abe34353a933_2018-03-3014_56_46-view-source_www.aggrid1.to_admin_page_edit__id1017.thumb.png.d78afa1bf702eb5736d06d114ce4a018.png

Any ideas which feature of the panel is causing this behaviour?

Thanks in advance, no hurry at all with this one :) 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, bernhard said:

Any ideas which feature of the panel is causing this behaviour?

My guess is that it's the Field List & Values section of the Request Info panel. Can you try disabling just that section and let me know?

 

Share this post


Link to post
Share on other sites
Spoiler

 

 

4 hours ago, bernhard said:

The code for the debug bar is huge:

5abe34353a933_2018-03-3014_56_46-view-source_www.aggrid1.to_admin_page_edit__id1017.thumb.png.d78afa1bf702eb5736d06d114ce4a018.png

 

 

Hello Neo, are you in the Matrix already? :D

  • Like 1

Share this post


Link to post
Share on other sites
42 minutes ago, adrian said:

My guess is that it's the Field List & Values section of the Request Info panel. Can you try disabling just that section and let me know?

good guess ;)

5abe551804b24_2018-03-3017_17_17-EditPage_5abe0ddaa8d6daggrid1_to.png.3c13c58e1b64ae3c7deb0718ebe66357.png5abe551908bbb_2018-03-3017_16_50-EditPage_5abe0ddaa8d6daggrid1_to.png.456ea78e60d9bc8e5ae95dac71894c36.png

Debug Mode is also very slow, but only if Request Info is ON. If Request Info is OFF the Debug Mode is 10ms (first screenshot)

  • Like 1

Share this post


Link to post
Share on other sites

Can you post a screenshot of the contents of the Field List & Value section?

Or maybe you can send me a test version of the module so I can take a look?

Share this post


Link to post
Share on other sites

I don't see any suspicious information in the panel. Only the HTML code of the debug bar is totally bloated. I think the simplest is to test it on your own. I'm running a fresh dev installation with blank profile and tracy v4.9.33

I've just created a page "data" under /home and added 30k pages with the tracy console:

for($i=0; $i<30000; $i++) {
    $p = new Page();
    $p->template = 'basic-page';
    $p->parent = $pages->get('/data');
    $p->title = uniqid();
    $p->save();
}

Then when I open one of those pages in edit mode the tracy bar takes 10s to load..

  • Like 1

Share this post


Link to post
Share on other sites

@bernhard - could you please let me know how it goes when you disable the "Pages Loaded" section in the Debug Mode panel. This seems to be the main issue at my end.

image.png.75374c3ad0b69e9495cddbb7f5a9a603.png

Share this post


Link to post
Share on other sites

As a followup @bernhard - I notice that when editing a child with thousands of siblings, all the siblings get loaded, but this doesn't seem to be a Tracy issue - take a look at the PW core Debug Mode panel. I wonder if that's a bug?

image.png.982b0230793ffede41ed596ccdea602c.png

  • Like 1

Share this post


Link to post
Share on other sites

Hm, I have "pages loaded: 23"

$config->debug = true/false does not make any difference. Only difference is when I hit the "Disable Tracy" Button in the Debug Bar it instantly becomes fast as usual. I can send you a site profile, maybe that helps :)

 

  • Like 1

Share this post


Link to post
Share on other sites

Hey @bernhard - sorry for the delay on this - had family in town.

Please try the latest version - it prevents all siblings from being loaded by the prev/next links in the Request Info panel (which was a bug I hadn't noticed). This should actually make a huge different to anyone using Tracy on a page with a lot of siblings - can't believe I didn't come across this till now - thanks for bringing it to my attention.

One caveat - if you are running AOS with the "Add links to edit previous and next pages" feature enabled you might still have problems, although it shouldn't affect page load speed. I have made a note here: 

 

  • Like 2

Share this post


Link to post
Share on other sites
22 hours ago, adrian said:

Please try the latest version - it prevents all siblings from being loaded by the prev/next links in the Request Info panel (which was a bug I hadn't noticed). This should actually make a huge different to anyone using Tracy on a page with a lot of siblings - can't believe I didn't come across this till now - thanks for bringing it to my attention.

Thanks @adrian, that solves the issue and my pw admin is lightning fast again :) I've experienced slower loading with tracy several times, but I was not able to identify when it occured. Maybe this was the reason, I'll keep an eye.

BTW: Where do I find the prev/next links?

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, bernhard said:

Thanks @adrian, that solves the issue and my pw admin is lightning fast again :) I've experienced slower loading with tracy several times, but I was not able to identify when it occured. Maybe this was the reason, I'll keep an eye.

 

Glad to hear!

3 hours ago, bernhard said:

BTW: Where do I find the prev/next links?

In the Request Info Panel. The name is a View link and the ID is an Edit link.

image.png.c6efe82a531d35fdc19f83611005eddc.png

Share this post


Link to post
Share on other sites

Thx adrian! Didn't use the request info panel so far, but I'll start using it :)

  • Like 1

Share this post


Link to post
Share on other sites
12 minutes ago, bernhard said:

Thx adrian! Didn't use the request info panel so far, but I'll start using it :)

Don't forget to also take a look at it when editing a field, template, or module - shows all the settings for those in addition to the normal sections. Can be very handy for certain dev needs.

  • Like 2

Share this post


Link to post
Share on other sites

@bernhard - could you please check the latest version for me - I left out "include=all" for the prev/next links in the last commit. Everything still seems fast here, but would appreciate it if you could confirm it's ok at your end too please?

  • Like 1

Share this post


Link to post
Share on other sites

thx, I confirm everything is still working great :) 

  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone - looking for some feedback. The Tracy core has just introduced an option to dump objects using the __debugInfo() magic method which PW also supports.

It changes this:

image.png.ba3041ba468af6e569ded6068673daec.png

 

to:

image.png.bfb0aa40445b6cd37b4bb37ac1a068e6.png

 

What I am wondering is whether to make using __debugInfo() the default or not. And also wondering how often you guys might want to switch between one vs the other - in other words, will it be ok as a config setting, or do you think it's something that should be easier to change on-the-fly?

Thanks for any input.

  • Like 1

Share this post


Link to post
Share on other sites

Would you mind adding some additional information to your question? What is the difference between the two? What would be the pros/cons?

I use dumping a lot but I use only very basic features I guess. Most of the information in the first screencap does not seem to be very helpful to me (at least most of the time, or at least not yet). The second looks cleaner to me, but what I do not like is that "template" is a string and not a ProcessWire\Template as shown in the first pic (though that's a tiny detail and i guess dumping $page->template would show the correct classname?).

[2min later] To me, the second looks cleaner and more helpful. 

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

What I am wondering is whether to make using __debugInfo() the default or not.

You'll know more about this than me, but my understanding is that what is available in a dump from __debugInfo() depends on what the developer of the class makes available in the method. So if that method in a class was quite limited in what it made available (either intentionally or not intentionally) then the Tracy user potentially misses out on a lot of relevant information.

To give a silly example, if I do this in a class...

public function __debugInfo() {
    return ['Nothing to see here.'];
}

...then dumping an instance of it will be useless.

It looks like most of the __debugInfo() work is done in the dedicated WireDebugInfo class. If you think that Ryan has covered everything that anyone could ever need here then I guess shorter/tidier is better. But if you have doubts I'd rather get all the data as per the status quo than be wondering about what might have been overlooked.

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Soma
      LogMaintenance
      A simple ProcessWire module to give some maintenance control over log files. I found myself often having lots of log files for different things that can grow more or less quickly to a size where they can be difficult to maintain. The built in Logger of PW does a good job of giving you the possibility to delete or prune logs. But it has to be done manually and sometimes a log grows into millions of lines, which makes it often impossible to even prune it as it's too large.
      LogMaintenance uses LazyCron to run the maintenance task and there's several settings you can setup on a global or per log basis.
      Archive: will create zip files for each log file in logs/archive/ folder and add the log each time the maintenance is run to a subfolder containing the datetime.
      Lines: keeps logs to a certain number of lines 
      Days: keeps the log to a certain number of days
      Bytes: keeps the log to a certain amount of bytes
      Each setting is checked from top down, the first setting to contain something is used. So if you check the "Archive" option, all other settings are ignored and logs are archived everytime the LazyCron is executed. If you want to keep your logs to a certain amount of bytes just leave all other settings to 0 or blank.
      Per Log Settings
      There's a textarea that you can use to setup a config for a specific log file one per line. All the logs you define here ignore the global settings above. The syntax for the settings is:
      logname:[archive]:[lines]:[days]:[bytes] 
      errors:1:0:0:0 // would archive the errors log messages:0:10000:0:0 // will prune the errors log to 10000 lines  
      The module can be found on github for you to check out. It's still fresh and I'm currently testing.
      https://github.com/somatonic/LogMaintenance
    • By teppo
      Fieldtype Page IDs is a third party Fieldtype that, simply put, stores Page references as integers (Page IDs).
      This fieldtype was built as a quick and dirty workaround for Page Reference fields' inability handle self-references due to circular reference issues. A project I've been working on for a while now includes a combination of RepeaterMatrix content blocks and tagging/categorization system that would've resulted in a lot of duplicate pages (and plenty of unnecessary manual work for content editors) had I used built-in Page Reference fields, and thus a new Fieldtype felt like the most sensible approach.
      Fieldtype Page IDs was designed to be loosely compatible with Page References in order to make conversions between the two feasible, but it is quite limited feature wise:
      largely due to the fact that stored values are actually just integers with no connection to Pages whatsoever some advanced selectors and related features are not supported, and page values can't be directly accessed configuration settings are limited to the bare essentials (selector string and Inputfield class) only a handful of Inputfields (AsmSelect, Checkboxes, Text) are (currently) supported Anyway, in case you need to store Page IDs (and Page IDs only) and are happy with the limitations mentioned above, feel free to give this Fieldtype a try. It has been working fine for me in one particular project, but hasn't been tested that much, so please tread carefully – and let me know if you run into any issues.
      GitHub repository: https://github.com/teppokoivula/FieldtypePageIDs
      Modules directory: https://modules.processwire.com/modules/fieldtype-page-ids/
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      I've updated the module to 0.0.4. I removed the instructions from this forum, so I don't have to maintain it on multiple places. Just checkout the readme on github 🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github. 
    • By bernhard
      WHY?
      This module was built to fill the gap between simple $pages->find() operations and complex SQL queries.
      The problem with $pages->find() is that it loads all pages into memory and that can be a problem when querying multiple thousands of pages. Even $pages->findMany() loads all pages into memory and therefore is a lot slower than regular SQL.
      The problem with SQL on the other hand is, that the queries are quite complex to build. All fields are separate tables, some repeatable fields use multiple rows for their content that belong to only one single page, you always need to check for the page status (which is not necessary on regular find() operations and therefore nobody is used to that).
      In short: It is far too much work to efficiently and easily get an array of data based on PW pages and fields and I need that a lot for my RockGrid module to build all kinds of tabular data.

      Basic Usage

       
      Docs & Download
      https://modules.processwire.com/modules/rock-finder/
      https://gitlab.com/baumrock/RockFinder/tree/master
       
      Changelog
      180528, v1.0.4 add custom select statement option 180516 change sql query method, bump version to 1.0.0 180515 multilang bugfix 180513 beta release <180513 preview/discussion took place here: https://processwire.com/talk/topic/18983-rocksqlfinder-highly-efficient-and-flexible-sql-finder-module/
    • By blynx
      Hej,
      A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated
      (Also pull requests are appreciated 😉 - have a new Job now and don't work a lot with ProcessWire anymore, yet, feel free to contact me here or on GitHub, Im'm still "online"!)

      Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe
      .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip
      You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method:
      <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so:
      <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe
      What do you think? Any ideas, bugs, critique, requests?
      cheers
      Steffen