Skip to content

Commit 69e36f3

Browse files
Release 2.3.3
* Remove decompress apache httpclient 4.5.x does it automatically * thread should end when loops end. * Enable compression request to tank clients * AWS X-ray instrumentation * Reduce pending to running wait from 1min to 30sec * Enable Referer and Authorization headers, Test and documentation * trace recent jobs query * Performance & Size Reduction * Cache agent-support-files.zip in /tmp * Replace deprecated hibernate index annotations with JPA index annotations * Library reorganization saved 43MB off deployment war * AWS Xray + DBQueries + Performance * Cleanup * RequestScoped bean to ApplicationScoped bean * AWSXray dummy segments to allow jdbc tracing to be enabled * LazyLoad User Table * BatchSize * userAdmin Fix + CriteriaBuilder * better error handling on UserDao
1 parent b75a901 commit 69e36f3

File tree

193 files changed

+1086
-1025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+1086
-1025
lines changed

agent/agent_common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.intuit.tank</groupId>
77
<artifactId>agent-parent</artifactId>
8-
<version>2.3.2</version>
8+
<version>2.3.3</version>
99
</parent>
1010

1111
<artifactId>agent-common</artifactId>

agent/agent_common/src/main/java/com/intuit/tank/http/BaseResponse.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,13 @@ public void logResponse() {
226226
}
227227

228228
public static final boolean isDataType(String contentType) {
229-
boolean ret = false;
230229
if (!StringUtils.isBlank(contentType)) {
231230
contentType = contentType.toLowerCase();
232-
ret = contentType.contains("html") || contentType.contains("text") || contentType.contains("json") || contentType.contains("xml");
231+
return contentType.contains("html") ||
232+
contentType.contains("text") ||
233+
contentType.contains("json") ||
234+
contentType.contains("xml");
233235
}
234-
return ret;
236+
return false;
235237
}
236238
}

agent/agent_common/src/main/java/com/intuit/tank/http/TankHttpUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.net.MalformedURLException;
66
import java.net.URL;
77
import java.net.URLEncoder;
8-
import java.nio.charset.Charset;
98
import java.nio.charset.StandardCharsets;
109
import java.util.ArrayList;
1110
import java.util.HashMap;
@@ -22,6 +21,7 @@
2221
import com.intuit.tank.http.binary.BinaryResponse;
2322
import com.intuit.tank.http.json.JsonResponse;
2423
import com.intuit.tank.http.xml.XMLResponse;
24+
2525
/**
2626
* utitly methods for tank http clients
2727
* @author denisa
@@ -177,7 +177,7 @@ public byte[] getBody() {
177177
* @return the body as a string
178178
*/
179179
public String getBodyAsString() {
180-
return new String(body, Charset.forName("UTF-8"));
180+
return new String(body, StandardCharsets.UTF_8);
181181
}
182182

183183
// Content-Disposition: form-data; name="uploadname1";

agent/agent_standalone/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.intuit.tank</groupId>
77
<artifactId>agent-parent</artifactId>
8-
<version>2.3.2</version>
8+
<version>2.3.3</version>
99
</parent>
1010

1111
<artifactId>agent-standalone</artifactId>

agent/agent_standalone_pkg/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.intuit.tank</groupId>
77
<artifactId>agent-parent</artifactId>
8-
<version>2.3.2</version>
8+
<version>2.3.3</version>
99
</parent>
1010

1111
<artifactId>agent-standalone-pkg</artifactId>

agent/agent_startup/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.intuit.tank</groupId>
77
<artifactId>agent-parent</artifactId>
8-
<version>2.3.2</version>
8+
<version>2.3.3</version>
99
</parent>
1010

1111
<artifactId>agent-startup</artifactId>

agent/agent_startup/src/main/java/com/intuit/tank/agent/AgentStartup.java

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.zip.ZipEntry;
2222
import java.util.zip.ZipInputStream;
2323

