Skip to content

Commit

Permalink
Release 3.1.0
Browse files Browse the repository at this point in the history
* JSF 2.3
* Remove PicketLink/DeltaSpike
* Add AdminFilter
* Obfuscate password in LogEvents
* Bump commons-compress from 1.20 to 1.21
* Filter Page: Fix Search Bar Bug
* Fix: Filter search listener to TableState Filter Function
* Fix "New Project" navigation button
* Proxy Recorder: Process 302 Transactions
* Fix User Delete
* SRE-19012 Stop gui spinner from spinning
* Add env to logging variables [SRE-19083]
* Fix Sort on Filter Apply Page
* Fix apiharness local execution
* Remove redundant file exists check
* disable delete button during tests [SRE-19307]
* SRE-19307 implement isDeletable()
* Unblock thread start processes
* Refactor Method Names [SRE-19325]
* TestPlanStarter Unit Tests
* Stop creating threads after ramp for loop completion use case.
* stop thread starter after ramp (scripts loops completed)
* Implement StopBehavior [SRE-19391]

Co-authored-by: Shawn Park <[email protected]>
Co-authored-by: Bryan Alexander Rivera <[email protected]>
Co-authored-by: Bryan Rivera <[email protected]>
  • Loading branch information
4 people authored Sep 15, 2021
1 parent 67b21be commit 31187b6
Show file tree
Hide file tree
Showing 347 changed files with 1,537 additions and 1,956 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ jdk:
- openjdk11

env:
- SKIP_METHODTIMER_TEST=true
- SKIP_GUI_TEST=true
global:
- SKIP_METHODTIMER_TEST=true
- SKIP_GUI_TEST=true

script: mvn clean install -P default,coverage
2 changes: 1 addition & 1 deletion agent/agent_common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.intuit.tank</groupId>
<artifactId>agent-parent</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
</parent>

