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