MetricsService

Hooks into the transaction nechanism to provide a counters relating to numbers of object loaded, dirtied etc.

Only entities with DomainObject#entityChangePublishing() enabled (in other words, auditing) are counted.

API

MetricsService.java
interface MetricsService {
  int numberEntitiesLoaded()     (1)
  Set<Bookmark> entitiesLoaded()     (2)
  int numberEntitiesDirtied()     (3)
  Set<Bookmark> entitiesDirtied()     (4)
}
1 numberEntitiesLoaded()

The number of entities that were loaded (but not necessarily modified) from the database.

2 entitiesLoaded()

Returns the bookmarks of the entities loaded within the transaction.

3 numberEntitiesDirtied()

The number of entities that were modified within the transaction.

4 entitiesDirtied()

Returns the bookmarks of the entities that were modified within the transaction.

Members

numberEntitiesLoaded()

The number of entities that were loaded (but not necessarily modified) from the database.

Is captured within MemberExecutionDto#getMetrics() (accessible from InteractionProvider#currentInteraction() ).

entitiesLoaded()

Returns the bookmarks of the entities loaded within the transaction.

Requires detailed metrics to be enabled using config param.

numberEntitiesDirtied()

The number of entities that were modified within the transaction.

Is captured within MemberExecutionDto#getMetrics() (accessible from InteractionProvider#currentInteraction() .

entitiesDirtied()

Returns the bookmarks of the entities that were modified within the transaction.

Requires detailed metrics to be enabled using config param.

Implementation

The framework provides a default of this service, namely o.a.c.core.transaction.changetracking.EntityChangeTrackerDefault.

This supports both JDO and JPA persistence mechanisms.