Stethoscope for Craft CMS

Stethoscope is a Craft 6 plugin. Craft 6 is still in beta, and so is Stethoscope (6.0.0-beta.1) — try it on staging first and use caution on production sites.

Timing templates

Craft times whole renders. To find out which part of a page is slow — an include, a loop, a macro — wrap it:

{% stethoscope 'related entries' %}
  {% include '_partials/related' %}
{% endstethoscope %}
@stethoscope('related entries')
  @include('partials.related')
@endstethoscope

Both record to the Template timings card under the label, the site and the template it's in, with count, average and slowest time. They call the same code, so a Twig and a Blade version of a page record identically.

  • Labels can be any expression: {% stethoscope 'card ' ~ entry.type.handle %}. Keep them to a small set of values — each distinct label is its own row — and don't put titles or user data in them. Email and IP addresses in labels are scrubbed anyway.
  • Timings nest, and an exception inside the block still ends the timing.
  • An empty label times nothing.
  • The tag works in site templates. Front-end requests only: control panel renders aren't recorded.

More plugins

Pairs well with Stethoscope