Skip to content

Commit

Permalink
Merge branch 'master' into zkofiro/SRE-33601
Browse files Browse the repository at this point in the history
  • Loading branch information
zkofiro committed Jan 16, 2025
2 parents be84b75 + 8dad027 commit 8b77955
Show file tree
Hide file tree
Showing 21 changed files with 320 additions and 126 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tank_vmManager/settings.xml
tank.mwb
agent/http_client_3/settings.xml
agent/http_client_4/settings.xml
agent/ok_http_client/settings.xml
agent/http_client_jdk/settings.xml

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,22 @@ public String getLogMsg() {
}
this.responseLogMsg = sb.toString();
} catch (Exception ex) {
LOG.error("Error processing response: " + ex.getMessage(), ex);
LOG.error("Error processing response: {}", ex.getMessage(), ex);
}
return responseLogMsg;
}

public String convertToCSV() {
StringBuilder sb = new StringBuilder();
sb.append(this.httpCode).append(",");
sb.append(this.rspMessage).append(",");
sb.append(responseTime).append(",");
sb.append(getResponseSize()).append(",");
headers.forEach((key, value) -> sb.append(key).append(" = ").append(value.replace(",", "")).append(","));
cookies.forEach((key, value) -> sb.append(key).append(" = ").append(value).append(","));
return sb.toString();
}

