Wiki
Clone wikiCdi Overseer / Home
Cdi Overseer
Cdi Overseer is an easy and fast CDI portable extensions that monitors injections and provides statistics.
Activation
Cdi Overseer library should be placed in class path. To activate statistics collecting:
- Create META-INF/services/javax.enterprise.inject.spi.Extension file.
- Copy and paste following fully qualified class name com.cdioverseer.Overseer into the file.
- Restart the application.
Queries
You need to inject an instance of Overseer into your bean, and use Overseer.getQueryResult(Query) method.
Example query:
Overseer overseer; /* ... */ final Query q = Query.createBuilder().withOrderBy(OrderBy.CONSTRUCTED_COUNT).withOrdering(Ordering.DESC) .withStart(0).withCount(200).build(); final List<StatsEntry> result = overseer.getQueryResult(q);
How does it work ?
Cdi Overseer creates a wrapper around every discovered injection target during the bean discovery. When application server invokes postConstruct and preDestroy callbacks on the wrapper it counts those invocations and passes invocation to wrapped injection target.
Ideas
Do you have any ideas or suggestions?
Updated