Displaying Apache JMeter™ Summary Report in Azure Application Insights / Log Analytics

How to display JMeter Summary 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.

For this article, let’s take a look at JMeter Aggregate Graph in Application Insight.

Setup 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.

Displaying Aggregate Graph with Application Insights / Log Analytics

This section displays JMeter Aggregate Graph in Workbooks of Application Insight.
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
Columns 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
    

    Tests list

  • Summary Report
    It extracts the same informations as the Summary Report 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)),
        Min = min(duration),
        Max = max(duration),
        StdDev = stdevp(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)),
        Min = min(duration),
        Max = max(duration),
        StdDev = stdevp(tolong(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,
        Min, Max,
        ['Std. Dev.'] = round(StdDev, 2),
        ['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),
        ['Avg. Bytes'] = round(ReceivedKB / toreal(Samples), 1)
    | project-reorder
        Label, Samples, Average, Min, Max,
        ['Std. Dev.'], ['Error %'], ['Throughput'],
        ['Received KB/sec'], ['Sent KB/sec'], ['Avg. Bytes']
    

    Application Insights Summary ReportJMeter Summary Report

I explained how to reference JMeter Summary Report in Azure Application Insights using a Kusto query.

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