NRQL to display apps above a specific throughput

Hi,

Apdex results aren’t useful for low-throughput apps, as mentioned in the docs.

If your app’s throughput is less than 100 RPM, not enough data is collected to determine a stable score.

As a result, could I request help with a NRQL query to output apdex only for apps above a certain throughput? Note, I understand it’s possible to filter on specific app names/IDs but a more generic approach is required for scalability.

This is what I have for displaying apdex by application.

FROM Metric
  SELECT apdex(apm.service.transaction.apdex)
  WHERE appName LIKE '%'
  FACET appName
  TIMESERIES AUTO

This is what I have for displaying throughput by application.

FROM Metric
  SELECT rate(count(apm.service.transaction.duration), 1 minute)
  WHERE appName LIKE '%'
  FACET appName
  TIMESERIES AUTO

Cannot figure out how to combine them, either with a WHERE clause or a filter function. Any guidance/feedback would be appreciated.

Thank you.

1 Like

Hi, @rishav.dhar: What about something like this:

SELECT apdex(avgDuration) 
FROM (
  SELECT count(*) AS rpm, average(duration) AS avgDuration 
  FROM Transaction FACET appName
) 
WHERE rpm > 100

I encourage you to use events rather than metrics whenever possible; they are much more flexible.

3 Likes

Thanks for your response, @philweber.

That’s a great direction that I hadn’t thought of before. Amended to add throughput as the rate of requests per minute. However, I’m running into this issue:

image

FROM (
  FROM Transaction
  SELECT
    rate(count(*), 1 minute) AS rpm, 
    average(duration) AS avgDuration 
  FACET appName
) 
SELECT apdex(avgDuration)
FACET appName
WHERE rpm > 300
TIMESERIES AUTO

It doesn’t seem to render FACET by application with TIMESERIES AUTO. Simply falls to 0. Even though the listed apps are the correctly-filtered ones.

Any idea why this might be?

I am sorry, I don’t know.

1 Like

Try naming your inner facet and using that name on the outer facet.

1 Like

That’s new to me, how is it done? I tried the following query with the same result as above.

FROM (
  FROM Transaction
  SELECT
    rate(count(*), 1 minute) AS rpm, 
    average(duration) AS avgDuration 
  FACET appName AS stuff
) 
SELECT apdex(avgDuration)
FACET stuff
WHERE rpm > 300
TIMESERIES AUTO

Assuming that FACET appName AS stuff ... FACET stuff is the way to do it. Unfortunately, still drops down from 1 to 0 after the first data point. Although, the apps listed in the legend are the correctly filtered ones.

Need the timeseries on the inner.

1 Like

I ran into a similar problem recently and thought I would chime in as well.

I had to put TIMESERIES on both the inner and the outer query in order to render a proper timeseries chart, otherwise I think it’s plotting a timeseries of a single computation, thereby rendering 1 data point as you’ve seen.

So, in short, this worked for me when I tested it:

FROM (
  FROM Transaction
  SELECT
    rate(count(*), 1 minute) AS rpm, 
    average(duration) AS avgDuration 
  FACET appName
  TIMESERIES
) 
SELECT apdex(avgDuration)
FACET appName
WHERE rpm > 300
TIMESERIES

Update: Looks like @6MM beat me to it :sweat_smile:

3 Likes

Probably want to include a limit there also unless you don’t have many apps.

I’ve had to name the facet when faceting on time. Took me a long time to figure out why I wasn’t getting all 24 facets of an hour.

1 Like

@6MM and @jeffrey_s Thanks for the help here! @rishav.dhar Let us know if this helped with your issue or if you need any further assistance.