Package ubic.gemma.core.profiling
Class BeanInitializationTimeMonitor
- java.lang.Object
-
- ubic.gemma.core.profiling.BeanInitializationTimeMonitor
-
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor
public class BeanInitializationTimeMonitor extends Object implements org.springframework.beans.factory.config.BeanFactoryPostProcessor
Hook into the bean post-processing lifecycle and record bean initialization time.- Author:
- poirigui
-
-
Constructor Summary
Constructors Constructor Description BeanInitializationTimeMonitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getInitializationTime(String beanName, TimeUnit timeUnit)
Obtain the time spent initializing a bean.long
getInstantiationTime(String beanName, TimeUnit timeUnit)
Obtain the time spent instantiating a bean.Collection<String>
getRecordedBeans()
Long
getTotalTime(String beanName, TimeUnit timeUnit)
Obtain the total time spent instantiating and initializing a bean.long
getTotalTime(TimeUnit timeUnit)
Obtain the total time spent instantiating and initializing beans.void
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
void
reset()
Reset recorded times.
-
-
-
Method Detail
-
getRecordedBeans
public Collection<String> getRecordedBeans()
-
getInstantiationTime
public long getInstantiationTime(String beanName, TimeUnit timeUnit)
Obtain the time spent instantiating a bean.
-
getInitializationTime
public long getInitializationTime(String beanName, TimeUnit timeUnit)
Obtain the time spent initializing a bean.
-
getTotalTime
public Long getTotalTime(String beanName, TimeUnit timeUnit)
Obtain the total time spent instantiating and initializing a bean.
-
getTotalTime
public long getTotalTime(TimeUnit timeUnit)
Obtain the total time spent instantiating and initializing beans.
-
reset
public void reset()
Reset recorded times.
-
postProcessBeanFactory
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
- Specified by:
postProcessBeanFactory
in interfaceorg.springframework.beans.factory.config.BeanFactoryPostProcessor
- Throws:
org.springframework.beans.BeansException
-
-