Skip to content

Commit

Permalink
Log test query durarion only if it run longer than 1s
Browse files Browse the repository at this point in the history
  • Loading branch information
kokosing committed Jan 29, 2019
1 parent d13fbf9 commit 53ed213
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ public static void assertUpdate(QueryRunner queryRunner, Session session, @Langu
queryPlan = null;
results = queryRunner.execute(session, sql);
}
log.info("FINISHED in presto: %s", nanosSince(start));
Duration queryTime = nanosSince(start);
if (queryTime.compareTo(Duration.succinctDuration(1, SECONDS)) > 0) {
log.info("FINISHED in presto: %s", queryTime);
}

if (planAssertion.isPresent()) {
planAssertion.get().accept(queryPlan);
Expand Down Expand Up @@ -160,7 +163,10 @@ private static void assertQuery(
catch (RuntimeException ex) {
fail("Execution of 'expected' query failed: " + expected, ex);
}
log.info("FINISHED in presto: %s, h2: %s, total: %s", actualTime, nanosSince(expectedStart), nanosSince(start));
Duration totalTime = nanosSince(start);
if (totalTime.compareTo(Duration.succinctDuration(1, SECONDS)) > 0) {
log.info("FINISHED in presto: %s, h2: %s, total: %s", actualTime, nanosSince(expectedStart), totalTime);
}

if (actualResults.getUpdateType().isPresent() || actualResults.getUpdateCount().isPresent()) {
if (!actualResults.getUpdateType().isPresent()) {
Expand Down

0 comments on commit 53ed213

Please sign in to comment.