Commit 8e36c353 by Adi Amir

increase number of threads in handlers

parent 5b3433fe
......@@ -6,6 +6,6 @@ log4j.prop.file.path=/logs/conf/log4j.xml
### microservice/rest server
server.port=50040
server.host=0.0.0.0
server.worker.threads=4
server.worker.threads=10
......@@ -61,6 +61,9 @@ public class GEManager {
String error = null;
BaseRestResponse brr = new BaseRestResponse(false,null);
long tStart = System.currentTimeMillis();
logger.info("executeRequest() started: " + getApiIdString(apiIdAsParams));
if (apiIdAsParams.length == 1 && apiIdAsParams[0].equals("cameras")) {
brr = getCameraList(requestContext);
}
......@@ -75,7 +78,7 @@ public class GEManager {
}
else {
String err = "executeRequest() failed. Unknown api: " + getApiIdString(apiIdAsParams);
return errorResponse(err);
brr = errorResponse(err);
}
// if the request failed due to invalid token - fetch a new one & try again
......@@ -85,10 +88,14 @@ public class GEManager {
brr = executeRequest(serviceId, apiIdAsParams, requestContext);
}
else {
return errorResponse("executeRequest() failed to obtain access token");
brr = errorResponse("executeRequest() failed to obtain access token");
}
}
long tEnd = System.currentTimeMillis();
double elapsedTime = ((double)(tEnd - tStart)) / 1000.0;
logger.info("executeRequest finished:. time= " + elapsedTime + " success=" + brr.success + " api=" + getApiIdString(apiIdAsParams));
return brr;
}
......@@ -529,7 +536,7 @@ public class GEManager {
private String getApiIdString(String[] apiIdAsParams) {
String apiString = "";
for (String p: apiIdAsParams)
apiString += p + "\"";
apiString += p + "/";
return apiString;
}
......@@ -560,7 +567,7 @@ public class GEManager {
}
private void logHttpError(String funcName, SimpleHttpResponse httpResp) {
logger.error("statusCode=" + httpResp.getStatusCode() + " content=" + httpResp.getContent());
logger.error(funcName + " failed:" + " statusCode=" + httpResp.getStatusCode() + " content=" + httpResp.getContent());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment