Visualizing Apache JMeter™ Aggregate Report with Azure Application Insights and Log Analytics

I will show you how to use the jmeter-backend-azure plugin to reference JMeter Aggregate Report in Azure Application Insights / Log Analytics.

To flexibly visualize, analyze, and manage JMeter test results, you can use Azure Application Insights.
This is accomplished by using the jmeter-backend-azure plugin to send the test results to Application Insights.
And if that Application Insights is workspace-based, it can be integrated with Log Analytics and benefit from that as well.

This article explains how to view the JMeter Aggregate Report in Azure Application Insights.

Installing the jmeter-backend-azure plugin and sending the test results to Azure Application Insights

Please refer to the jmeter-backend-azure README, which is easy to understand.

Visualizing Test Results with Azure Application Insights / Log Analytics

You can flexibly visualize and analyze test results by writing Kusto query (kql) on the “Logs” or the “Workbooks”.

Note that the table and column names are different between Application Insights and Log Analytics.
This is a mapping of the table and columns referenced in the samples in this article.

- Application Insights Log Analytics
Table requests AppRequests
Column name Name
success Success
duration DurationMs
customDimensions Properties

The following samples in this article are for Application Insights.
If you use Log Analytics, follow the mapping above and replace the table and column names.

  • Narrow down your view and analysis targets
    “requests” (Application Insights) / “AppRequests” (Log Analytics) table may contain all the test results JMeter sent to Application Insights, as well as other logs that are not JMeter.
    If you want to visualize or analyze results for a single test only, you can narrow it down with “name” and “customDimensions.TestStartTime”.

    You can also narrow it down by “name” only by changing the “testName” of the Backend Listener each time you test.

    The following Kusto will get a list of names and TestStartTime.

    requests
    | extend
        TestStartTime = tostring(customDimensions.TestStartTime)
    | distinct TestStartTime, name
    | extend
        formattedTestStartTime
            = format_datetime(
                unixtime_milliseconds_todatetime(tolong(TestStartTime)),
                'yyyy/MM/dd HH:mm:ss'
            )
    | sort by TestStartTime desc
    

    List of tests

  • Aggregate Report
    It extracts the same informations as the Aggregate Report listener in JMeter.

    let testName = "<The value of the previously obtained "name">";
    let TestStartTime = "<The value of the previously obtained "TestStartTime">";
    requests
    | where name == testName
        and customDimensions.TestStartTime == TestStartTime
    | summarize
        Samples = count(),
        Average = tolong(avg(duration)),
        (L50, L90, L95, L99)
            = percentiles(duration, 50, 90, 95, 99),
        Min = min(duration),
        Maximum = max(duration),
        ErrorCount = countif(success == false),
        ReceivedKB = sum(tolong(customDimensions.Bytes)),
        SentKB = sum(tolong(customDimensions.SentBytes)),
        StartTime = min(tolong(customDimensions.SampleStartTime)),
        EndTime = max(tolong(customDimensions.SampleEndTime))
        by Label = tostring(customDimensions.SampleLabel)
    | extend s = 0
    | union (
    requests
    | where name == testName
        and customDimensions.TestStartTime == TestStartTime
    | summarize
        Samples = count(),
        Average = tolong(avg(duration)),
        (L50, L90, L95, L99)
            = percentiles(duration, 50, 90, 95, 99),
        Min = min(duration),
        Maximum = max(duration),
        ErrorCount = countif(success == false),
        ReceivedKB = sum(tolong(customDimensions.Bytes)),
        SentKB = sum(tolong(customDimensions.SentBytes)),
        StartTime = min(tolong(customDimensions.SampleStartTime)),
        EndTime = max(tolong(customDimensions.SampleEndTime))
    | extend Label = 'TOTAL', s = 9
    )
    | extend
        tp = Samples / ((EndTime - StartTime) / 1000.0),
        KBPeriod = (EndTime - StartTime) * 1024 / 1000.0
    | sort by s asc
    | project
        Label, Samples, Average,
        Median = round(L50),
        ['90% Line'] = round(L90),
        ['95% Line'] = round(L95),
        ['99% Line'] = round(L99),
        Min, Maximum,
        ['Error %'] = strcat(round(ErrorCount * 100.0 / Samples, 2), '%'),
        ['Throughput'] = iif(tp < 1.0,
                            strcat(round(tp * 60, 1), '/min'),
                            strcat(round(tp, 1), '/sec')
                         ),
        ['Received KB/sec'] = round(ReceivedKB / KBPeriod, 2),
        ['Sent KB/sec'] = round(SentKB / KBPeriod, 2)
    | project-reorder
        Label, Samples, Average,
        ['Median'], ['90% Line'], ['95% Line'], ['99% Line'],
        Min, Maximum, ['Error %'], ['Throughput'],
        ['Received KB/sec'], ['Sent KB/sec']
    

    Aggregate Report \(Application Insights\)Aggregate Report \(JMeter\)

    The values of Median, 90% Line, 95% Line, and 99% Line seem to differ from the Aggregate Report in JMeter in some cases.
    This seems to be because the percentiles function of the Kusto is calculated by estimation.

I explained how to reference JMeter test results in Azure Application Insights using a Kusto query.
In the future, I will also introduce the Kusto query, which outputs the same results as other listeners.

[ad]
Easy build the JMeter distributed test environment in Azure by
“Load Tester Powered by Apache JMeter™”