Skip to content

Commit

Permalink
version 1.2 change globally ELK with ELASTIC
Browse files Browse the repository at this point in the history
  • Loading branch information
DABURON Vincent committed Jan 30, 2024
1 parent 2b64052 commit ea960a4
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 77 deletions.
110 changes: 56 additions & 54 deletions README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/images/architecture_jmeter_tomcat_elk.png
Binary file not shown.
Binary file modified doc/images/script_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/udv_elastic_properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/images/udv_elkp_properties.png
Binary file not shown.
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<modelVersion>4.0.0</modelVersion>

<groupId>io.github.vdaburon</groupId>
<artifactId>jmeter-elk-apm</artifactId>
<version>1.1</version>
<artifactId>jmeter-elastic-apm</artifactId>
<version>1.2</version>
<packaging>jar</packaging>
<name>Manage ELK APM integration for Apache JMeter</name>
<description>ADD/REMOVE ELK APM library api call around Transaction Controller, you will see timeline and sub calls for the Transaction Controller (Page) in Kibana</description>
<name>Manage ELASTIC APM integration for Apache JMeter</name>
<description>ADD/REMOVE ELASTIC APM library api call around Transaction Controller, you will see timeline and sub calls for the Transaction Controller (Page) in Kibana</description>
<url>https://github.com/vdaburon/jmeter-elk-apm</url>
<inceptionYear>2024</inceptionYear>

Expand Down Expand Up @@ -39,9 +39,9 @@
</issueManagement>

<scm>
<connection>https://github.com/vdaburon/jmeter-elk-apm.git</connection>
<developerConnection>https://github.com/vdaburon/jmeter-elk-apm.git</developerConnection>
<url>https://github.com/vdaburon/jmeter-elk-apm</url>
<connection>https://github.com/vdaburon/jmeter-elastic-apm.git</connection>
<developerConnection>https://github.com/vdaburon/jmeter-elasitc-apm.git</developerConnection>
<url>https://github.com/vdaburon/jmeter-elastic-apm</url>
<tag>HEAD</tag>
</scm>

Expand Down Expand Up @@ -131,7 +131,7 @@
<archive>
<manifest>
<mainClass>
io.github.vdaburon.jmeter.elkapmxml.ElkApmJMeterManager
io.github.vdaburon.jmeter.elasticapmxml.ElasticApmJMeterManager
</mainClass>
</manifest>
</archive>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.vdaburon.jmeter.elkapmxml;
package io.github.vdaburon.jmeter.elasticapmxml;

import java.io.BufferedReader;
import java.io.BufferedWriter;
Expand Down Expand Up @@ -27,13 +27,13 @@
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;

