3 New Relic Power Features You Should Be Using Today


You already know that New Relic provides deep performance metrics for your Java, .NET, PHP, Python or Ruby application. But are you familiar with the power features that can bring your knowledge about your app to a new level? Don't let the name fool you. While these features have serious power, they are easy to get started with. In this tutorial, I'll get you up and running with three powerful New Relic features you should be using today.

Developer Mode

One of the most powerful features available to Ruby developers is Developer Mode.

Developer Mode gives you high visibility into the transactions being executing on your local development machine.

You'll be able to immediately see in-depth transaction traces, including response times, individual method calls and SQL queries. Developer Mode jumps straight to the code block that is being executed, something you can't do on the normal site.

Instead of talking about Developer Mode, let's just dive in and take a look at it in action. After installing New Relic into your application, and clicking through a few actions, you'll have a list of transactions to explore at http://localhost:3000/newrelic.

Click on one of the URLs in the list and you'll get a Summary view of the entire request.

From this view, you can see every step in the request, from template rendering through the actual SQL time. In the example above, you can see that 53% of the request time was spent rendering the show.html.erb template. This is an excellent place to implement some fragment caching to speed up the request.

From the Detail view (as shown below), you can explore each step of the request, starting from the controller and action being called, through each additional method, template and SQL query. Clicking on a line like User#find_by_sql will take you to the exact line of code that made that method call (below, lower).

Finally, you can see every SQL query that a request makes by looking at the SQL view. From there, you can spot any duplicate SQL requests you might have made and go straight to the line of code that is creating it. Or, you can view detailed information about the statement to explore in-depth review of the query for information on the number of tables used, rows scanned and indexes accessed.

Having detailed performance information about your application, down to the line of code, is invaluable during development. The power of Developer Mode can really only be appreciated by using it, so, if you'd like, sign-up for a free 30-day Pro Account and give it a try.

Custom Metrics and Custom Dashboards

The New Relic agent collects a massive number of metrics about your application with very little effort, but knowing how an application is technically performing isn't the whole picture. You need to know how your business metrics are performing in your application. Custom metrics, such as order value, login attempts and signups/registrations can all be collected within New Relic, and compared against the technical performance of your application.

Custom Metrics are available in all five of the supported languages: Java, .NET, PHP, Python and Ruby.

Below is an example of a custom metric using the Python agent, but the concepts are the same for the other languages.

As you can see in the example above, we're sending one of two custom metrics whenever an order is processed. If the order succeeds, we send the dollar value of the order. Or if the order fails, we send a counter instead. Recording custom metrics like these can provide a deeper understanding of the impact that your application's performance has on your business metrics. In the case of the failed orders, by using custom metrics, you can spot problems sooner when you spot a spike in the failing metrics (e.g., your payment processor is down).

You can use custom metrics for recording timing data as well. This is an excellent way to monitor the response time of an external service you depend on.

Custom metrics should always have a name that begins with Custom/* in order to avoid any namespace collisions with the native agent metrics. Once you have these custom metrics, you can get some real visibility by combining multiple native charts with charts of your custom metrics on a Custom Dashboard. If you aren't already, you should start collecting the metrics that are critical to your business with a free 30-day Pro Account.

Scalability Analysis

It certainly would be nice to know if your app will be able to withstand a sudden surge in traffic before you actually hit the front page of Hacker News. But knowing which component of your application could be the bottleneck is hard. Will it be the application itself? Your database layer? Or maybe even the CPU utilization will be overwhelmed?

The final power feature you should be using today is the suite of Scalability Analysis reports that show you your app performance. In an ideal world, your application performance should hold fairly steady as the load increases throughout the day. You can see in the chart below that as the requests per minute (X-axis) increase, the application response time holds steady (Y-axis).

If, on the other hand, your app is not equipped to scale with increases in request, then you will see a chart with a steep slope like the one below. Here you can see that as the number of requests increases, the database response time also increases dramatically.

These types of trends are very difficult to spot without such rich visualization. Optimally, you want to see the response time grow fractionally with the increased requests. If you find that your application response time is growing geometrically with the increase, then it's time to optimize. Since you never know when your application is going to need to scale, it's important that you keep an eye on it's scalability as it grows. Tools like the Scalability Analysis and Capacity Analysis reports are a great way to easily make performance monitoring part of your routine.

If you haven't already, you can sign up for a free 30-day Pro Account at New Relic to try these and many more power features that will keep your application performing at its best.

Related Posts
  • Code
    Web Development
    How to Use New Relic With PHP & WordPressRelic retina preview
    Today we will look at how to monitor a PHP application using New Relic. More specifically we will set up a basic WordPress installation and get some performance data about it, in the New Relic dashboards.Read More…
  • Code
    Android SDK
    Using New Relic to Monitor Your Android AppGetting started new relic retina preview2
    In the last two years, New Relic has focused hard on building out a solution for monitoring the performance of mobile apps. In this tutorial, we will look at how you can start using New Relic to monitor the performance of an Android application.Read More…
  • Code
    Tools & Tips
    How to Use New Relic Custom Dashboards & Why You'd Want ToGetting started new relic retina preview2
    Today we're going to look at New Relic custom dashboards. Specifically, I will show you three ways that I tend to use custom dashboards:Read More…
  • Code
    Tools & Tips
    New Relic & JMeter - Perfect Performance TestingGetting started new relic retina preview
    Following on from the great introductory articles featured recently on Nettuts+, this article looks to show how you can take New Relic to the next level. As a performance monitoring tool New Relic is fantastic, but what about performance testing, before you go live. That's where JMeter comes in to play. In this tutorial, you will see how we can stress test our application under realistic load, and combine the output of JMeter and New Relic to give you confidence in your applications performance, before releasing into a production environment.Read More…
  • Code
    5 Reasons Why New Relic Is a Developer's Best FriendGetting started new relic retina preview2
    Once you start digging around New Relic you begin to realise just how many interesting features the service has to help monitor the performance and health of your application. It was truly difficult to pick just five things to talk about, so rather than focusing on the obvious features let's look at some of the less hyped functionality that New Relic provides and how we can use it in interesting and sometimes unorthodox ways. When we left you last time, we had a basic 'Hello World' Rails application (called New Relic_rails1, living in ~/project/tmp/New Relic). We will continue using this app, extend it and see if we can use it to demonstrate the features of New Relic that we'll be looking at.Read More…
  • Code
    Getting Started With New Relic in 30 MinutesGetting started new relic retina preview2
    I remember working on a Rails app a few years ago and someone floated the idea of using this new service that had appeared on the scene. It was called New Relic and they were promising to give you more insight into the performance of your Rails app, than you ever could get before. We gave it a try and it was impressive, more importantly it was something the Ruby web development ecosystem truly needed.Read More…