Synthetics duration breakdown mismatch?

Hello,

Could someone explain what duration values compose the overall duration described in Synthetics?

I’ve created the following NRQL that shows the total duration, the individual duration values and the individual sum. I was expecting the individual sum to match (or be very close due to averaging).

SELECT average(duration) as 'Total Duration', average(durationDNS) as 'DNS Time', average(durationConnect) as 'Connect Time', average(durationSSL) as 'SSL Time', average(durationWait) as 'Wait Time', average(durationReceive) as 'Receive Time', average(durationDNS) + average(durationConnect) + average(durationSSL) + average(durationWait) + average(durationReceive) as 'Sum duration' FROM SyntheticRequest since 1 hour ago

Example result;

TOTAL DURATION 360
DNS TIME 168
CONNECT TIME 14.9
SSL TIME 115
WAIT TIME 98.7
RECEIVE TIME 78.5
SUM DURATION 475

However, it seems the summed result should drop the durationSSL to get the right answer. Does that mean durationSSL is considered part of another duration (which would be DNS duration as it’s the only value large enough - but would make no sense) or spread across multiple values or something else? I’m voting for the something else. :upside_down_face:

Thanks.

What are you after in general? During a check you can have multiple requests and they can happen in parallel. Also, some SSL don’t include a duration above zero. A quick check of mine show about 66% have no duration.

Hi @6MM,

I have a stacked area graph showing duration over time of each component. Very much like Synthetics had in it’s classic view.

As a sanity check I compared the component sum to the duration metric - at which point the correlation seemed to fall apart. Even though I’m not expecting a perfect match through the averaging of values it seemed too different to just be an averaging error.

How is overall duration calculated and how does it relate to the individual duration metrics?

But what are you really trying to surface for the durations? I mean what value are you getting or whats a use case for looking at the breakdown and trying to correlate to duration across all reguests? Without knowing what type of synthetics you are running and how many its hard to understand the value of showing this info across all requests.

Each monitor iteration is a check and each check can have multiple requests. These requests are browser threads so they can run async. So SyntheticCheck is the duration end to end. SyntheticRequest is all the detail.

I have used tags in the past to tag the steps that I care to monitor within a check from a monitor. You can also use the url etc .

Thanks for your patience on this one @6MM

I see what you’re saying - and that made me realise I’ve missed the monitorName or monitorID from my query’s where clause.

So now we have durations specific to one monitor, and it looks more like the default chart provided on the Results dashboard of Synthetics.

However the duration metric still does not match the sum of the parts - what is the reason for this? I’m obviously not understanding how the pure “duration” metric is calculated.

Hard to say, but if you take a look at all the requests in returned in the query you might be able to tell if you have parallel requests.

OK, I’ve dug yet deeper around the “parallel requests” possibility, and removed multiple locations for the monitor, so it’s now just one - pretty much ruling out any parallelism.

The more I delve the more I just seem to be proving that the Synthetics duration metric simply does not include SSL metric…

This is the query in text for ease of replication - replace monitor name with your own;

SELECT average(durationBlocked) as 'Block', average(durationConnect) as 'Connect', average(durationDNS) AS 'DNS', average(durationSSL) as 'SSL', average(durationSend) as 'Send', average(durationWait) as 'Wait', average(durationReceive) as 'Receive', average(durationBlocked) + average(durationConnect) + average(durationDNS) + average(durationSSL) + average(durationSend) + average(durationWait) + average(durationReceive) as 'Sum duration', average(durationBlocked) + average(durationConnect) + average(durationDNS) + average(durationSend) + average(durationWait) + average(durationReceive) as 'Sum duration (no SSL)', average(duration) as 'Total' FROM SyntheticRequest WHERE monitorName = 'XXXX' and location = 'AWS_AP_SOUTHEAST_2' since 24 hour ago

The final proof is in each individual record, the “issue” is there - SSL is not included in the duration metric. But why?

NRQL for reference

SELECT durationBlocked + durationConnect + durationDNS + durationSSL + durationSend + durationWait + durationReceive as ‘Sum duration’, durationBlocked + durationConnect + durationDNS + durationSend + durationWait + durationReceive as ‘Sum duration (no SSL)’, duration as ‘Raw Duration’ FROM SyntheticRequest WHERE monitorName = ‘XXX’ and location = ‘AWS_AP_SOUTHEAST_2’ since 24 hour ago

By parallel requests I meant you have a browser check type there are potentially multiple threads and requests.

SELECT count(*) from SyntheticCheck facet type

SELECT count(*) from SyntheticRequest facet checkId

SELECT * from SyntheticRequest where checkId = 'the check id for one of your checks in question'

SELECT count(*), filter(count(*), where durationSSL > 0) from SyntheticRequest where checkId = 'the check id for one of your checks in question' facet domain, port limit max

Thanks again for the detailed response. I’ve finally been able to come back to this one.

Here’s some results from your suggested queries.

Picking one of the checkIds, I’ve confirmed there is only one entry returned from

SELECT * from SyntheticRequest where checkId = ‘CCC’

and also that the results of

SELECT * from SyntheticRequest where checkId = ‘CCC’

are also returning 1 for both “Synthetic Requests” and “Duration SSL > 0”.

Then I’ve filtered my original summation on that checkid.

For example;

SELECT checkId, durationBlocked + durationConnect + durationDNS + durationSSL + durationSend + durationWait + durationReceive as ‘Sum duration’, durationBlocked + durationConnect + durationDNS + durationSend + durationWait + durationReceive as ‘Sum duration (no SSL)’, duration as ‘Raw Duration’ FROM SyntheticRequest WHERE monitorName =‘MMM’ and location = ‘AWS_AP_SOUTHEAST_2’ and checkId = ‘CCC’ since 24 hour ago

returns (MMM and CCC have been obfuscated);

And still seeing the difference.

Can there be something still impacting this result?

Do you know you are adding things that are inclusive of other things? Like durationConnect includes durationSSL…

1 Like

Now that I did not know. And would answer my question!

That’s not very obvious, particularly when NR put that on a chart with durationSSL in the default (new) Synthetics monitoring dashboard. Implying to me that these are all separate metrics.

Interestingly the only place I could find mention of this multi purpose metric is when looking at the query and hovering over the attribute.

The data dictionary only says “The full request URL”.

So maybe some clearer documentation and graph usage is required here.

Thanks for your help @6MM. That was a long and winding road!

You can use the attribute dictionary New Relic data dictionary | New Relic Documentation

1 Like

Thanks @6MM , the data dictionary has been updated since my screen shot in the previous post! That’s a much better description than “The full request URL” that was there previously.

Not sure I should call you Lee or Steve. Worth more than the 6 million either way! :wink:

1 Like