/**
* Common codes are 200 OK, 202 accepted, 204 no content, 400 bad request,
* 404 not found, 500 internal server error, 503 Service Unavailable
Expand Down
2 changes: 1 addition & 1 deletion agent/agent_startup_pkg/tank_agent/startAgent.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
vm_arguments="-Dnetworkaddress.cache.ttl=5 -Dnetworkaddress.cache.negative.ttl=0";
java -cp apiharness-1.0-all.jar $2 $vm_arguments com.intuit.tank.harness.APITestHarness $1
java -cp apiharness-1.0-all.jar "${@:2}" $vm_arguments com.intuit.tank.harness.APITestHarness $1
echo DONE
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public Object createHttpClient() {
UserTokenHandler userTokenHandler = (httpContext) -> httpContext.getAttribute(HttpClientContext.USER_TOKEN);
// default this implementation will create no more than than 2 concurrent connections per given route and no more 20 connections in total
return HttpClients.custom()
.setConnectionManagerShared(true)
.setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
.setUserTokenHandler(userTokenHandler)
.evictIdleConnections(1L, TimeUnit.MINUTES)
Expand Down
10 changes: 5 additions & 5 deletions api/src/main/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@

<!-- used to set agent instnces and calculate costs. -->
<instance-types type="amazon">
<type name="c5.large" cost=".085" users="500" cpus="2" ecus="8" mem="4" jvmArgs="-Xms2g -Xmx2g -XX:+UseG1GC" />
<type name="c5.xlarge" cost=".17" users="2000" cpus="4" ecus="16" mem="8" default="true" jvmArgs="-Xms5g -Xmx5g -XX:+UseG1GC" />
<type name="c5.2xlarge" cost=".34" users="4000" cpus="8" ecus="31" mem="16" jvmArgs="-Xms10g -Xmx10g -XX:+UseG1GC" />
<type name="c5.4xlarge" cost=".68" users="8000" cpus="16" ecus="61" mem="32" jvmArgs="-Xms25g -Xmx25g -XX:+UseG1GC" />
<type name="c5.9xlarge" cost="1.53" users="16000" cpus="36" ecus="139" mem="72" jvmArgs="-Xms50g -Xmx50g -XX:+UseG1GC" />
<type name="m8g.large" cost=".0898" users="500" cpus="2" ecus="8" mem="8" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.xlarge" cost=".1795" users="2000" cpus="4" ecus="16" mem="16" default="true" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.2xlarge" cost=".3590" users="4000" cpus="8" ecus="31" mem="32" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.4xlarge" cost=".7181" users="8000" cpus="16" ecus="61" mem="64" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.9xlarge" cost="1.436" users="16000" cpus="36" ecus="139" mem="128" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
</instance-types>


Expand Down
10 changes: 5 additions & 5 deletions api/src/test/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@

<!-- used to set agent instnces and calculate costs. -->
<instance-types type="amazon">
<type name="c5.large" cost=".085" users="500" cpus="2" ecus="8" mem="4" jvmArgs="-Xms2g -Xmx2g -XX:+UseG1GC" />
<type name="c5.xlarge" cost=".17" users="2000" cpus="4" ecus="16" mem="8" default="true" jvmArgs="-Xms5g -Xmx5g -XX:+UseG1GC" />
<type name="c5.2xlarge" cost=".34" users="4000" cpus="8" ecus="31" mem="16" jvmArgs="-Xms10g -Xmx10g -XX:+UseG1GC" />
<type name="c5.4xlarge" cost=".68" users="8000" cpus="16" ecus="61" mem="32" jvmArgs="-Xms25g -Xmx25g -XX:+UseG1GC" />
<type name="c5.9xlarge" cost="1.53" users="16000" cpus="36" ecus="139" mem="72" jvmArgs="-Xms50g -Xmx50g -XX:+UseG1GC" />
<type name="m8g.large" cost=".0898" users="500" cpus="2" ecus="8" mem="8" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.xlarge" cost=".1795" users="2000" cpus="4" ecus="16" mem="16" default="true" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.2xlarge" cost=".3590" users="4000" cpus="8" ecus="31" mem="32" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.4xlarge" cost=".7181" users="8000" cpus="16" ecus="61" mem="64" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.9xlarge" cost="1.436" users="16000" cpus="36" ecus="139" mem="128" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
</instance-types>


Expand Down
10 changes: 5 additions & 5 deletions assets/settings-all-in-one.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@

<!-- used to set agent instnces and calculate costs. -->
<instance-types type="amazon">
<type name="c5.large" cost=".085" users="500" cpus="2" ecus="8" mem="4" jvmArgs="-Xms2g -Xmx2g -XX:+UseG1GC" />
<type name="c5.xlarge" cost=".17" users="2000" cpus="4" ecus="16" mem="8" default="true" jvmArgs="-Xms5g -Xmx5g -XX:+UseG1GC" />
<type name="c5.2xlarge" cost=".34" users="4000" cpus="8" ecus="31" mem="16" jvmArgs="-Xms10g -Xmx10g -XX:+UseG1GC" />
<type name="c5.4xlarge" cost=".68" users="8000" cpus="16" ecus="61" mem="32" jvmArgs="-Xms25g -Xmx25g -XX:+UseG1GC" />
<type name="c5.9xlarge" cost="1.53" users="16000" cpus="36" ecus="139" mem="72" jvmArgs="-Xms50g -Xmx50g -XX:+UseG1GC" />
<type name="m8g.large" cost=".0898" users="500" cpus="2" ecus="8" mem="8" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.xlarge" cost=".1795" users="2000" cpus="4" ecus="16" mem="16" default="true" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.2xlarge" cost=".3590" users="4000" cpus="8" ecus="31" mem="32" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.4xlarge" cost=".7181" users="8000" cpus="16" ecus="61" mem="64" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
<type name="m8g.9xlarge" cost="1.436" users="16000" cpus="36" ecus="139" mem="128" jvmArgs="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC" />
</instance-types>


Expand Down
2 changes: 1 addition & 1 deletion aws-config/tank_agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Parameters:
InstanceType:
Description: Amazon EC2 instance type
Type: 'String'
Default: 'c5.large'
Default: 'm8g.large'
KeyName:
Type: 'AWS::EC2::KeyPair::KeyName'
Description: Amazon EC2 Key Pair
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
<cert.p12>self_signed_tank.p12</cert.p12>

<version.hibernate>6.5.1.Final</version.hibernate>
<version.software.amazon.awssdk>2.25.56</version.software.amazon.awssdk>
<version.aws-xray-sdk-bom>2.15.3</version.aws-xray-sdk-bom>
<version.software.amazon.awssdk>2.29.35</version.software.amazon.awssdk>
<version.aws-xray-sdk-bom>2.18.2</version.aws-xray-sdk-bom>

<version.tomcat>11.0.1</version.tomcat>
<version.tomcat>11.0.2</version.tomcat>
<weld.version>5.1.3.Final</weld.version>
<cdi.version>4.1.0</cdi.version>

Expand Down
10 changes: 5 additions & 5 deletions proxy-parent/owasp-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.47</version>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.79</version>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.47</version>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.79</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand All @@ -48,7 +48,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>2.5.6</version>
<version>6.2.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
import org.springframework.dao.DataAccessException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;

Expand All @@ -66,11 +66,11 @@ public class JdbcMessageDAO extends NamedParameterJdbcDaoSupport implements
private static final String RESPONSE_HEADER_TIME = "headerTime";
private static final String RESPONSE_CONTENT_TIME = "contentTime";

private static final ParameterizedRowMapper<MutableBufferedRequest> REQUEST_MAPPER = new RequestMapper();
private static final ParameterizedRowMapper<MutableBufferedResponse> RESPONSE_MAPPER = new ResponseMapper();
private static final ParameterizedRowMapper<byte[]> CONTENT_MAPPER = new ContentMapper();
private static final ParameterizedRowMapper<Integer> ID_MAPPER = new IdMapper();
private static final ParameterizedRowMapper<Conversation> CONVERSATION_MAPPER = new ConversationMapper();
private static final RowMapper<MutableBufferedRequest> REQUEST_MAPPER = new RequestMapper();
private static final RowMapper<MutableBufferedResponse> RESPONSE_MAPPER = new ResponseMapper();
private static final RowMapper<byte[]> CONTENT_MAPPER = new ContentMapper();
private static final RowMapper<Integer> ID_MAPPER = new IdMapper();
private static final RowMapper<Conversation> CONVERSATION_MAPPER = new ConversationMapper();

private final static String INSERT_CONTENT = "INSERT INTO contents (content, size) VALUES (:content, :size)";

Expand Down Expand Up @@ -188,9 +188,8 @@ public Collection<Integer> listConversationsSince(int id)
MapSqlParameterSource params = new MapSqlParameterSource();
try {
params.addValue(ID, id, Types.INTEGER);
SimpleJdbcTemplate template = new SimpleJdbcTemplate(
getNamedParameterJdbcTemplate());
return template.query(SELECT_CONVERSATIONS, ID_MAPPER, params);
NamedParameterJdbcTemplate template = getNamedParameterJdbcTemplate();
return template.query(SELECT_CONVERSATIONS, params, ID_MAPPER);
} catch (EmptyResultDataAccessException erdae) {
return Collections.emptyList();
}
Expand All @@ -205,9 +204,8 @@ public int getMessageContentId(int headerId) throws DataAccessException {
try {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue(ID, headerId, Types.INTEGER);
SimpleJdbcTemplate template = new SimpleJdbcTemplate(
getNamedParameterJdbcTemplate());
return template.queryForInt(SELECT_CONTENT_ID, params);
NamedParameterJdbcTemplate template = getNamedParameterJdbcTemplate();
return template.queryForObject(SELECT_CONTENT_ID, params, Integer.class);
} catch (EmptyResultDataAccessException erdae) {
return -1;
}
Expand All @@ -222,9 +220,8 @@ public int getMessageContentSize(int id) throws DataAccessException {
try {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue(ID, id, Types.INTEGER);
SimpleJdbcTemplate template = new SimpleJdbcTemplate(
getNamedParameterJdbcTemplate());
return template.queryForInt(SELECT_CONTENT_SIZE, params);
NamedParameterJdbcTemplate template = getNamedParameterJdbcTemplate();
return template.queryForObject(SELECT_CONTENT_SIZE, params, Integer.class);
} catch (EmptyResultDataAccessException erdae) {
return -1;
}
Expand All @@ -239,10 +236,8 @@ public Conversation getConversation(int id) throws DataAccessException {
try {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue(ID, id, Types.INTEGER);
SimpleJdbcTemplate template = new SimpleJdbcTemplate(
getNamedParameterJdbcTemplate());
return template.queryForObject(SELECT_SUMMARY, CONVERSATION_MAPPER,
params);
NamedParameterJdbcTemplate template = getNamedParameterJdbcTemplate();
return template.queryForObject(SELECT_SUMMARY, params, CONVERSATION_MAPPER);
} catch (EmptyResultDataAccessException erdae) {
return null;
}
Expand Down Expand Up @@ -286,10 +281,8 @@ public byte[] loadMessageContent(int id) throws DataAccessException {
try {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue(ID, id, Types.INTEGER);
SimpleJdbcTemplate template = new SimpleJdbcTemplate(
getNamedParameterJdbcTemplate());
return template.queryForObject(SELECT_CONTENT, CONTENT_MAPPER,
params);
NamedParameterJdbcTemplate template = getNamedParameterJdbcTemplate();
return template.queryForObject(SELECT_CONTENT, params, CONTENT_MAPPER);
} catch (EmptyResultDataAccessException erdae) {
return null;
}
Expand Down Expand Up @@ -319,10 +312,8 @@ public RequestHeader loadRequestHeader(int id) throws DataAccessException {
MapSqlParameterSource params = new MapSqlParameterSource();
try {
params.addValue(ID, id, Types.INTEGER);
SimpleJdbcTemplate template = new SimpleJdbcTemplate(
getNamedParameterJdbcTemplate());
return template.queryForObject(SELECT_REQUEST, REQUEST_MAPPER,
params);
NamedParameterJdbcTemplate template = getNamedParameterJdbcTemplate();
return template.queryForObject(SELECT_REQUEST, params, REQUEST_MAPPER);
} catch (EmptyResultDataAccessException erdae) {
return null;
}
Expand Down Expand Up @@ -354,10 +345,8 @@ public MutableResponseHeader loadResponseHeader(int id)
try {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue(ID, id, Types.INTEGER);
SimpleJdbcTemplate template = new SimpleJdbcTemplate(
getNamedParameterJdbcTemplate());
return template.queryForObject(SELECT_RESPONSE, RESPONSE_MAPPER,
params);
NamedParameterJdbcTemplate template = getNamedParameterJdbcTemplate();
return template.queryForObject(SELECT_RESPONSE, params, RESPONSE_MAPPER);
} catch (EmptyResultDataAccessException erdae) {
return null;
}
Expand Down Expand Up @@ -478,7 +467,7 @@ private void saveMessageHeader(MutableMessageHeader header, int contentId) {
}

private static class RequestMapper implements
ParameterizedRowMapper<MutableBufferedRequest> {
RowMapper<MutableBufferedRequest> {

public MutableBufferedRequest mapRow(ResultSet rs, int rowNum)
throws SQLException {
Expand All @@ -504,7 +493,7 @@ public MutableBufferedRequest mapRow(ResultSet rs, int rowNum)
}

private static class ResponseMapper implements
ParameterizedRowMapper<MutableBufferedResponse> {
RowMapper<MutableBufferedResponse> {

public MutableBufferedResponse mapRow(ResultSet rs, int rowNum)
throws SQLException {
Expand All @@ -529,22 +518,22 @@ public MutableBufferedResponse mapRow(ResultSet rs, int rowNum)
}

private static class ContentMapper implements
ParameterizedRowMapper<byte[]> {
RowMapper<byte[]> {

public byte[] mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getBytes(CONTENT);
}
}

private static class IdMapper implements ParameterizedRowMapper<Integer> {
private static class IdMapper implements RowMapper<Integer> {

public Integer mapRow(ResultSet rs, int rowNum) throws SQLException {
return Integer.valueOf(rs.getInt(ID));
}
}

private static class ConversationMapper implements
ParameterizedRowMapper<Conversation> {
RowMapper<Conversation> {

public Conversation mapRow(ResultSet rs, int rowNum)
throws SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@

import javax.security.auth.x500.X500Principal;

import org.bouncycastle.asn1.x509.BasicConstraints;
import org.bouncycastle.asn1.x509.ExtendedKeyUsage;
import org.bouncycastle.asn1.x509.KeyPurposeId;
import org.bouncycastle.asn1.x509.X509Extensions;
import org.bouncycastle.asn1.x509.*;
import org.bouncycastle.jce.X509KeyUsage;
import org.bouncycastle.x509.X509V3CertificateGenerator;
import org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure;
import org.bouncycastle.x509.extension.SubjectKeyIdentifierStructure;

@SuppressWarnings("deprecation")
public class BouncyCastleCertificateUtils {
Expand Down Expand Up @@ -116,7 +112,7 @@ private static void addCertificateExtensions(PublicKey pubKey,
// new SubjectKeyIdentifierExtension(new KeyIdentifier(pubKey)
// .getIdentifier()));
certGen.addExtension(X509Extensions.SubjectKeyIdentifier, false,
new SubjectKeyIdentifierStructure(pubKey));
SubjectKeyIdentifier.getInstance(pubKey));
//
// ext.set(AuthorityKeyIdentifierExtension.NAME,
// new AuthorityKeyIdentifierExtension(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public ResponseEntity<JobContainer> getJobsByProject(@PathVariable @Parameter(de
" - passing only projectName creates jobs named: '{projectName}_{total_users}\\_users\\_{timestamp}' \n\n" +
" - rampTime and simulationTime are accepted as time strings i.e 60s, 12m, 24h \n\n" +
" - stopBehavior is matched against accepted values ( END_OF_STEP, END_OF_SCRIPT, END_OF_SCRIPT_GROUP, END_OF_TEST ) \n\n" +
" - vmInstance matches against AWS EC2 Instance Types i.e c5.large, c5.xlarge, etc \n\n"+
" - vmInstance matches against AWS EC2 Instance Types i.e m8g.large, m8g.xlarge, etc \n\n"+
" - workloadType can be set to increasing (linear workload) or standard (nonlinear workload) \n\n"+
" - targetRampRate, targetRatePerAgent, and jobRegions.percentage fields apply to standard workloadType jobs (nonlinear) \n\n"+
" - projectId, userIntervalIncrement and numUsersPerAgent are accepted as integers \n\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ private void createToolBar(JComboBox testPlanChooser, JComboBox<TankClientChoice
toolBar.add(new JLabel(" "));
toolBar.add(actions.getPauseAction());
toolBar.addSeparator();
toolBar.add(actions.getCSVAction());
toolBar.addSeparator();

toolBar.add(actions.getClearBookmarksAction());
toolBar.add(new JLabel(" "));
Expand Down
Loading

0 comments on commit 8b77955

Please sign in to comment.