use of ch.qos.logback.core.Appender in project atlasdb by palantir.
the class ProfilingKeyValueServiceTest method getSlowLogPresentOnInfoLevel.
@Test
public void getSlowLogPresentOnInfoLevel() {
Appender mockAppender = setLogLevelAndGetAppender(Level.INFO);
doAnswer(waitASecondAndAHalfAndReturn).when(delegate).get(TABLE_REF, timestampByCell);
kvs.get(TABLE_REF, timestampByCell);
verify(mockAppender).doAppend(slowLogMatcher.get());
}
use of ch.qos.logback.core.Appender in project atlasdb by palantir.
the class ProfilingKeyValueServiceTest method getAllTableNamesSlowLogPresentOnInfoLevel.
@Test
public void getAllTableNamesSlowLogPresentOnInfoLevel() {
Appender mockAppender = setLogLevelAndGetAppender(Level.INFO);
doAnswer(waitASecondAndAHalf).when(delegate).getAllTableNames();
kvs.getAllTableNames();
verify(mockAppender).doAppend(slowLogMatcher.get());
}
use of ch.qos.logback.core.Appender in project atlasdb by palantir.
the class ProfilingKeyValueServiceTest method getNoLoggingHappensIfQueryFastAndInfoLevel.
@Test
public void getNoLoggingHappensIfQueryFastAndInfoLevel() {
Appender mockAppender = setLogLevelAndGetAppender(Level.INFO);
kvs.get(TABLE_REF, timestampByCell);
verifyNoMoreInteractions(mockAppender);
}
use of ch.qos.logback.core.Appender in project atlasdb by palantir.
the class ProfilingKeyValueServiceTest method getAllTableNamesTraceLogPresentOnTraceLevelEvenIfQueryIsSlow.
@Test
public void getAllTableNamesTraceLogPresentOnTraceLevelEvenIfQueryIsSlow() {
Appender mockAppender = setLogLevelAndGetAppender(Level.TRACE);
doAnswer(waitASecondAndAHalf).when(delegate).getAllTableNames();
kvs.getAllTableNames();
verify(mockAppender).doAppend(traceLogMatcher.get());
verify(mockAppender).doAppend(slowLogMatcher.get());
}
use of ch.qos.logback.core.Appender in project atlasdb by palantir.
the class ProfilingKeyValueServiceTest method getAllTableNamesNoLoggingHappensIfQueryFastAndInfoLevel.
@Test
public void getAllTableNamesNoLoggingHappensIfQueryFastAndInfoLevel() {
Appender mockAppender = setLogLevelAndGetAppender(Level.INFO);
kvs.getAllTableNames();
verifyNoMoreInteractions(mockAppender);
}
Aggregations