Skip to content

Commit

Permalink
Traffic Rule
Browse files Browse the repository at this point in the history
  • Loading branch information
wsm12138 committed Mar 11, 2022
1 parent 783750c commit 22f32b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ public abstract class UnpooledPointSelectBenchmarkBase implements JDBCConnection
@Setup(Level.Trial)
public void setup() throws Exception {
connection = getConnection();
for (int i = 0; i < preparedStatements.length; i++) {
preparedStatements[i] = connection.prepareStatement(String.format("select c from sbtest%d where id = ?", i + 1));
}
// for (int i = 0; i < preparedStatements.length; i++) {
// preparedStatements[i] = connection.prepareStatement(String.format("/* shardingsphere hint:useTraffic=true */SELECT SUM(id), AVG(id), COUNT(id) FROM sbtest1 WHERE id <= 1000 GROUP BY id ORDER BY k;", i + 1));
// }
int i=0;
preparedStatements[i] = connection.prepareStatement("/* shardingsphere hint:useTraffic=true */SELECT SUM(id), AVG(id), COUNT(id) FROM sbtest1 WHERE id <= 1000 GROUP BY id ORDER BY k;");

}

@Benchmark
public void oltpPointSelect() throws Exception {
for (PreparedStatement each : preparedStatements) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ private void initSQLHintAlgorithm() {
sqlHintAlgorithm.init();
}

@Benchmark
public void testSQLHintAlgorithmMatch() {
sqlHintAlgorithm.match(new HintTrafficValue<>("/* shardingsphere hint:use_traffic=true */"));
}
// @Benchmark
// public void testSQLHintAlgorithmMatch() {
// sqlHintAlgorithm.match(new HintTrafficValue<>("/* shardingsphere hint:use_traffic=true */"));
// }

@Benchmark
public void testSQLMatchAlgorithmMatch() {
Expand Down

This file was deleted.

0 comments on commit 22f32b1

Please sign in to comment.