<artifactId>agent-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public JsonRequest(TankHttpClient client, TankHttpLogger logUtil) {

/**
*
* @inheritDoc
* {@inheritDoc}
*/
@Override
public String getBody() {
Expand All @@ -42,7 +42,7 @@ public String getBody() {

/**
*
* @inheritDoc
* {@inheritDoc}
*/
@Override
public void setKey(String key, String value) {
Expand All @@ -51,14 +51,14 @@ public void setKey(String key, String value) {

/**
*
* @inheritDoc
* {@inheritDoc}
*/
@Override
public void setNamespace(String name, String value) {
}

/**
* @inheritDoc
* {@inheritDoc}
*/
@Override
public String getKey(String key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PlainTextRequest(TankHttpClient client, TankHttpLogger logUtil) {

/**
*
* @inheritDoc
* {@inheritDoc}
*/
@Override
public String getBody() {
Expand Down
2 changes: 1 addition & 1 deletion agent/agent_standalone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.intuit.tank</groupId>
<artifactId>agent-parent</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
</parent>

<artifactId>agent-standalone</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion agent/agent_standalone_pkg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.intuit.tank</groupId>
<artifactId>agent-parent</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
</parent>

<artifactId>agent-standalone-pkg</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion agent/agent_startup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.intuit.tank</groupId>
<artifactId>agent-parent</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
</parent>

<artifactId>agent-startup</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion agent/agent_startup_pkg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.intuit.tank</groupId>
<artifactId>agent-parent</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
</parent>

<artifactId>agent-startup-pkg</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion agent/apiharness/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.intuit.tank</groupId>
<artifactId>agent-parent</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
</parent>

<artifactId>agent</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class APITestHarness {
private TPSMonitor tpsMonitor;
private ResultsReporter resultsReporter;
private String tankHttpClientClass;

private Date send = new Date();
private static final int interval = 15; // SECONDS

Expand Down Expand Up @@ -160,10 +160,11 @@ private void initializeFromArgs(String[] args) {
if (values[0].equalsIgnoreCase("-tp")) {
testPlans = values[1];
if (!AgentUtil.validateTestPlans(testPlans)) {
usage();
return;
}
} else if (values[0].equalsIgnoreCase("-ramp")) {
agentRunData.setRampTime(Long.parseLong(values[1]) * 60000);
agentRunData.setRampTimeMillis(Long.parseLong(values[1]) * 60000);
} else if (values[0].equalsIgnoreCase("-client")) {
tankHttpClientClass = StringUtils.trim(values[1]);
} else if (values[0].equalsIgnoreCase("-d")) {
Expand Down Expand Up @@ -207,7 +208,7 @@ private void initializeFromArgs(String[] args) {
} else if (values[0].equalsIgnoreCase("-http")) {
controllerBase = (values.length > 1 ? values[1] : null);
} else if (values[0].equalsIgnoreCase("-time")) {
agentRunData.setSimulationTime(Integer.parseInt(values[1]) * 60000);
agentRunData.setSimulationTimeMillis(Integer.parseInt(values[1]) * 60000);
}
}
if (instanceId == null) {
Expand All @@ -231,8 +232,7 @@ private void initializeFromArgs(String[] args) {
startHttp(controllerBase);
} else {
resultsReporter = new DummyResultsReporter();
TestPlanSingleton plans = TestPlanSingleton.getInstance();
plans.setTestPlans(testPlans);
TestPlanSingleton.getInstance().setTestPlans(testPlans);
runConcurrentTestPlans();
}
}
Expand Down Expand Up @@ -325,10 +325,10 @@ private void startHttp(String baseUrl) {

agentRunData.setNumUsers(startData.getConcurrentUsers());
agentRunData.setNumStartUsers(startData.getStartUsers());
agentRunData.setRampTime(startData.getRampTime());
agentRunData.setRampTimeMillis(startData.getRampTime());
agentRunData.setJobId(startData.getJobId());
agentRunData.setUserInterval(startData.getUserIntervalIncrement());
agentRunData.setSimulationTime(startData.getSimulationTime());
agentRunData.setSimulationTimeMillis(startData.getSimulationTime());
agentRunData.setAgentInstanceNum(startData.getAgentInstanceNum());
agentRunData.setTotalAgents(startData.getTotalAgents());

Expand Down Expand Up @@ -483,10 +483,10 @@ public void runConcurrentTestPlans() {
return;
}
tpsMonitor = new TPSMonitor(tankConfig.getAgentConfig().getTPSPeriod());
String info = " RAMP_TIME=" + agentRunData.getRampTime() +
String info = " RAMP_TIME=" + agentRunData.getRampTimeMillis() +
"; agentRunData.getNumUsers()=" + agentRunData.getNumUsers() +
"; NUM_START_THREADS=" + agentRunData.getNumStartUsers() +
"; simulationTime=" + agentRunData.getSimulationTime();
"; simulationTime=" + agentRunData.getSimulationTimeMillis();
LOG.info(new ObjectMessage(ImmutableMap.of("Message", "starting test with " + info)));
started = true;

Expand All @@ -511,7 +511,7 @@ public void runConcurrentTestPlans() {
plan.setVariables(hdWorkload.getVariables());
ThreadGroup threadGroup = new ThreadGroup("Test Plan Runner Group");
threadGroupArray.add(threadGroup);
TestPlanStarter starter = new TestPlanStarter(httpClient, plan, agentRunData.getNumUsers(), tankHttpClientClass, threadGroup);
TestPlanStarter starter = new TestPlanStarter(httpClient, plan, agentRunData.getNumUsers(), tankHttpClientClass, threadGroup, agentRunData);
testPlans.add(starter);
LOG.info(new ObjectMessage(ImmutableMap.of("Message", "Users for Test Plan " + plan.getTestPlanName() + " at "
+ plan.getUserPercentage()
Expand All @@ -535,7 +535,7 @@ public void runConcurrentTestPlans() {
startTime = System.currentTimeMillis();
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
LOG.info(new ObjectMessage(ImmutableMap.of("Message", "Simulation start: " + df.format(new Date(getStartTime())))));
if (agentRunData.getSimulationTime() != 0) {
if (agentRunData.getSimulationTimeMillis() != 0) {
LOG.info(new ObjectMessage(ImmutableMap.of("Message", "Scheduled Simulation End : "
+ df.format(new Date(getSimulationEndTimeMillis())))));
LOG.info(new ObjectMessage(ImmutableMap.of("Message", "Max Simulation End : "
Expand Down Expand Up @@ -630,7 +630,7 @@ public WatsAgentStatusResponse getStatus() {
int ramp = (agentRunData.getNumUsers() - agentRunData.getNumStartUsers());

if (ramp > 0) {
ramp = (int) (agentRunData.getRampTime() - (agentRunData.getRampTime() * currentNumThreads) /
ramp = (int) (agentRunData.getRampTimeMillis() - (agentRunData.getRampTimeMillis() * currentNumThreads) /
(agentRunData.getNumUsers() - agentRunData.getNumStartUsers()));
}
return new WatsAgentStatusResponse(System.currentTimeMillis() - startTime,
Expand Down Expand Up @@ -661,11 +661,11 @@ public String getInstanceId() {
}

public long getSimulationEndTimeMillis() {
return getStartTime() + agentRunData.getSimulationTime();
return getStartTime() + agentRunData.getSimulationTimeMillis();
}

public boolean hasMetSimulationTime() {
if (agentRunData.getSimulationTime() > 0) {
if (agentRunData.getSimulationTimeMillis() > 0) {
if (System.currentTimeMillis() > getSimulationEndTimeMillis()) {
if (!loggedSimTime) {
LOG.info(new ObjectMessage(ImmutableMap.of("Message", "Simulation time met")));
Expand All @@ -691,11 +691,7 @@ public long getMaxSimulationEndTimeMillis() {
public void checkAgentThreads() {
for (ThreadGroup threadGroup : threadGroupArray) {
int activeCount = threadGroup.activeCount();
Thread[] threads = new Thread[activeCount];
threadGroup.enumerate(threads);
int activeThreads = (int) Arrays.stream(threads).filter(Objects::nonNull).filter(
t -> t.getState() == Thread.State.TIMED_WAITING || t.getState() == Thread.State.WAITING).count();
LOG.info(LogUtil.getLogMessage("Have " + activeThreads + " of " + activeCount
LOG.info(LogUtil.getLogMessage("Have " + threadGroup.activeCount()
+ " active Threads in thread group "
+ threadGroup.getName()));
}
Expand Down Expand Up @@ -795,6 +791,8 @@ public FlowController getFlowController(Long threadId) {
return ret;
}

public int getCurrentUsers() { return currentUsers; }

/**
* @return the started
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ public void setNumUsers(int numUsers) {
}

/**
* @return the rampTime
* @return the rampTime in milliseconds
*/
public long getRampTime() {
public long getRampTimeMillis() {
return rampTime;
}

/**
* @param rampTime
* the rampTime to set
* the rampTime to set in milliseconds
*/
public void setRampTime(long rampTime) {
public void setRampTimeMillis(long rampTime) {
this.rampTime = rampTime;
}

Expand Down Expand Up @@ -195,17 +195,17 @@ public void setReportingMode(String reportingMode) {
}

/**
* @return the simulationTime
* @return the simulationTime in milliseconds
*/
public long getSimulationTime() {
public long getSimulationTimeMillis() {
return simulationTime;
}

/**
* @param simulationTime
* the simulationTime to set
* the simulationTime to set in milliseconds
*/
public void setSimulationTime(long simulationTime) {
public void setSimulationTimeMillis(long simulationTime) {
this.simulationTime = simulationTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

import java.io.File;
import java.util.Arrays;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -32,18 +33,14 @@ public class AgentUtil {
* @return TRUE if all test plans exist; FALSE if one or more do not exist
*/
public static boolean validateTestPlans(String plans) {
String[] testPlanLists = plans.split(",");
boolean output = true;

for (String testPlanList : testPlanLists) {
File xmlFile = new File(testPlanList);
if (!xmlFile.exists()) {
LOG.error(LogUtil.getLogMessage("File not found: " + testPlanList));
System.err.println("File not found: " + testPlanList);
output = false;
}
}
return output;
return Arrays.stream(plans.split(","))
.allMatch(xmlFilePath -> {
if (new File(xmlFilePath).exists()) {
return true;
}
LOG.error(LogUtil.getLogMessage("File not found: " + xmlFilePath));
System.err.println("File not found: " + xmlFilePath);
return false;
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
import org.apache.logging.log4j.Logger;

import com.intuit.tank.harness.data.HDWorkload;
import com.intuit.tank.harness.logging.LogUtil;
import com.intuit.tank.harness.parsers.WorkloadParser;
import com.intuit.tank.logging.LogEventType;

public class TestPlanSingleton {
private static final Logger LOG = LogManager.getLogger(TestPlanSingleton.class);
Expand All @@ -47,18 +45,10 @@ private TestPlanSingleton() {
}

public void setTestPlans(String plans) {
List<String> testPlanLists = Arrays.asList(plans.split(","));

workloads = testPlanLists.stream()
.filter(xmlFile -> {
if (new File(xmlFile).exists()) {
return true;
} else {
Exception e = new Exception("File not found");
LOG.error(LogUtil.getLogMessage(e.getMessage(), LogEventType.System), e);
return false;
}
})
workloads = Arrays.stream(plans.split(","))
.map(File::new)
.filter(File::exists)
.map(xml -> new WorkloadParser(xml).getWorkload())
.filter(Objects::nonNull)
.collect(Collectors.toList());
Expand Down
Loading

0 comments on commit 31187b6

Please sign in to comment.