Add some more timing instrumentation to annotation related processing

This commit is contained in:
Jan Bartel 2013-09-27 16:57:30 +10:00
parent df336f3476
commit afb1b69171
2 changed files with 13 additions and 2 deletions

View File

@ -285,7 +285,6 @@ public class AnnotationConfiguration extends AbstractConfiguration
{
AnnotationParser parser = createAnnotationParser();
boolean multiThreadedScan = isUseMultiThreading(context);
int maxThreads = 0;
int maxScanWait = 0;
if (multiThreadedScan)
{

View File

@ -21,15 +21,20 @@ package org.eclipse.jetty.plus.annotation;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import javax.servlet.ServletContainerInitializer;
import org.eclipse.jetty.util.ConcurrentHashSet;
import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.webapp.WebAppContext;
public class ContainerInitializer
{
private static final Logger LOG = Log.getLogger(ContainerInitializer.class);
final protected ServletContainerInitializer _target;
final protected Class[] _interestedTypes;
protected Set<String> _applicableTypeNames = new ConcurrentHashSet<String>();
@ -95,7 +100,14 @@ public class ContainerInitializer
classes.add(Loader.loadClass(context.getClass(), s));
context.getServletContext().setExtendedListenerTypes(true);
_target.onStartup(classes, context.getServletContext());
if (LOG.isDebugEnabled())
{
long start = System.nanoTime();
_target.onStartup(classes, context.getServletContext());
LOG.debug("ContainerInitializer {} called in {}ms", _target.getClass().getName(), TimeUnit.MILLISECONDS.convert(System.nanoTime()-start, TimeUnit.NANOSECONDS));
}
else
_target.onStartup(classes, context.getServletContext());
}
finally
{