use of com.google.gerrit.server.logging.PerformanceLogger in project gerrit by GerritCodeReview.
the class TraceIT method performanceLoggingForRestCall.
@Test
public void performanceLoggingForRestCall() throws Exception {
PerformanceLogger testPerformanceLogger = mock(PerformanceLogger.class);
try (Registration registration = extensionRegistry.newRegistration().add(testPerformanceLogger)) {
RestResponse response = adminRestSession.put("/projects/new10");
assertThat(response.getStatusCode()).isEqualTo(SC_CREATED);
verify(testPerformanceLogger, timeout(5000).atLeastOnce()).log(anyString(), anyLong(), any());
}
}
use of com.google.gerrit.server.logging.PerformanceLogger in project gerrit by GerritCodeReview.
the class TraceIT method performanceLoggingForPush.
@Test
public void performanceLoggingForPush() throws Exception {
PerformanceLogger testPerformanceLogger = mock(PerformanceLogger.class);
try (Registration registration = extensionRegistry.newRegistration().add(testPerformanceLogger)) {
PushOneCommit push = pushFactory.create(admin.newIdent(), testRepo);
PushOneCommit.Result r = push.to("refs/heads/master");
r.assertOkStatus();
verify(testPerformanceLogger, timeout(5000).atLeastOnce()).log(anyString(), anyLong(), any());
}
}
use of com.google.gerrit.server.logging.PerformanceLogger in project gerrit by GerritCodeReview.
the class TraceIT method noPerformanceLoggingIfDisabled.
@Test
@GerritConfig(name = "tracing.performanceLogging", value = "false")
public void noPerformanceLoggingIfDisabled() throws Exception {
PerformanceLogger testPerformanceLogger = mock(PerformanceLogger.class);
try (Registration registration = extensionRegistry.newRegistration().add(testPerformanceLogger)) {
RestResponse response = adminRestSession.put("/projects/new11");
assertThat(response.getStatusCode()).isEqualTo(SC_CREATED);
PushOneCommit push = pushFactory.create(admin.newIdent(), testRepo);
PushOneCommit.Result r = push.to("refs/heads/master");
r.assertOkStatus();
verifyNoInteractions(testPerformanceLogger);
}
}
Aggregations