public class ElkApmJMeterManager {
private static final Logger LOGGER = LoggerFactory.getLogger(ElkApmJMeterManager.class);
public class ElasticApmJMeterManager {
private static final Logger LOGGER = LoggerFactory.getLogger(ElasticApmJMeterManager.class);
// fixed string to find in the jmeter script or in the extracted xml files
private static final String PARAM_TC_NAME = "@@TC_NAME";
private static final String COMMENT_BEGIN_ELK_APM = "@@ELK_APM_BEGIN";
private static final String COMMENT_END_ELK_APM = "@@ELK_APM_END";
private static final String COMMENT_APM_UDV = "@@ELK_APM_UDV";
private static final String COMMENT_BEGIN_ELASTIC_APM = "@@ELASTIC_APM_BEGIN";
private static final String COMMENT_END_ELASTIC_APM = "@@ELASTIC_APM_END";
private static final String COMMENT_APM_UDV = "@@ELASTIC_APM_UDV";

// CLI OPTIONS
public static final String K_JMETER_FILE_IN_OPT = "file_in";
Expand Down Expand Up @@ -278,10 +278,10 @@ private static LinkedList<String> addSamplerForElkApm(LinkedList<String> lkfileJ
private static LinkedList<String> removeSamplerForElkApm(LinkedList<String> lkfileJMeterOrig, String regexTc, LinkedList<String> lkStart, LinkedList<String> lkEnd, LinkedList<String> lkUdvUnderTp) {
LinkedList<String> lkReturn = new LinkedList<String>();

Pattern patternCommentStartEltTc = Pattern.compile(".*?<stringProp name=\"TestPlan.comments\">" + COMMENT_BEGIN_ELK_APM + "</stringProp>"); // JSR223 for begin transaction
Pattern patternCommentStartEltTc = Pattern.compile(".*?<stringProp name=\"TestPlan.comments\">" + COMMENT_BEGIN_ELASTIC_APM + "</stringProp>"); // JSR223 for begin transaction
Pattern patternStartEltJsr223 = Pattern.compile(".*?<JSR223Sampler guiclass=\"TestBeanGUI\" testclass=\"JSR223Sampler\".*");

Pattern patternCommentEndEltTc = Pattern.compile(".*?<stringProp name=\"TestPlan.comments\">" + COMMENT_END_ELK_APM + "</stringProp>"); // JSR223 for end transaction
Pattern patternCommentEndEltTc = Pattern.compile(".*?<stringProp name=\"TestPlan.comments\">" + COMMENT_END_ELASTIC_APM + "</stringProp>"); // JSR223 for end transaction
Pattern patternCommentEltArgument = Pattern.compile(".*?<stringProp name=\"TestPlan.comments\">" + COMMENT_APM_UDV + "</stringProp>"); // UDV with ELK_APM_UDV
Pattern patternStartEltArguments = Pattern.compile(".*?<Arguments guiclass=\"ArgumentsPanel\" testclass=\"Arguments\".*");

Expand Down Expand Up @@ -514,14 +514,14 @@ private static Properties parseOption(Options optionsP, String args[])

private static void helpUsage(Options options) {
HelpFormatter formatter = new HelpFormatter();
String footer = "E.g : java -jar jmeter-elk-apm-<version>-jar-with-dependencies.jar -" + K_JMETER_FILE_IN_OPT + " script1.jmx -"
String footer = "E.g : java -jar jmeter-elastic-apm-<version>-jar-with-dependencies.jar -" + K_JMETER_FILE_IN_OPT + " script1.jmx -"
+ K_JMETER_FILE_OUT_OPT + " script1_add.jmx -" + K_ACTION_OPT + " ADD -"
+ K_REGEX_OPT + " SC.*\n";
footer+="E.g : java -jar jmeter-elk-apm-<version>-jar-with-dependencies.jar -" + K_JMETER_FILE_IN_OPT + " script1_add.jmx -"
footer+="E.g : java -jar jmeter-elastic-apm-<version>-jar-with-dependencies.jar -" + K_JMETER_FILE_IN_OPT + " script1_add.jmx -"
+ K_JMETER_FILE_OUT_OPT + " script1_remove.jmx -" + K_ACTION_OPT + " REMOVE -"
+ K_REGEX_OPT + " .*";
formatter.printHelp(120, ElkApmJMeterManager.class.getName(),
ElkApmJMeterManager.class.getName(), options, footer, true);
formatter.printHelp(120, ElasticApmJMeterManager.class.getName(),
ElasticApmJMeterManager.class.getName(), options, footer, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ if (sAPM_ACTIVE == null || &quot;TRUE&quot;.equalsIgnoreCase(sAPM_ACTIVE)) {
vars.putObject(&quot;V_APM_TRANSACTION_TC&quot;, null);
}
}</stringProp>
<stringProp name="TestPlan.comments">@@ELK_APM_END</stringProp>
<stringProp name="TestPlan.comments">@@ELASTIC_APM_END</stringProp>
</JSR223Sampler>
<hashTree/>
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ if (sAPM_ACTIVE == null || &quot;TRUE&quot;.equalsIgnoreCase(sAPM_ACTIVE)) {
log.error(&quot;Exception ex = &quot; + ex.toString());
}
}</stringProp>
<stringProp name="TestPlan.comments">@@ELK_APM_BEGIN</stringProp>
<stringProp name="TestPlan.comments">@@ELASTIC_APM_BEGIN</stringProp>
</JSR223Sampler>
<hashTree/>
2 changes: 1 addition & 1 deletion src/main/resources/extract_udv_elk_under_testplan.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
<stringProp name="TestPlan.comments">@@ELK_APM_UDV</stringProp>
<stringProp name="TestPlan.comments">@@ELASTIC_APM_UDV</stringProp>
</Arguments>
<hashTree/>

0 comments on commit ea960a4

Please sign in to comment.