By default, we should collect all layers. However, there should be an option to toggle whether a layer is collected individually (via a collapsed block). There's additional complexity here, but the performance cost should be minimal.

Comments

Eronarn’s picture

Once profiles are supported for PHP, we should offer them as a third option: http://support.tracelytics.com/kb/how-to/function-profiling

Eronarn’s picture

I've attached a patch for a heavily over-profiled of Views, so that you can see what it looks like with maximum profiling. I feel like cutting it down to just the build, execute, and render profiles is probably the way to go. (The way I fire off the entry/exit events admittedly looks weird, but it's the best way to handle Views 'render' time consisting of everything in between the pre- and post- render hooks.)

To go with the Panels patch I posted in #1929074: Add additional hooks, there's also a profiled version of that.

I'm posting these in this issue to show what profiles look like in Drupal - I don't think we should add any profiles to the module until we figure out how people will choose to selectively enable them, and how that will be stored in variables.

pdrake’s picture

Status: Active » Needs work

The first patch adds a setting for profiling views, but I do not see a patch that includes detailed profiling of views (the second patch has
to do with panels).

If possible, I would prefer that all of the views tracing changes be included in a single patch for ease of review.

Eronarn’s picture

Oh, my bad! I've attached a squashed Views patch. Though, as stated above, I don't recommend using it as is. It's just there as an example of what data we could collect. If you agree with my conclusion (only use build/execute/render profiles), feel free to cut it down to size.

pdrake’s picture

This issue seems to have gone a bit off track, as it has information about detailed profiling within layers rather than just settings to trace individual layers. I have committed the views detailed profiling code, but lets open separate issues for any future detailed profiling code.

Eronarn’s picture

The point of the profiles was just to illustrate that there's actually three settings: don't trace a hook, add a layer for a hook, or add a profile for a hook.

After thinking about the way profiles show up in TraceView, it's probably better to be consistent rather than flexible here. What about a select box of layers to trace (setting 'tracelytics_track_layer_%s') plus a checkbox for any layer that exposes profiles? Then add some form validation logic to require tracing a layer before tracing its profiles.

pdrake’s picture

Status: Needs work » Closed (won't fix)

Please submit this as a feature request on the new TraceView project if it is still relevant.