Skip to content

Commit

Permalink
Rename metricName to testName
Browse files Browse the repository at this point in the history
Signed-off-by: Adrián Moreno <adrian@morenomartinez.com>
  • Loading branch information
adrianmo committed Feb 11, 2020
1 parent 007b07a commit 217f3f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Then, restart JMeter and the plugin should be loaded.

To make JMeter send test result metrics to Azure Application Insights, in your **Test Pan**, right click on
**Thread Group** > Add > Listener > Backend Listener, and choose `io.github.adrianmo.jmeter.backendlistener.azure.AzureBackendClient` as `Backend Listener Implementation`.
Then, specify the metric name and the Application Insights instrumentation key as a parameter as shown in image below.
Then, specify the test name and the Application Insights instrumentation key as a parameter as shown in image below.

![Screenshot of configuration](docs/configuration.png "Screenshot of JMeter configuration")

Expand Down
Binary file modified docs/configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class AzureBackendClient extends AbstractBackendListenerClient {

private TelemetryClient client;
private static final String METRIC_NAME = "metricName";
private static final String TEST_NAME = "testName";
private static final String INSTRUMENTATION_KEY = "instrumentationKey";

public AzureBackendClient() {
Expand All @@ -29,7 +29,7 @@ public AzureBackendClient() {
@Override
public Arguments getDefaultParameters() {
Arguments arguments = new Arguments();
arguments.addArgument(METRIC_NAME, "jmeter");
arguments.addArgument(TEST_NAME, "jmeter");
arguments.addArgument(INSTRUMENTATION_KEY, "");
return arguments;
}
Expand Down Expand Up @@ -72,7 +72,7 @@ private void trackRequest(String name, SampleResult sr) {
@Override
public void handleSampleResults(List<SampleResult> results, BackendListenerContext context) {
for (SampleResult sr : results) {
trackRequest(context.getParameter(METRIC_NAME), sr);
trackRequest(context.getParameter(TEST_NAME), sr);
}
}

Expand All @@ -81,5 +81,4 @@ public void teardownTest(BackendListenerContext context) throws Exception {
client.flush();
super.teardownTest(context);
}

}

0 comments on commit 217f3f3

Please sign in to comment.