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