@Test public void do_not_log_query_when_execution_below_configured_threshold() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("slowQueryThresholdInMilliseconds", "7"); SlowQueryLogDecider slowQueryLogDecider = buildSlowLogDecider(options); Query query = buildQuery(6, StatementType.SELECT, "keyspace", "table"); assertThat(slowQueryLogDecider.isForReporting(query)).isFalse(); }
public boolean isForReporting(Query query) { if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query) && typeForLogging(query)) { return true; } return false; }
SlowQueryLogDecider { public boolean isForReporting(Query query) { if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query) && typeForLogging(query)) { return true; } return false; } }
SlowQueryLogDecider { public boolean isForReporting(Query query) { if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query) && typeForLogging(query)) { return true; } return false; } private  SlowQueryLogDecider(SlowQueryConfiguration slowQueryConfiguration); }
SlowQueryLogDecider { public boolean isForReporting(Query query) { if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query) && typeForLogging(query)) { return true; } return false; } private  SlowQueryLogDecider(SlowQueryConfiguration slowQueryConfiguration); static SlowQueryLogDecider create(SlowQueryConfiguration configuration); boolean isForReporting(Query query); }
SlowQueryLogDecider { public boolean isForReporting(Query query) { if (executionTimeForLogging(query.executionTimeInMilliseconds()) && tableForLogging(query) && typeForLogging(query)) { return true; } return false; } private  SlowQueryLogDecider(SlowQueryConfiguration slowQueryConfiguration); static SlowQueryLogDecider create(SlowQueryConfiguration configuration); boolean isForReporting(Query query);  }