True RPS – Application Insights

Some time ago I posted an article about how to calculate RPS in Application Insight or KQL (a.k.a. AQL).

Turns out, that query only works under heavy load. By heavy load I mean a kind of traffic that has activity per unit of your bin (per second.)

What I want to do is to draw a graph for a heartbeat. The heartbeat was happening once every few seconds. When I run the query from my previous article it removed all the none active seconds (seconds with 0 activity) and this was the result:

Wrong RPS

As you can see we do not see the seconds that have no activity and therefore the result is a straight line.

As you probably have guessed we need to first lay down each second with a default value of zero for it’s activity and then feed it with real activity.

The script will look something like this:

which results in the following chart for the exactly same duration:

Application Insight RPS

That is much better now. We have a graph that shows the expected result.

It’s worth mentioning that true RPS cannot be done for the long duration because of too many data points.

Do you know any other/better way of calculating the true and exact RPS?

Leave a Reply

Your email address will not be published. Required fields are marked *