Skip to content

Commit

Permalink
Release XLT 6.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jowerner committed Apr 7, 2022
2 parents f7e55d4 + f7126f1 commit f839773
Show file tree
Hide file tree
Showing 23 changed files with 292 additions and 162 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.xceptance</groupId>
<artifactId>xlt</artifactId>
<version>6.1.1</version>
<version>6.2.0</version>
<packaging>jar</packaging>

<name>XLT</name>
Expand Down Expand Up @@ -285,6 +285,12 @@
<artifactId>jcommon</artifactId>
<version>1.0.24</version>
</dependency>
<dependency>
<!-- optional dependency of dnsjava, but XLT requires it -->
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>5.11.0</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
Expand Down
1 change: 1 addition & 0 deletions samples/testsuite-performance/config/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ com.xceptance.xlt.loadtests.TLWSimpleURL.class = com.xceptance.xlt.performance.t
# contentTypePattern [c] ... Reg-ex defining a matching response content type
# statusCodePattern [s] .... Reg-ex defining a matching status code
# urlPattern [u] ........... Reg-ex defining a matching request URL
# methodPattern [m] ........ Reg-ex defining a matching request method
# runTimeRanges [r] ........ List of run time segment boundaries
#
# stopOnMatch .............. Whether or not to process the next rule even if
Expand Down
1 change: 1 addition & 0 deletions samples/testsuite-posters/config/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ xlt.reporting.metricNamePrefix = xlt.Posters.
# contentTypePattern [c] ... Reg-ex defining a matching response content type
# statusCodePattern [s] .... Reg-ex defining a matching status code
# urlPattern [u] ........... Reg-ex defining a matching request URL
# methodPattern [m] ........ Reg-ex defining a matching request method
# runTimeRanges [r] ........ List of run time segment boundaries
#
# stopOnMatch .............. Whether or not to process the next rule even if
Expand Down
1 change: 1 addition & 0 deletions samples/testsuite-showcases/config/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ com.xceptance.xlt.showcases.tests.TCrawler.attackStrings = ">XSS|<script>alert(d
# contentTypePattern [c] ... Reg-ex defining a matching response content type
# statusCodePattern [s] .... Reg-ex defining a matching status code
# urlPattern [u] ........... Reg-ex defining a matching request URL
# methodPattern [m] ........ Reg-ex defining a matching request method
# runTimeRanges [r] ........ List of run time segment boundaries
#
# stopOnMatch .............. Whether or not to process the next rule even if
Expand Down
1 change: 1 addition & 0 deletions samples/testsuite-template/config/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ xlt.reporting.metricNamePrefix = xlt.MyProject.
# contentTypePattern [c] ... Reg-ex defining a matching response content type
# statusCodePattern [s] .... Reg-ex defining a matching status code
# urlPattern [u] ........... Reg-ex defining a matching request URL
# methodPattern [m] ........ Reg-ex defining a matching request method
# runTimeRanges [r] ........ List of run time segment boundaries
#
# stopOnMatch .............. Whether or not to process the next rule even if
Expand Down
1 change: 1 addition & 0 deletions samples/testsuite-xlt/config/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ com.xceptance.xlt.http.filter.include = http://localhost example.org
# contentTypePattern [c] ... Reg-ex defining a matching response content type
# statusCodePattern [s] .... Reg-ex defining a matching status code
# urlPattern [u] ........... Reg-ex defining a matching request URL
# methodPattern [m] ........ Reg-ex defining a matching request method
# runTimeRanges [r] ........ List of run time segment boundaries
#
# stopOnMatch .............. Whether or not to process the next rule even if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public class AgentControllerProxy extends AgentControllerImpl
* @param urlConnectionFactory
*/
public AgentControllerProxy(final Properties commandLineProperties, final HessianProxyFactory proxyFactory,
final UrlConnectionFactory urlConnectionFactory) throws Exception
final UrlConnectionFactory urlConnectionFactory)
throws Exception
{
super(commandLineProperties);

Expand Down Expand Up @@ -98,10 +99,13 @@ protected void setupEnvironment(final AgentManager agentManager) throws IOExcept
*/
@Override
public void init(final String name, final URL url, final int weight, final int agentCount, final int agentBaseNumber,
final boolean runsClientPerformanceTests) throws IOException
final boolean runsClientPerformanceTests)
throws IOException
{
super.init(name, url, weight, agentCount, agentBaseNumber, runsClientPerformanceTests);

setupAgentManagers();

// start proxy
startProxy(getUrl());
}
Expand Down Expand Up @@ -288,7 +292,6 @@ public FileReplicationIndex getAgentFilesIndex() throws IOException
@Override
public void updateAgentFiles(final String agentFilesZipFileName, final List<File> filesToBeDeleted) throws IOException
{
setupAgentManagers();
getAgentController().updateAgentFiles(agentFilesZipFileName, filesToBeDeleted);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ private void fillRequestData(ClientPerformanceRequest performanceRequest, JSONOb

requestData.setName(request.getString("requestId"));
requestData.setUrl(URLCleaner.removeUserInfoIfNecessaryAsString(request.getString("url")));
requestData.setHttpMethod(performanceRequest.getHttpMethod());

requestData.setContentType(cleanContentType(request.optString("contentType")));
final int statusCode = request.optInt("statusCode", 0);
Expand All @@ -296,7 +297,6 @@ private void fillRequestData(ClientPerformanceRequest performanceRequest, JSONOb
// set additional data only if we need to
if (SessionImpl.COLLECT_ADDITIONAL_REQUEST_DATA)
{
requestData.setHttpMethod(performanceRequest.getHttpMethod());
requestData.setFormData(performanceRequest.getFormData());
requestData.setFormDataEncoding(performanceRequest.getFormDataEncoding());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ protected WebResponse getResponse(final WebRequest webRequest, final String last
// create new statistics and set request data
requestData = new RequestData(timerName);
requestData.setUrl(URLCleaner.removeUserInfoIfNecessaryAsString(webRequest.getUrl()));
requestData.setHttpMethod(webRequest.getHttpMethod().toString());

putAdditionalRequestData(requestData, webRequest);

Expand Down Expand Up @@ -467,10 +468,7 @@ protected static void putAdditionalRequestData(RequestData requestData, WebReque
{
if (SessionImpl.COLLECT_ADDITIONAL_REQUEST_DATA)
{
final HttpMethod method = webRequest.getHttpMethod();
requestData.setHttpMethod(method.toString());

if (method == HttpMethod.POST)
if (webRequest.getHttpMethod() == HttpMethod.POST)
{
final FormEncodingType encodingType = webRequest.getEncodingType();
requestData.setFormDataEncoding(encodingType.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1084,11 +1084,13 @@ public void setStatusListUpdateInterval(final int statusListUpdateInterval)
* @param testCaseName
* the name of the test case to start the agents for, or <code>null</code> if all active test cases
* should be started
* @param checkTestSuiteUploaded
* whether to check if the test suite was successfully uploaded before
* @return <code>true</code> if the operation was successful for all agent controllers; <code>false</code> otherwise
*/
public boolean startAgents(final String testCaseName)
public boolean startAgents(final String testCaseName, final boolean checkTestSuiteUploaded)
{
if (masterController.areAgentsInSync())
if (!checkTestSuiteUploaded || masterController.areAgentsInSync())
{
System.out.println("Starting agents... ");
boolean result = false;
Expand All @@ -1100,6 +1102,10 @@ public boolean startAgents(final String testCaseName)
{
print(e.getFailed());
}
catch (final Exception e)
{
print(e);
}

System.out.println();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ protected boolean checkAlive(final long timeout)
private void executeTestCase(final String activeTestCaseName)
{
// start all agents
if (!startAgents(activeTestCaseName))
if (!startAgents(activeTestCaseName, true))
{
// do not commence with the test
stopAgents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ else if (option.equals("s"))
{
if (checkAlive() && !isLoadTestRunning())
{
startAgents(null);
startAgents(null, true);
printLoadTestSettings();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.filefilter.HiddenFileFilter;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.NameFileFilter;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.vfs2.FileObject;
Expand Down Expand Up @@ -84,6 +83,13 @@ public class MasterController
*/
private static final Logger LOG = LoggerFactory.getLogger(MasterController.class);

/**
* A file filter that accepts all files/directories that are visible and are not named "results". Used when
* copying/uploading a test suite.
*/
private static final FileFilter FILE_FILTER = FileFilterUtils.and(HiddenFileFilter.VISIBLE,
FileFilterUtils.notFileFilter(new NameFileFilter(XltConstants.RESULT_ROOT_DIR)));

/**
* All agent controllers known to this master controller. The key is the agent controller's name.
*/
Expand Down Expand Up @@ -183,7 +189,7 @@ public class MasterController
* Keep timer files compressed after download
*/
private boolean compressedTimerFiles = false;

/**
* Creates a new MasterController object.
*
Expand Down Expand Up @@ -274,7 +280,6 @@ private void checkTestPropertiesFileName()
throw new IllegalArgumentException(String.format(msg, "testPropertiesFile", agentConfDir.getAbsolutePath(),
propertiesFileName));
}

}

/**
Expand Down Expand Up @@ -854,15 +859,14 @@ public void setUserInterface(final MasterControllerUI userInterface)
* <li>mastercontroller is not in relaxed mode and at least one agent controller did not respond</li>
* <li>an exception was thrown at agent site</li>
* </ul>
* @throws InterruptedException
* if waiting for start jobs fails
*/
public boolean startAgents(final String testCaseName) throws AgentControllerException
public boolean startAgents(final String testCaseName) throws AgentControllerException, IOException
{
if (currentLoadProfile == null)
{
LOG.error("No files have been uploaded yet.");
return false;
// read load test profile if not already done so before during upload
final File workDir = setUpWorkDir(FILE_FILTER);
currentLoadProfile = getTestProfile(workDir);
}

resetAgentStatuses();
Expand Down Expand Up @@ -1018,7 +1022,7 @@ public void run()
public void updateAgentFiles() throws AgentControllerException, IOException, IllegalStateException
{
System.out.print(" Preparing:");
final ProgressBar progressPrepare = startNewProgressBar(agentControllerMap.size() + 7);
final ProgressBar progressPrepare = startNewProgressBar(agentControllerMap.size() + 5);

/*
* Cleanup the data left from last upload.
Expand All @@ -1032,18 +1036,13 @@ public void updateAgentFiles() throws AgentControllerException, IOException, Ill
* Optionally copy and manipulate the test suite.
*/
LOG.info("Read target test suite");
// build a file filter that ignores hidden files and the results directory in the agent files directory
final FileFilter fileFilter = getFileFilter();
// setup working directory
final File workDir = setUpWorkDir(fileFilter);
progressPrepare.increaseCount();

// Read the configuration files and build load profile.
final File agentTemplateConfigDir = new File(workDir, XltConstants.CONFIG_DIR_NAME);
// read load test profile
currentLoadProfile = getTestProfile(agentTemplateConfigDir);
final File workDir = setUpWorkDir(FILE_FILTER);
progressPrepare.increaseCount();

/*
* Read the configuration files and build load profile.
*/
currentLoadProfile = getTestProfile(workDir);
progressPrepare.increaseCount();

if (currentLoadProfile.getActiveTestCaseNames().size() <= 0)
Expand All @@ -1052,13 +1051,12 @@ public void updateAgentFiles() throws AgentControllerException, IOException, Ill
XltLogger.runTimeLogger.warn(msg);
throw new IllegalStateException(msg);
}
progressPrepare.increaseCount();

/*
* Create the file replication index for the local agent files
*/
LOG.info("Considering files in '" + workDir + "' for upload ...");
final FileReplicationIndex localIndex = FileReplicationUtils.getIndex(workDir, fileFilter);
final FileReplicationIndex localIndex = FileReplicationUtils.getIndex(workDir, FILE_FILTER);
progressPrepare.increaseCount();

final AgentControllerUpdate updater = new AgentControllerUpdate(agentControllerMap.values(), uploadExecutor, downloadExecutor,
Expand All @@ -1067,6 +1065,9 @@ public void updateAgentFiles() throws AgentControllerException, IOException, Ill

System.out.println("- OK");

/*
* Upload test suite.
*/
System.out.print(" Uploading:");
final ProgressBar progressUpload = startNewProgressBar(4 * agentControllerMap.size() + 1);
updater.update(workDir, localIndex, progressUpload);
Expand Down Expand Up @@ -1134,29 +1135,21 @@ private File setUpWorkDir(final FileFilter fileFilter)
return workDir;
}

/**
* get testsuite file filter
*/
private FileFilter getFileFilter()
{
final IOFileFilter visibleFiles = HiddenFileFilter.VISIBLE;
final IOFileFilter notResults = FileFilterUtils.notFileFilter(new NameFileFilter(XltConstants.RESULT_ROOT_DIR));
return FileFilterUtils.and(visibleFiles, notResults);
}

/**
* Get the test profile.
*
* @param agentTemplateConfigDir
* agent template config directory
* @param agentTemplateDir
* agent template directory
*/
private TestLoadProfileConfiguration getTestProfile(final File agentTemplateConfigDir) throws IOException
private TestLoadProfileConfiguration getTestProfile(final File agentTemplateDir) throws IOException
{
final File agentTemplateConfigDir = new File(agentTemplateDir, XltConstants.CONFIG_DIR_NAME);

TestLoadProfileConfiguration testConfig;
try
{
// read the load profile from the configuration
testConfig = new TestLoadProfileConfiguration(agentTemplateConfigDir.getParentFile(), agentTemplateConfigDir);
testConfig = new TestLoadProfileConfiguration(agentTemplateDir, agentTemplateConfigDir);
postProcessLoadProfile(testConfig);
}
catch (final Throwable ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private void start()
throw new XltException("There is another load test running.");
}

if (!startAgents(null))
if (!startAgents(null, false))
{
throw new XltException("Starting agents failed.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,7 @@ private List<RequestProcessingRule> readRequestProcessingRules()
final String requestNamePattern = getStringProperty(basePropertyName + ".namePattern", "");
final String agentNamePattern = getStringProperty(basePropertyName + ".agentPattern", "");
final String transactionNamePattern = getStringProperty(basePropertyName + ".transactionPattern", "");
final String methodPattern = getStringProperty(basePropertyName + ".methodPattern", "");
final String responseTimes = getStringProperty(basePropertyName + ".runTimeRanges", "");

// exclude patterns
Expand All @@ -1415,6 +1416,7 @@ private List<RequestProcessingRule> readRequestProcessingRules()
final String requestNameExcludePattern = getStringProperty(basePropertyName + ".namePattern.exclude", "");
final String agentNameExcludePattern = getStringProperty(basePropertyName + ".agentPattern.exclude", "");
final String transactionNameExcludePattern = getStringProperty(basePropertyName + ".transactionPattern.exclude", "");
final String methodExcludePattern = getStringProperty(basePropertyName + ".methodPattern.exclude", "");

// ensure that either newName or dropOnMatch is set
if (StringUtils.isNotBlank(newName) == dropOnMatch)
Expand All @@ -1435,11 +1437,11 @@ private List<RequestProcessingRule> readRequestProcessingRules()
{
final RequestProcessingRule mergeRule = new RequestProcessingRule(newName, requestNamePattern, urlPattern,
contentTypePattern, statusCodePattern, agentNamePattern,
transactionNamePattern, responseTimes, stopOnMatch,
requestNameExcludePattern, urlExcludePattern,
transactionNamePattern, methodPattern, responseTimes,
stopOnMatch, requestNameExcludePattern, urlExcludePattern,
contentTypeExcludePattern, statusCodeExcludePattern,
agentNameExcludePattern, transactionNameExcludePattern,
dropOnMatch);
methodExcludePattern, dropOnMatch);
requestProcessingRules.add(mergeRule);
}
catch (final InvalidRequestProcessingRuleException imre)
Expand Down
Loading

0 comments on commit f839773

Please sign in to comment.