@Test public void log_all_queries_when_all_types_are_configured_for_logging() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("queryTypesToLog", Arrays.asList("ALL")); SlowQueryLogDecider slowQueryLogDecider = buildSlowLogDecider(options); Query updateQuery = buildQuery(50, StatementType.UPDATE, "keyspace", "table"); Query selectQuery = buildQuery(50, StatementType.SELECT, "keyspace", "table"); assertThat(slowQueryLogDecider.isForReporting(updateQuery)).isTrue(); assertThat(slowQueryLogDecider.isForReporting(selectQuery)).isTrue(); }
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);  }