Skip to content

Commit

Permalink
Clarified that threshold is in milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
klaren committed Aug 16, 2017
1 parent 4c6af40 commit c796e98
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -69,7 +69,7 @@ public class QueryLoggerTest
public final FakeHeapAllocation heapAllocation = new FakeHeapAllocation(); public final FakeHeapAllocation heapAllocation = new FakeHeapAllocation();
private long pageHits; private long pageHits;
private long pageFaults; private long pageFaults;
private long threshold = 10; //ms private long thresholdInMillis = 10;


@Test @Test
public void shouldLogQuerySlowerThanThreshold() throws Exception public void shouldLogQuerySlowerThanThreshold() throws Exception
Expand Down Expand Up @@ -109,7 +109,7 @@ public void shouldRespectThreshold() throws Exception


// and when // and when
ExecutingQuery query2 = query( SESSION_2, "TestUser2", QUERY_2 ); ExecutingQuery query2 = query( SESSION_2, "TestUser2", QUERY_2 );
threshold = 5; thresholdInMillis = 5;
queryLogger.startQueryExecution( query2 ); queryLogger.startQueryExecution( query2 );
clock.forward( 9, TimeUnit.MILLISECONDS ); clock.forward( 9, TimeUnit.MILLISECONDS );
queryLogger.endSuccess( query2 ); queryLogger.endSuccess( query2 );
Expand Down Expand Up @@ -486,7 +486,7 @@ private QueryLogger queryLogger( LogProvider logProvider, QueryLogEntryContent..
{ {
EnumSet<QueryLogEntryContent> flagSet = EnumSet.noneOf( QueryLogEntryContent.class ); EnumSet<QueryLogEntryContent> flagSet = EnumSet.noneOf( QueryLogEntryContent.class );
Collections.addAll( flagSet, flags ); Collections.addAll( flagSet, flags );
return new QueryLogger( logProvider.getLog( getClass() ), () -> true, () -> threshold, flagSet ); return new QueryLogger( logProvider.getLog( getClass() ), () -> true, () -> thresholdInMillis, flagSet );
} }


private ExecutingQuery query( private ExecutingQuery query(
Expand Down

0 comments on commit c796e98

Please sign in to comment.