Performance Zone is brought to you in partnership with:

Leigh has been in the technology industry for over 15 years, writing marketing and technical documentation for Sun Microsystems, Wells Fargo, and more. She currently works at New Relic as a Marketing Manager. Leigh is a DZone MVB and is not an employee of DZone and has posted 106 posts at DZone. You can read more from them at their website. View Full User Profile

DrupalCon 2013: Introducing Drupal Hooks and Views Metrics

05.22.2013
| 2014 views |
  • submit to reddit
This post comes from Belinda Runkle at the New Relic Blog.


We <3 Drupal!

DrupalCon has returned to Portland. And naturally we’re very excited about our most recent release of the New Relic PHP agent.

The Drupal ecosystem has been a huge part of New Relic’s success. The ‘come for the software, stay for the community’ aspect of Drupal makes it one of the busiest and enthusiastic communities we have the pleasure of serving. Drupal makes it easy for developers and ‘themers’ to extend the platform. And this energy is part of the reason why it’s one of the most popular CMS platforms around.

Drupal Can Sometimes Be Slow
The dark side of having such an easy-to-extend platform and a welcoming community is that anyone can extend Drupal. Anyone with sufficient PHP skills and the gumption to dig into the API docs can write modules. As of today, there are over 25,000 developers on Drupal.org, and over 21,000 modules.

This means the Drupal ecosystem is bursting at the seams with modules. Many modules never see the light of Drupal.org. They lay hidden away within your private repos. The ease of extending Drupal means it can be non-intuitive for developers to write well-performing modules. For small sites with limited users, it’s easy to get away with this as Drupal allows you to be otherwise very productive. Creating rich web sites with beautiful content is easy to do and that’s what Drupal developers should be able to focus on.

What Drupal Developers Want
We talked to Drupal developers about how we could best help them make New Relic more useful and efficient for those times when they need to be concerned with performance. And they told us they needed a better way to beeline to the slowest code that they needed to fix. So we listened and came up with some pretty cool stuff in version 3.5 of the PHP agent, which just released on May 15th!

Drupal Hooks Metrics
The ‘currency’ of the Drupal API is the hook system – it’s what makes Drupal the extensible system that it is today. We now provide metrics by hook.

This is extremely helpful for developers who write their own modules so they can identify those slow-running hooks. This is also useful for finding out which community modules may have hooks that could benefit from some optimization.

Drupal Hooks

Views Metrics
Views are a beautiful thing in Drupal. Like database views, Drupal Views are a great way to create reusable segments of data based on a set of criteria. They can be reused throughout your application in a way that helps ensure some content consistency.

The dirty underbelly of Views, however, are their ability to generate poorly performing SQL statements. The Views themselves aggregate the results of those individual SQL statements. We already report on the SQL in New Relic with our ‘Slow SQL’ tab – our #1 feature amongst Drupalists.

With the new Views metrics you can now see the aggregated impact of all those SQL statements as well as the Drupal module execution time. What a great way to figure out which of your Views are stinkers ripe for refactoring to better ones or moved to custom module code or even straight SQL.

Drupal Views

Better Drupal Module Monitoring

We’ve made some improvements to our existing Drupal module monitoring so that it calculates exclusive time for  this monitoring, giving you a more accurate picture of how your Drupal modules are behaving.

Drupal Modules

Function Profiling
We’re also providing function profiling so you can see the 50 most frequently called functions and the 50 slowest functions for individual web requests. This data is now used on the Transaction Trace Summary tab, allowing a more accurate and complete display of the slowest PHP components that run underneath your Drupal application.

We hope our Drupal customers are pleased with these cool improvements. Install the latest PHP agent and give them a try.

If you’re coming to Portland for DrupalCon, you can sign up for 30 days of free New Relic. We’ll be at the show with our PHP Agent engineers. Come talk to us and ask for a demo of the new coolness!

If you aren’t able to make DrupalCon and are in Portland, come see the live-streamed DrupalCon keynotes at our our office on the 28th floor of “Big Pink.” We’ll provide free drinks, snacks, and Wi-Fi for anyone that wants to join us. Also make sure to check out our earlier post on all the other cool features we’ve been adding to our PHP agent.

Published at DZone with permission of Leigh Shevchik, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)