removed logs
This commit is contained in:
parent
6dec0d7a6a
commit
e193c80d11
|
@ -89,10 +89,13 @@ public class Bootstrap implements ServletContainerInitializer {
|
|||
@SuppressWarnings("resource")
|
||||
private void initialiseContainer() {
|
||||
|
||||
ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
try {
|
||||
// TODO Ask why is needed?
|
||||
Thread.currentThread().setContextClassLoader(ContainerManager.class.getClassLoader());
|
||||
|
||||
log.trace("smartgears is starting");
|
||||
|
||||
|
||||
/* Get the ContainerContext. Look at DefaultProvider */
|
||||
context = ProviderFactory.provider().containerContext();
|
||||
|
@ -108,7 +111,7 @@ public class Bootstrap implements ServletContainerInitializer {
|
|||
new ProcessorMetrics().bindTo(registry);
|
||||
|
||||
Metrics.addRegistry(registry);
|
||||
|
||||
|
||||
|
||||
/* Validate the configuration retrieved by ContainerContext
|
||||
* using gcube facilities annotation based
|
||||
|
@ -124,6 +127,8 @@ public class Bootstrap implements ServletContainerInitializer {
|
|||
|
||||
//we let the container continue
|
||||
|
||||
} finally {//restore the classloader of the current application
|
||||
Thread.currentThread().setContextClassLoader(contextCL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,7 +146,7 @@ public class Bootstrap implements ServletContainerInitializer {
|
|||
try {
|
||||
|
||||
// TODO Ask why is needed?
|
||||
//Thread.currentThread().setContextClassLoader(ContainerManager.class.getClassLoader());
|
||||
Thread.currentThread().setContextClassLoader(ContainerManager.class.getClassLoader());
|
||||
|
||||
manager = ContainerManager.instance;
|
||||
|
||||
|
|
|
@ -36,12 +36,13 @@ public class RequestMetrics extends RequestHandler {
|
|||
|
||||
@Override
|
||||
public void handleResponse(ResponseEvent e) {
|
||||
String statusCode = Integer.toString(e.response().getStatus());
|
||||
Metrics.timer(HTTP_REQUEST_METRICS_NAME, "status", statusCode).record(Duration.ofMillis(System.currentTimeMillis() - startCallThreadLocal.get()));
|
||||
startCallThreadLocal.remove();
|
||||
log.debug("metrics for current call saved");
|
||||
try {
|
||||
String statusCode = Integer.toString(e.response().getStatus());
|
||||
Metrics.timer(HTTP_REQUEST_METRICS_NAME, "status", statusCode).record(Duration.ofMillis(System.currentTimeMillis() - startCallThreadLocal.get()));
|
||||
startCallThreadLocal.remove();
|
||||
}catch(Throwable t) {
|
||||
log.warn("error getting Metrics",t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue