HHH-18109 Remove executionTime from JFR events
This commit is contained in:
parent
5cdcb2c582
commit
86d40a4f87
|
@ -40,9 +40,6 @@ public class CacheGetEvent extends Event implements HibernateMonitoringEvent {
|
|||
@Label( "Region Name" )
|
||||
public String regionName;
|
||||
|
||||
@Label( "Cache Get Execution Time" )
|
||||
public long executionTime;
|
||||
|
||||
@Label("Cache Hit")
|
||||
public boolean hit;
|
||||
|
||||
|
@ -51,6 +48,4 @@ public class CacheGetEvent extends Event implements HibernateMonitoringEvent {
|
|||
return NAME ;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
|
||||
}
|
||||
|
|
|
@ -40,9 +40,6 @@ public class CachePutEvent extends Event implements HibernateMonitoringEvent {
|
|||
@Label( "Used Natural Id" )
|
||||
public boolean isNaturalId;
|
||||
|
||||
@Label( "Cache Put Execution Time" )
|
||||
public long executionTime;
|
||||
|
||||
@Label( "Description" )
|
||||
public String description;
|
||||
|
||||
|
@ -54,6 +51,4 @@ public class CachePutEvent extends Event implements HibernateMonitoringEvent {
|
|||
return NAME ;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,9 +28,6 @@ public class DirtyCalculationEvent extends Event implements HibernateMonitoringE
|
|||
@Label("Session Identifier")
|
||||
public String sessionIdentifier;
|
||||
|
||||
@Label("PartialFlushEvent time")
|
||||
public long executionTime;
|
||||
|
||||
@Label("Entity Name")
|
||||
public String entityName;
|
||||
|
||||
|
@ -45,5 +42,4 @@ public class DirtyCalculationEvent extends Event implements HibernateMonitoringE
|
|||
return NAME;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
}
|
||||
|
|
|
@ -34,9 +34,6 @@ public class FlushEvent extends Event implements HibernateMonitoringEvent {
|
|||
@Label("Number Of Processed Collections")
|
||||
public int numberOfCollectionsProcessed;
|
||||
|
||||
@Label("Flush time")
|
||||
public long executionTime;
|
||||
|
||||
@Label("Auto Flush")
|
||||
public boolean isAutoFlush;
|
||||
|
||||
|
@ -45,6 +42,4 @@ public class FlushEvent extends Event implements HibernateMonitoringEvent {
|
|||
return NAME;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,15 +28,9 @@ public class JdbcBatchExecutionEvent extends Event implements HibernateMonitorin
|
|||
@Label("PreparedStatement SQL")
|
||||
public String sql;
|
||||
|
||||
@Label("Batch Execution time")
|
||||
public long executionTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -31,13 +31,9 @@ public class JdbcConnectionAcquisitionEvent extends Event implements HibernateMo
|
|||
@Label("Tenant Identifier")
|
||||
public String tenantIdentifier;
|
||||
|
||||
@Label("Connection Acquisition Time")
|
||||
public long executionTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
}
|
||||
|
|
|
@ -31,14 +31,9 @@ public class JdbcConnectionReleaseEvent extends Event implements HibernateMonito
|
|||
@Label("Tenant Identifier")
|
||||
public String tenantIdentifier;
|
||||
|
||||
@Label("Connection Release Time")
|
||||
public long executionTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,14 +28,9 @@ public class JdbcPreparedStatementCreationEvent extends Event implements Hiberna
|
|||
@Label("PreparedStatement SQL")
|
||||
public String sql;
|
||||
|
||||
@Label("PreparedStatement Creation Time")
|
||||
public long executionTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,14 +28,9 @@ public class JdbcPreparedStatementExecutionEvent extends Event implements Hibern
|
|||
@Label( "PreparedStatement SQL" )
|
||||
public String sql;
|
||||
|
||||
@Label( "PreparedStatement Execution Time" )
|
||||
public long executionTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return NAME ;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
|
||||
}
|
||||
|
|
|
@ -20,8 +20,6 @@ import org.hibernate.stat.internal.StatsHelper;
|
|||
|
||||
import jdk.jfr.EventType;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.NANOSECONDS;
|
||||
|
||||
|
||||
@AllowNonPortable
|
||||
public class JfrEventManager implements EventManager {
|
||||
|
@ -101,7 +99,6 @@ public class JfrEventManager implements EventManager {
|
|||
if ( jdbcConnectionAcquisitionEventType.isEnabled() ) {
|
||||
final JdbcConnectionAcquisitionEvent jdbcConnectionAcquisitionEvent = new JdbcConnectionAcquisitionEvent();
|
||||
jdbcConnectionAcquisitionEvent.begin();
|
||||
jdbcConnectionAcquisitionEvent.startedAt = System.nanoTime();
|
||||
return jdbcConnectionAcquisitionEvent;
|
||||
}
|
||||
else {
|
||||
|
@ -118,7 +115,6 @@ public class JfrEventManager implements EventManager {
|
|||
final JdbcConnectionAcquisitionEvent jdbcConnectionAcquisitionEvent = (JdbcConnectionAcquisitionEvent) event;
|
||||
jdbcConnectionAcquisitionEvent.end();
|
||||
if ( jdbcConnectionAcquisitionEvent.shouldCommit() ) {
|
||||
jdbcConnectionAcquisitionEvent.executionTime = getExecutionTime( jdbcConnectionAcquisitionEvent.startedAt );
|
||||
jdbcConnectionAcquisitionEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
jdbcConnectionAcquisitionEvent.tenantIdentifier = tenantId == null ? null : session.getFactory()
|
||||
.getTenantIdentifierJavaType()
|
||||
|
@ -133,7 +129,6 @@ public class JfrEventManager implements EventManager {
|
|||
if ( jdbcConnectionReleaseEventType.isEnabled() ) {
|
||||
final JdbcConnectionReleaseEvent jdbcConnectionReleaseEvent = new JdbcConnectionReleaseEvent();
|
||||
jdbcConnectionReleaseEvent.begin();
|
||||
jdbcConnectionReleaseEvent.startedAt = System.nanoTime();
|
||||
return jdbcConnectionReleaseEvent;
|
||||
}
|
||||
else {
|
||||
|
@ -150,7 +145,6 @@ public class JfrEventManager implements EventManager {
|
|||
final JdbcConnectionReleaseEvent jdbcConnectionReleaseEvent = (JdbcConnectionReleaseEvent) event;
|
||||
jdbcConnectionReleaseEvent.end();
|
||||
if ( jdbcConnectionReleaseEvent.shouldCommit() ) {
|
||||
jdbcConnectionReleaseEvent.executionTime = getExecutionTime( jdbcConnectionReleaseEvent.startedAt );
|
||||
jdbcConnectionReleaseEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
jdbcConnectionReleaseEvent.tenantIdentifier = tenantId == null ? null : session.getFactory()
|
||||
.getTenantIdentifierJavaType()
|
||||
|
@ -165,7 +159,6 @@ public class JfrEventManager implements EventManager {
|
|||
if ( jdbcPreparedStatementCreationEventType.isEnabled() ) {
|
||||
final JdbcPreparedStatementCreationEvent jdbcPreparedStatementCreation = new JdbcPreparedStatementCreationEvent();
|
||||
jdbcPreparedStatementCreation.begin();
|
||||
jdbcPreparedStatementCreation.startedAt = System.nanoTime();
|
||||
return jdbcPreparedStatementCreation;
|
||||
}
|
||||
else {
|
||||
|
@ -181,7 +174,6 @@ public class JfrEventManager implements EventManager {
|
|||
final JdbcPreparedStatementCreationEvent jdbcPreparedStatementCreation = (JdbcPreparedStatementCreationEvent) event;
|
||||
jdbcPreparedStatementCreation.end();
|
||||
if ( jdbcPreparedStatementCreation.shouldCommit() ) {
|
||||
jdbcPreparedStatementCreation.executionTime = getExecutionTime( jdbcPreparedStatementCreation.startedAt );
|
||||
jdbcPreparedStatementCreation.sql = preparedStatementSql;
|
||||
jdbcPreparedStatementCreation.commit();
|
||||
}
|
||||
|
@ -193,7 +185,6 @@ public class JfrEventManager implements EventManager {
|
|||
if ( jdbcPreparedStatementExecutionEventType.isEnabled() ) {
|
||||
final JdbcPreparedStatementExecutionEvent jdbcPreparedStatementExecutionEvent = new JdbcPreparedStatementExecutionEvent();
|
||||
jdbcPreparedStatementExecutionEvent.begin();
|
||||
jdbcPreparedStatementExecutionEvent.startedAt = System.nanoTime();
|
||||
return jdbcPreparedStatementExecutionEvent;
|
||||
}
|
||||
else {
|
||||
|
@ -209,8 +200,6 @@ public class JfrEventManager implements EventManager {
|
|||
final JdbcPreparedStatementExecutionEvent jdbcPreparedStatementExecutionEvent = (JdbcPreparedStatementExecutionEvent) event;
|
||||
jdbcPreparedStatementExecutionEvent.end();
|
||||
if ( jdbcPreparedStatementExecutionEvent.shouldCommit() ) {
|
||||
jdbcPreparedStatementExecutionEvent.executionTime = getExecutionTime(
|
||||
jdbcPreparedStatementExecutionEvent.startedAt );
|
||||
jdbcPreparedStatementExecutionEvent.sql = preparedStatementSql;
|
||||
jdbcPreparedStatementExecutionEvent.commit();
|
||||
}
|
||||
|
@ -222,7 +211,6 @@ public class JfrEventManager implements EventManager {
|
|||
if ( jdbcBatchExecutionEventType.isEnabled() ) {
|
||||
final JdbcBatchExecutionEvent jdbcBatchExecutionEvent = new JdbcBatchExecutionEvent();
|
||||
jdbcBatchExecutionEvent.begin();
|
||||
jdbcBatchExecutionEvent.startedAt = System.nanoTime();
|
||||
return jdbcBatchExecutionEvent;
|
||||
}
|
||||
else {
|
||||
|
@ -238,7 +226,6 @@ public class JfrEventManager implements EventManager {
|
|||
final JdbcBatchExecutionEvent jdbcBatchExecutionEvent = (JdbcBatchExecutionEvent) event;
|
||||
jdbcBatchExecutionEvent.end();
|
||||
if ( jdbcBatchExecutionEvent.shouldCommit() ) {
|
||||
jdbcBatchExecutionEvent.executionTime = getExecutionTime( jdbcBatchExecutionEvent.startedAt );
|
||||
jdbcBatchExecutionEvent.sql = statementSql;
|
||||
jdbcBatchExecutionEvent.commit();
|
||||
}
|
||||
|
@ -250,7 +237,6 @@ public class JfrEventManager implements EventManager {
|
|||
if ( cachePutEventType.isEnabled() ) {
|
||||
final CachePutEvent cachePutEvent = new CachePutEvent();
|
||||
cachePutEvent.begin();
|
||||
cachePutEvent.startedAt = System.nanoTime();
|
||||
return cachePutEvent;
|
||||
}
|
||||
else {
|
||||
|
@ -269,7 +255,6 @@ public class JfrEventManager implements EventManager {
|
|||
final CachePutEvent cachePutEvent = (CachePutEvent) event;
|
||||
cachePutEvent.end();
|
||||
if ( cachePutEvent.shouldCommit() ) {
|
||||
cachePutEvent.executionTime = getExecutionTime( cachePutEvent.startedAt );
|
||||
cachePutEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
cachePutEvent.regionName = region.getName();
|
||||
cachePutEvent.description = description.getText();
|
||||
|
@ -311,7 +296,6 @@ public class JfrEventManager implements EventManager {
|
|||
final CachePutEvent cachePutEvent = (CachePutEvent) event;
|
||||
cachePutEvent.end();
|
||||
if ( cachePutEvent.shouldCommit() ) {
|
||||
cachePutEvent.executionTime = getExecutionTime( cachePutEvent.startedAt );
|
||||
cachePutEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
cachePutEvent.regionName = cachedDomainDataAccess.getRegion().getName();
|
||||
cachePutEvent.entityName = getEntityName( persister );
|
||||
|
@ -335,7 +319,6 @@ public class JfrEventManager implements EventManager {
|
|||
final CachePutEvent cachePutEvent = (CachePutEvent) event;
|
||||
cachePutEvent.end();
|
||||
if ( cachePutEvent.shouldCommit() ) {
|
||||
cachePutEvent.executionTime = getExecutionTime( cachePutEvent.startedAt );
|
||||
cachePutEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
cachePutEvent.regionName = cachedDomainDataAccess.getRegion().getName();
|
||||
cachePutEvent.collectionName = persister.getNavigableRole().getFullPath();
|
||||
|
@ -351,7 +334,6 @@ public class JfrEventManager implements EventManager {
|
|||
if ( cacheGetEventType.isEnabled() ) {
|
||||
final CacheGetEvent cacheGetEvent = new CacheGetEvent();
|
||||
cacheGetEvent.begin();
|
||||
cacheGetEvent.startedAt = System.nanoTime();
|
||||
return cacheGetEvent;
|
||||
}
|
||||
else {
|
||||
|
@ -369,7 +351,6 @@ public class JfrEventManager implements EventManager {
|
|||
final CacheGetEvent cacheGetEvent = (CacheGetEvent) event;
|
||||
cacheGetEvent.end();
|
||||
if ( cacheGetEvent.shouldCommit() ) {
|
||||
cacheGetEvent.executionTime = getExecutionTime( cacheGetEvent.startedAt );
|
||||
cacheGetEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
cacheGetEvent.regionName = region.getName();
|
||||
cacheGetEvent.hit = hit;
|
||||
|
@ -390,7 +371,6 @@ public class JfrEventManager implements EventManager {
|
|||
final CacheGetEvent cacheGetEvent = (CacheGetEvent) event;
|
||||
cacheGetEvent.end();
|
||||
if ( cacheGetEvent.shouldCommit() ) {
|
||||
cacheGetEvent.executionTime = getExecutionTime( cacheGetEvent.startedAt );
|
||||
cacheGetEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
cacheGetEvent.entityName = getEntityName( persister );
|
||||
cacheGetEvent.regionName = region.getName();
|
||||
|
@ -412,7 +392,6 @@ public class JfrEventManager implements EventManager {
|
|||
final CacheGetEvent cacheGetEvent = (CacheGetEvent) event;
|
||||
cacheGetEvent.end();
|
||||
if ( cacheGetEvent.shouldCommit() ) {
|
||||
cacheGetEvent.executionTime = getExecutionTime( cacheGetEvent.startedAt );
|
||||
cacheGetEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
cacheGetEvent.collectionName = persister.getNavigableRole().getFullPath();
|
||||
cacheGetEvent.regionName = region.getName();
|
||||
|
@ -427,7 +406,6 @@ public class JfrEventManager implements EventManager {
|
|||
if ( flushEventType.isEnabled() ) {
|
||||
final FlushEvent flushEvent = new FlushEvent();
|
||||
flushEvent.begin();
|
||||
flushEvent.startedAt = System.nanoTime();
|
||||
return flushEvent;
|
||||
}
|
||||
else {
|
||||
|
@ -451,7 +429,6 @@ public class JfrEventManager implements EventManager {
|
|||
final FlushEvent flushEvent = (FlushEvent) hibernateMonitoringEvent;
|
||||
flushEvent.end();
|
||||
if ( flushEvent.shouldCommit() ) {
|
||||
flushEvent.executionTime = getExecutionTime( flushEvent.startedAt );
|
||||
flushEvent.sessionIdentifier = getSessionIdentifier( event.getSession() );
|
||||
flushEvent.numberOfEntitiesProcessed = event.getNumberOfEntitiesProcessed();
|
||||
flushEvent.numberOfCollectionsProcessed = event.getNumberOfCollectionsProcessed();
|
||||
|
@ -465,7 +442,6 @@ public class JfrEventManager implements EventManager {
|
|||
public PartialFlushEvent beginPartialFlushEvent() {
|
||||
if ( partialFlushEventType.isEnabled() ) {
|
||||
final PartialFlushEvent partialFlushEvent = new PartialFlushEvent();
|
||||
partialFlushEvent.startedAt = System.nanoTime();
|
||||
partialFlushEvent.begin();
|
||||
return partialFlushEvent;
|
||||
}
|
||||
|
@ -482,7 +458,6 @@ public class JfrEventManager implements EventManager {
|
|||
final PartialFlushEvent flushEvent = (PartialFlushEvent) hibernateMonitoringEvent;
|
||||
flushEvent.end();
|
||||
if ( flushEvent.shouldCommit() ) {
|
||||
flushEvent.executionTime = getExecutionTime( flushEvent.startedAt );
|
||||
flushEvent.sessionIdentifier = getSessionIdentifier( event.getSession() );
|
||||
flushEvent.numberOfEntitiesProcessed = event.getNumberOfEntitiesProcessed();
|
||||
flushEvent.numberOfCollectionsProcessed = event.getNumberOfCollectionsProcessed();
|
||||
|
@ -496,7 +471,6 @@ public class JfrEventManager implements EventManager {
|
|||
public DirtyCalculationEvent beginDirtyCalculationEvent() {
|
||||
if ( dirtyCalculationEventType.isEnabled() ) {
|
||||
final DirtyCalculationEvent dirtyCalculationEvent = new DirtyCalculationEvent();
|
||||
dirtyCalculationEvent.startedAt = System.nanoTime();
|
||||
dirtyCalculationEvent.begin();
|
||||
return dirtyCalculationEvent;
|
||||
}
|
||||
|
@ -516,7 +490,6 @@ public class JfrEventManager implements EventManager {
|
|||
final DirtyCalculationEvent dirtyCalculationEvent = (DirtyCalculationEvent) event;
|
||||
dirtyCalculationEvent.end();
|
||||
if ( dirtyCalculationEvent.shouldCommit() ) {
|
||||
dirtyCalculationEvent.executionTime = getExecutionTime( dirtyCalculationEvent.startedAt );
|
||||
dirtyCalculationEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
dirtyCalculationEvent.entityName = getEntityName( persister );
|
||||
dirtyCalculationEvent.entityStatus = entry.getStatus().name();
|
||||
|
@ -530,7 +503,6 @@ public class JfrEventManager implements EventManager {
|
|||
public PrePartialFlushEvent beginPrePartialFlush() {
|
||||
if ( prePartialFlushEventType.isEnabled() ) {
|
||||
final PrePartialFlushEvent partialFlushEvent = new PrePartialFlushEvent();
|
||||
partialFlushEvent.startedAt = System.nanoTime();
|
||||
partialFlushEvent.begin();
|
||||
return partialFlushEvent;
|
||||
}
|
||||
|
@ -547,17 +519,12 @@ public class JfrEventManager implements EventManager {
|
|||
final PrePartialFlushEvent prePartialFlushEvent = (PrePartialFlushEvent) event;
|
||||
prePartialFlushEvent.end();
|
||||
if ( prePartialFlushEvent.shouldCommit() ) {
|
||||
prePartialFlushEvent.executionTime = getExecutionTime( prePartialFlushEvent.startedAt );
|
||||
prePartialFlushEvent.sessionIdentifier = getSessionIdentifier( session );
|
||||
prePartialFlushEvent.commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private long getExecutionTime(Long startTime) {
|
||||
return NANOSECONDS.convert( System.nanoTime() - startTime, NANOSECONDS );
|
||||
}
|
||||
|
||||
private String getSessionIdentifier(SharedSessionContractImplementor session) {
|
||||
if ( session == null ) {
|
||||
return null;
|
||||
|
|
|
@ -34,9 +34,6 @@ public class PartialFlushEvent extends Event implements HibernateMonitoringEvent
|
|||
@Label( "Number Of Processed Collections" )
|
||||
public int numberOfCollectionsProcessed;
|
||||
|
||||
@Label( "PartialFlushEvent time" )
|
||||
public long executionTime;
|
||||
|
||||
@Label( "Auto Flush" )
|
||||
public boolean isAutoFlush;
|
||||
|
||||
|
@ -45,6 +42,4 @@ public class PartialFlushEvent extends Event implements HibernateMonitoringEvent
|
|||
return NAME ;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,13 +28,9 @@ public class PrePartialFlushEvent extends Event implements HibernateMonitoringEv
|
|||
@Label("Session Identifier")
|
||||
public String sessionIdentifier;
|
||||
|
||||
@Label("PrePartialFlushEvent time")
|
||||
public long executionTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
public transient long startedAt;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class DirtyCalculationEventTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( DirtyCalculationEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( sessionId );
|
||||
assertThat( event.getString( "entityName" ) )
|
||||
|
|
|
@ -58,14 +58,14 @@ public class JdbcBatchExecutionEventTests {
|
|||
RecordedEvent jdbcBatchExecutionEvent = events.get( 0 );
|
||||
assertThat( jdbcBatchExecutionEvent.getEventType().getName() )
|
||||
.isEqualTo( JdbcBatchExecutionEvent.NAME );
|
||||
assertThat( jdbcBatchExecutionEvent.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( jdbcBatchExecutionEvent.getDuration() ).isPositive();
|
||||
assertThat( jdbcBatchExecutionEvent.getString( "sql" ).toLowerCase( Locale.ROOT ) )
|
||||
.contains( "insert into " );
|
||||
|
||||
jdbcBatchExecutionEvent = events.get( 1 );
|
||||
assertThat( jdbcBatchExecutionEvent.getEventType().getName() )
|
||||
.isEqualTo( JdbcBatchExecutionEvent.NAME );
|
||||
assertThat( jdbcBatchExecutionEvent.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( jdbcBatchExecutionEvent.getDuration() ).isPositive();
|
||||
assertThat( jdbcBatchExecutionEvent.getString( "sql" ).toLowerCase( Locale.ROOT ) )
|
||||
.contains( "insert into " );
|
||||
}
|
||||
|
|
|
@ -47,14 +47,14 @@ public class JdbcPreparedStatementEventTests {
|
|||
RecordedEvent preparedStatementCreationEvent = events.get( 0 );
|
||||
assertThat( preparedStatementCreationEvent.getEventType().getName() )
|
||||
.isEqualTo( JdbcPreparedStatementCreationEvent.NAME );
|
||||
assertThat( preparedStatementCreationEvent.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( preparedStatementCreationEvent.getDuration() ).isPositive();
|
||||
assertThat( preparedStatementCreationEvent.getString( "sql" ).toLowerCase( Locale.ROOT ) )
|
||||
.contains( "select " );
|
||||
|
||||
RecordedEvent preparedStatementExecutionEvent = events.get( 1 );
|
||||
assertThat( preparedStatementExecutionEvent.getEventType().getName() )
|
||||
.isEqualTo( JdbcPreparedStatementExecutionEvent.NAME );
|
||||
assertThat( preparedStatementExecutionEvent.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( preparedStatementExecutionEvent.getDuration() ).isPositive();
|
||||
assertThat( preparedStatementExecutionEvent.getString( "sql" ) )
|
||||
.isEqualTo( preparedStatementCreationEvent.getString( "sql" ) );
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class CacheGetEventTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CacheGetEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getString( "entityName" ) )
|
||||
|
|
|
@ -64,7 +64,7 @@ public class EntityInsertCachePutEventTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CachePutEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getString( "entityName" ) ).isEqualTo( TestEntity.class.getName() );
|
||||
|
@ -91,7 +91,7 @@ public class EntityInsertCachePutEventTests {
|
|||
event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CachePutEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getString( "entityName" ) ).isEqualTo( AnotherTestEntity.class.getName() );
|
||||
|
|
|
@ -77,7 +77,7 @@ public class EntityUpdateCachePutEventTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CachePutEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getString( "entityName" ) ).isEqualTo( TestEntity.class.getName() );
|
||||
|
@ -107,7 +107,7 @@ public class EntityUpdateCachePutEventTests {
|
|||
event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CachePutEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getString( "entityName" ) ).isEqualTo( AnotherTestEntity.class.getName() );
|
||||
|
|
|
@ -71,7 +71,7 @@ public class NaturalIdGetCacheTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CacheGetEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getString( "entityName" ) )
|
||||
|
@ -83,7 +83,7 @@ public class NaturalIdGetCacheTests {
|
|||
event = events.get( 1 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CacheGetEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getString( "entityName" ) )
|
||||
|
|
|
@ -61,7 +61,7 @@ public class NaturalIdPutCacheTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CachePutEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getString( "entityName" ) ).isEqualTo( TestEntity.class.getName() );
|
||||
|
@ -73,7 +73,7 @@ public class NaturalIdPutCacheTests {
|
|||
event = events.get( 1 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CachePutEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getString( "entityName" ) ).isEqualTo( TestEntity.class.getName() );
|
||||
|
|
|
@ -75,7 +75,7 @@ public class QueryCachePutEventTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( CachePutEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getBoolean( "cacheChanged" ) ).isTrue();
|
||||
|
|
|
@ -50,7 +50,7 @@ public class AutoFlushTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( FlushEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getInt( "numberOfEntitiesProcessed" ) )
|
||||
|
@ -69,7 +69,7 @@ public class AutoFlushTests {
|
|||
event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( PartialFlushEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getInt( "numberOfEntitiesProcessed" ) )
|
||||
|
|
|
@ -48,7 +48,7 @@ public class ExplicitFlushTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( FlushEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( session.getSessionIdentifier().toString() );
|
||||
assertThat( event.getInt( "numberOfEntitiesProcessed" ) )
|
||||
|
|
|
@ -52,7 +52,7 @@ public class FlushTests {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( FlushEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( sessionId );
|
||||
assertThat( event.getInt( "numberOfEntitiesProcessed" ) )
|
||||
|
|
|
@ -65,7 +65,7 @@ public class PrePartialFlushTest {
|
|||
RecordedEvent event = events.get( 0 );
|
||||
assertThat( event.getEventType().getName() )
|
||||
.isEqualTo( PrePartialFlushEvent.NAME );
|
||||
assertThat( event.getLong( "executionTime" ) ).isGreaterThan( 0 );
|
||||
assertThat( event.getDuration() ).isPositive();
|
||||
assertThat( event.getString( "sessionIdentifier" ) )
|
||||
.isEqualTo( sessionId );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue