Views provide integration with Devel to display the time taken to create a view.

But, the current version of views only displays the timing info when the view is in a block only. If the view is a page, or is embedded, no timing information is displayed.

The attached patch fixes this, and displays timing information for page views and embedded views.

This is against 6.x-2.x-dev, but applies with offset to 6.x-3.x-dev as well. I tested it on a couple of sites and it works well.

Comments

kbahey’s picture

StatusFileSize
new1.24 KB

And the patch itself is now attached.

merlinofchaos’s picture

Instead of duplicating the code, can we move the code so that all views -- page, block, embedded, calendar, feeds, etc, can benefit from this?

kbahey’s picture

StatusFileSize
new2.5 KB

The page and block ones use the $view->execute_display(), the embed one uses $view->preview().

Is it enough to change the execute_display() and the preview() functions in the views.inc file, or is there other stuff I am missing?

I attached a patch that puts the display in the preview and in the execute_display. See if that is enough. If it is not, then point me in the right direction ...

merlinofchaos’s picture

Tentatively yes, I think that's the right place. I'll look more closely at this a little later on but I think this looks pretty good in a quick scan.

kbahey’s picture

StatusFileSize
new2.51 KB

The patch had an error in it. I fixed it and tested it on a live site, and it works.

Attached.

merlinofchaos’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Needs review » Patch (to be ported)

Committed to 6.x-3.x

dawehner’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new2.61 KB

I renamed vpr to the generic debug function of drupal core: http://api.drupal.org/api/function/debug/7

Just ignore the name :)

dawehner’s picture

StatusFileSize
new2.4 KB

Rerolled the patch, but i don't see the queries.

dawehner’s picture

Status: Needs review » Needs work

And this should be called as needs review? THIS IS NOT REVIEW.

dawehner’s picture

StatusFileSize
new1.9 KB

Here is a rerole. It works in general but drupal_add_region_content doesn't work at the moment.

mustanggb’s picture

Category: Task » Feature request
Issue summary: View changes