Advanced Analysis with Performator Ranged Metrics

Ranged metrics are measurements of one value that are split into buckets based on another value, for example:
Measure response time by the count of items in the response.
Measure response time based on response size.
Measure correlation between response size and request size.
Output Example
A measurement created in buckets results in multiple metrics with a range appended to them. Here is an example of such metrics, which measure the response time based on the number of rows shown in a table:
|Name |Count |Min |Avg |Max |P90 |Fails[%]|
|-------------------------------------|-----------|-------|----|-----|----|--------|
|070.4 TableLoadTime #Rows 0000 |193 |0 |17 |245 |171 |0 |
|070.4 TableLoadTime #Rows 0001-0050 |484 |4 |188 |8343 |1948|0 |
|070.4 TableLoadTime #Rows 0051-0100 |89 |14 |1615|6643 |4800|0 |
|070.4 TableLoadTime #Rows 0101-0200 |131 |18 |1834|9800 |6426|0 |
|070.4 TableLoadTime #Rows 0201-0400 |329 |14 |1787|9970 |6538|0 |
|070.4 TableLoadTime #Rows 0401-0800 |608 |16 |1801|9630 |6601|0 |
|070.4 TableLoadTime #Rows 0801-1600 |797 |36 |2138|9340 |6777|0 |
|070.4 TableLoadTime #Rows 1601-3200 |1153 |30 |2731|9900 |8082|0 |
|070.4 TableLoadTime #Rows 3201-6400 |1108 |55 |3900|10000|8860|0 |
|070.4 TableLoadTime #Rows 6401-12800 |301 |100 |4656|9990 |9340|0 |The buckets increase exponentially to reduce the number of metrics we have to analyze and to avoid cluttering the report.
What Can We Do With It?
Using ranged metrics allows us to visualize how response times change as the amount of data processed changes. This can help show whether a piece of software is already scaling well or if there is potential for improvement.
When combining such metrics with a boxplot analysis, like in the following screenshot, you can see at a glance where response times are increasing with the amount of data loaded.

While it depends on each system whether an increased response time can be handled or not, it is always beneficial for developers to know how a system behaves when processing different amounts of data.
Creating Ranged Metrics
Ranged metrics are useful to analyze correlations between two values. Typically used to measure response times in relation to the amount of data loaded. Below is an example of how to create one:
// used to analyze correlation between count and duration
int multiplier = HSR.Random.integer(0, 10);
int rangeCount = multiplier * HSR.Random.integer(1, 900);
int duration = multiplier * HSR.Random.integer(10, 1000);
HSR.addMetricRanged("TableLoadTime #Rows", duration, rangeCount, 50); // 50 = initial range
The Stats Engine also provides shorthand methods to create a ranged metric based on a record that has already ended. This also allows you to take over the record's SLA definition if you wish.
//-------------------------------
// Ranged Metric For Record
HSRRecord record = HSR.end();
int count = <yourCount>;
HSR.addMetricRanged(record, " - #Count", count, 5);
// or with SLA
HSR.addMetricRangedWithSLA(record, " - #Count", count, 5); Conclusion
We can use ranged metrics to analyze the correlation of execution times and the amount of data processed. Combining it with a visualization in boxplots, you can see the behavior at a glance.
If you would like to learn more about ranged metrics or any Performator capability, feel free to reach out today. Our experts at Performetriks would be happy to assist you!
Happy Performance Engineering!




Comments