24+
import com.amazonaws.util.StringUtils;
2425
import org.apache.commons.io.FileUtils;
2526
import org.apache.commons.io.IOUtils;
2627
import org.apache.logging.log4j.LogManager;
@@ -32,40 +33,30 @@
3233
public class AgentStartup implements Runnable {
3334

3435
private static Logger logger = LogManager.getLogger(AgentStartup.class);
35-
public static final String SERVICE_RELATIVE_PATH = "/rest/v1/agent-service";
36-
public static final String METHOD_SETTINGS = "/settings";
37-
private static String API_HARNESS_COMMAND = "./startAgent.sh";
38-
public static final String METHOD_SUPPORT = "/supportFiles";
39-
private static final long WAIT_FOR_RESTART_TIME = 00000; // zero minute
36+
private static final String SERVICE_RELATIVE_PATH = "/rest/v1/agent-service";
37+
private static final String METHOD_SETTINGS = "/settings";
38+
private static final String API_HARNESS_COMMAND = "./startAgent.sh";
39+
private static final String METHOD_SUPPORT = "/supportFiles";
4040

41-
private String controllerBase;
41+
private final String controllerBaseUrl;
42+
43+
public AgentStartup (String controllerBaseUrl ) {
44+
this.controllerBaseUrl = controllerBaseUrl;
45+
}
4246

4347
public void run() {
4448
logger.info("Starting up...");
45-
if (AmazonUtil.usingEip()) {
46-
try {
47-
logger.info("Using EIP. Sleeping for " + WAIT_FOR_RESTART_TIME + " ms.");
48-
Thread.sleep(WAIT_FOR_RESTART_TIME);
49-
} catch (InterruptedException e1) {
50-
logger.info("Exception waiting.");
51-
System.exit(0);
52-
}
53-
}
5449
try {
55-
if (controllerBase == null) {
56-
controllerBase = AmazonUtil.getControllerBaseUrl();
57-
}
58-
59-
logger.info("Starting up: ControllerBaseUrl=" + controllerBase);
60-
URL url = new URL(controllerBase + SERVICE_RELATIVE_PATH + METHOD_SETTINGS);
50+
logger.info("Starting up: ControllerBaseUrl=" + controllerBaseUrl);
51+
URL url = new URL(controllerBaseUrl + SERVICE_RELATIVE_PATH + METHOD_SETTINGS);
6152
logger.info("Starting up: making call to tank service url to get settings.xml "
6253
+ url.toExternalForm());
6354
try ( InputStream settingsStream = url.openStream() ) {
6455
String settings = IOUtils.toString(settingsStream, StandardCharsets.UTF_8);
6556
FileUtils.writeStringToFile(new File("settings.xml"), settings, StandardCharsets.UTF_8);
6657
logger.info("got settings file...");
6758
}
68-
url = new URL(controllerBase + SERVICE_RELATIVE_PATH + METHOD_SUPPORT);
59+
url = new URL(controllerBaseUrl + SERVICE_RELATIVE_PATH + METHOD_SUPPORT);
6960
logger.info("Making call to tank service url to get support files " + url.toExternalForm());
7061
try ( ZipInputStream zip = new ZipInputStream(url.openStream()) ){
7162
ZipEntry entry = zip.getNextEntry();
@@ -81,17 +72,16 @@ public void run() {
8172
}
8273
// now start the harness
8374
String jvmArgs = AmazonUtil.getUserDataAsMap().get(TankConstants.KEY_JVM_ARGS);
84-
logger.info("Starting apiharness with command: " + API_HARNESS_COMMAND + " -http=" + controllerBase + " "
75+
logger.info("Starting apiharness with command: " + API_HARNESS_COMMAND + " -http=" + controllerBaseUrl + " "
8576
+ jvmArgs);
86-
Runtime.getRuntime().exec(API_HARNESS_COMMAND + " -http=" + controllerBase + " " + jvmArgs);
77+
Runtime.getRuntime().exec(API_HARNESS_COMMAND + " -http=" + controllerBaseUrl + " " + jvmArgs);
8778
} catch (Exception e) {
8879
logger.error("Error in AgentStartup " + e, e);
8980
}
9081
}
9182

9283
public static void main(String[] args) {
93-
AgentStartup agentStartup = new AgentStartup();
94-
84+
String controllerBaseUrl = null;
9585
for (String argument : args) {
9686
String[] values = argument.split("=");
9787

@@ -100,10 +90,13 @@ public static void main(String[] args) {
10090
usage();
10191
return;
10292
}
103-
agentStartup.controllerBase = values[1];
93+
controllerBaseUrl = values[1];
10494
}
105-
10695
}
96+
if (StringUtils.isNullOrEmpty(controllerBaseUrl)) {
97+
controllerBaseUrl = AmazonUtil.getControllerBaseUrl();
98+
}
99+
AgentStartup agentStartup = new AgentStartup(controllerBaseUrl);
107100
agentStartup.run();
108101
}
109102

agent/agent_startup_pkg/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.intuit.tank</groupId>
77
<artifactId>agent-parent</artifactId>
8-
<version>2.3.2</version>
8+
<version>2.3.3</version>
99
</parent>
1010

1111
<artifactId>agent-startup-pkg</artifactId>

agent/apiharness/pom.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.intuit.tank</groupId>
77
<artifactId>agent-parent</artifactId>
8-
<version>2.3.2</version>
8+
<version>2.3.3</version>
99
</parent>
1010

1111
<artifactId>agent</artifactId>
@@ -57,12 +57,6 @@
5757
<version>${project.version}</version>
5858
</dependency>
5959

60-
<dependency>
61-
<groupId>${project.groupId}</groupId>
62-
<artifactId>tank-common</artifactId>
63-
<version>${project.version}</version>
64-
</dependency>
65-
6660
<dependency>
6761
<groupId>${project.groupId}</groupId>
6862
<artifactId>agent-common</artifactId>

agent/apiharness/src/main/java/com/intuit/tank/harness/APITestHarness.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ public synchronized void threadComplete() {
658658
long count = doneSignal.getCount();
659659
// numCompletedThreads = (int) (agentRunData.getNumUsers() - count);
660660
if (isDebug() || count < 10) {
661-
LOG.info(new ObjectMessage(ImmutableMap.of("Message", "User thread finished... Remaining->" + currentUsers)));
661+
LOG.info(new ObjectMessage(ImmutableMap.of("Message", "User thread finished... Remaining = " + currentUsers)));
662662
}
663663
}
664664

0 commit comments

Comments
 (0)