diff --git a/script/runbench.sh b/script/runbench.sh index 47286ae..14a0341 100755 --- a/script/runbench.sh +++ b/script/runbench.sh @@ -48,12 +48,12 @@ fi # Navigate to the project directory cd .. -./olxpbenchmark -b web3bench -c config/runthread1.xml --execute=true -o thread1 | tee log/thread1.log & -./olxpbenchmark -b web3bench -c config/runthread2.xml --execute=true -o thread2 | tee log/thread2.log & -./olxpbenchmark -b web3bench -c config/runR21.xml --execute=true -o R21 | tee log/R21.log & -./olxpbenchmark -b web3bench -c config/runR22.xml --execute=true -o R22 | tee log/R22.log & -./olxpbenchmark -b web3bench -c config/runR23.xml --execute=true -o R23 | tee log/R23.log & -./olxpbenchmark -b web3bench -c config/runR24.xml --execute=true -o R24 | tee log/R24.log & -./olxpbenchmark -b web3bench -c config/runR25.xml --execute=true -o R25 | tee log/R25.log +./olxpbenchmark -b web3bench --explain-analyze=true -c config/runthread1.xml --execute=true -o thread1 | tee log/thread1.log & +./olxpbenchmark -b web3bench --explain-analyze=true -c config/runthread2.xml --execute=true -o thread2 | tee log/thread2.log & +./olxpbenchmark -b web3bench --explain-analyze=true -c config/runR21.xml --execute=true -o R21 | tee log/R21.log & +./olxpbenchmark -b web3bench --explain-analyze=true -c config/runR22.xml --execute=true -o R22 | tee log/R22.log & +./olxpbenchmark -b web3bench --explain-analyze=true -c config/runR23.xml --execute=true -o R23 | tee log/R23.log & +./olxpbenchmark -b web3bench --explain-analyze=true -c config/runR24.xml --execute=true -o R24 | tee log/R24.log & +./olxpbenchmark -b web3bench --explain-analyze=true -c config/runR25.xml --execute=true -o R25 | tee log/R25.log wait diff --git a/src/com/olxpbenchmark/DBWorkload.java b/src/com/olxpbenchmark/DBWorkload.java index 0d1a229..8ee0265 100755 --- a/src/com/olxpbenchmark/DBWorkload.java +++ b/src/com/olxpbenchmark/DBWorkload.java @@ -127,51 +127,16 @@ public static void main(String[] args) throws Exception { } pluginConfig.setExpressionEngine(new XPathExpressionEngine()); Options options = new Options(); - options.addOption( - "b", - "bench", - true, + options.addOption("b", "bench", true, "[required] Benchmark class. Currently supported: " + pluginConfig.getList("/plugin//@name")); - options.addOption( - "c", - "config", - true, - "[required] Workload configuration file"); - options.addOption( - null, - "create", - true, - "Initialize the database for this benchmark"); - options.addOption( - null, - "clear", - true, - "Clear all records in the database for this benchmark"); - options.addOption( - null, - "load", - true, - "Load data using the benchmark's data loader"); - options.addOption( - null, - "execute", - true, - "Execute the benchmark workload"); - options.addOption( - null, - "runscript", - true, - "Run an SQL script"); - options.addOption( - null, - "upload", - true, - "Upload the result"); - options.addOption( - null, - "uploadHash", - true, - "git hash to be associated with the upload"); + options.addOption("c", "config", true, "[required] Workload configuration file"); + options.addOption(null, "create", true, "Initialize the database for this benchmark"); + options.addOption(null, "clear", true, "Clear all records in the database for this benchmark"); + options.addOption(null, "load", true, "Load data using the benchmark's data loader"); + options.addOption(null, "execute", true, "Execute the benchmark workload"); + options.addOption(null, "runscript", true, "Run an SQL script"); + options.addOption(null, "upload", true, "Upload the result"); + options.addOption(null, "uploadHash", true, "git hash to be associated with the upload"); options.addOption("v", "verbose", false, "Display Messages"); options.addOption("h", "help", false, "Print this help"); @@ -188,6 +153,7 @@ public static void main(String[] args) throws Exception { options.addOption(null, "dialects-export", true, "Export benchmark SQL to a dialects file"); options.addOption(null, "output-raw", true, "Output raw data"); options.addOption(null, "output-samples", true, "Output sample data"); + options.addOption("ea", "explain-analyze", true, "Use EXPLAIN ANALYZE for all queries"); // parse the command line arguments CommandLine argsLine = parser.parse(options, args); @@ -219,6 +185,15 @@ public static void main(String[] args) throws Exception { e.printStackTrace(); } + // Use EXPLAIN ANALYZE for all queries + Boolean isExplainAnalyze = false; + if (isBooleanOptionSet(argsLine, "explain-analyze")) { + isExplainAnalyze = true; + LOG.info("Using EXPLAIN ANALYZE for all queries"); + } else { + LOG.info("Not using EXPLAIN ANALYZE for all queries"); + } + // ------------------------------------------------------------------- // GET PLUGIN LIST // ------------------------------------------------------------------- @@ -280,6 +255,7 @@ public static void main(String[] args) throws Exception { wrkld.setScaleFactor(xmlConfig.getDouble("scalefactor", 1.0)); wrkld.setRecordAbortMessages(xmlConfig.getBoolean("recordabortmessages", false)); wrkld.setDataDir(xmlConfig.getString("datadir", ".")); + wrkld.setisExplainAnalyze(isExplainAnalyze); // microadd wrkld.setDistri(xmlConfig.getString("distribution", "rand")); @@ -330,6 +306,7 @@ public static void main(String[] args) throws Exception { initDebug.put("Distribution", wrkld.getDistri()); initDebug.put("StartNumber", wrkld.getStartNum()); initDebug.put("GapTime", wrkld.getGapTime()); + initDebug.put("isExplainAnalyze", wrkld.getisExplainAnalyze()); if (selectivity != -1) initDebug.put("Selectivity", selectivity); diff --git a/src/com/olxpbenchmark/WorkloadConfiguration.java b/src/com/olxpbenchmark/WorkloadConfiguration.java index d199250..92c00d1 100755 --- a/src/com/olxpbenchmark/WorkloadConfiguration.java +++ b/src/com/olxpbenchmark/WorkloadConfiguration.java @@ -92,6 +92,7 @@ public void setBenchmarkName(String benchmarkName) { private int loaderThreads = ThreadUtil.availableProcessors(); private int numTxnTypes; private TraceReader traceReader = null; + private boolean isExplainAnalyze = true; public TraceReader getTraceReader() { return traceReader; @@ -299,6 +300,20 @@ public String getNodeId() { return node_id; } + /* + * Return isExplainAnalyze flag + */ + public boolean getisExplainAnalyze() { + return isExplainAnalyze; + } + + /* + * Set isExplainAnalyze flag + */ + public void setisExplainAnalyze(boolean isExplainAnalyze) { + this.isExplainAnalyze = isExplainAnalyze; + } + /** * Set the scale factor for the database * A value of 1 means the default size. diff --git a/src/com/olxpbenchmark/api/Procedure.java b/src/com/olxpbenchmark/api/Procedure.java index 145b02c..67516c4 100644 --- a/src/com/olxpbenchmark/api/Procedure.java +++ b/src/com/olxpbenchmark/api/Procedure.java @@ -35,6 +35,8 @@ public abstract class Procedure { private static final Logger LOG = Logger.getLogger(Procedure.class); + protected static final String SQL_EXPLAIN_ANALYZE = "EXPLAIN ANALYZE "; + private final String procName; private DatabaseType dbType; private Map name_stmt_xref; diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/WEB3Worker.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/WEB3Worker.java index 69e0af3..2e6d635 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/WEB3Worker.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/WEB3Worker.java @@ -48,7 +48,6 @@ import com.olxpbenchmark.WorkloadConfiguration; import com.olxpbenchmark.distributions.CounterGenerator; -import com.olxpbenchmark.distributions.ZipfianGenerator; import com.olxpbenchmark.util.RandomGenerator; public class WEB3Worker extends Worker { @@ -74,7 +73,6 @@ public WEB3Worker(WEB3Benchmark benchmarkModule, int id, String distri, int numS WorkloadConfiguration workConf) throws SQLException { super(benchmarkModule, id); - // zipf = new ZipfianGenerator(100); distribution = distri; this.numScale = numScale; this.startNumber = startNum; @@ -111,10 +109,11 @@ protected long executeWork(TransactionType nextTransaction) throws UserAbortExce int startNumber = startRecord.nextInt(); String nodeid = workConf.getNodeId(); + boolean isExplainAnalyze = workConf.getisExplainAnalyze(); WEB3Procedure proc = (WEB3Procedure) this.getProcedure(nextTransaction.getProcedureClass()); if (distribution.equals("rand")) { - latency_ns = proc.run(conn, gen, this, startNumber, 0, numScale, nodeid); + latency_ns = proc.run(conn, gen, this, startNumber, 0, numScale, nodeid, isExplainAnalyze); } // else if (distribution.equals("zipf")) { // proc.run(conn, numScale, this, startNumber, 0); @@ -123,7 +122,7 @@ protected long executeWork(TransactionType nextTransaction) throws UserAbortExce // proc.run(conn, this, startNumber, 0, numScale, "poisson"); // } else if (distribution.equals("iRand")) { - latency_ns = proc.run(conn, gen, this, startNumber, upperLimit, numScale, nodeid); + latency_ns = proc.run(conn, gen, this, startNumber, upperLimit, numScale, nodeid, isExplainAnalyze); } // else if (distribution.equals("iZipf")) { // proc.run(conn, numScale, this, startNumber, upperLimit); diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R1.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R1.java index 68bd49d..108b4c1 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R1.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R1.java @@ -34,46 +34,60 @@ import java.util.Random; public class R1 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R1.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // Equality on hash in transaction table - public SQLStmt query_stmtSQL = new SQLStmt( - "/* R1 */ " - // + "explain analyze " - + "select to_address, from_address " - + "from transactions " - + "where hash = ? "); - + public String query = "" + + "select to_address, from_address " + + "from transactions " + + "where hash = ? "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters String hash = WEB3Util .convertToTxnHashString(WEB3Util.randomNumber(1, WEB3Config.configTransactionsCount * numScale, gen)); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, hash); - // Set parameter - query_stmt.setString(1, hash); // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); - if (trace) - LOG.trace("query_stmt R1 START"); + } + + if (trace) { + LOG.trace("Query" + classname + " START"); + } // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R1 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } + // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R21.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R21.java index 120457a..5693ae7 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R21.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R21.java @@ -34,48 +34,62 @@ import java.util.Random; public class R21 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R21.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // top N with small N on full table scan - public SQLStmt query_stmtSQL = new SQLStmt( - "/* R21 */ " - // + "explain analyze " - + "select * " - + "from token_transfers " - + "where from_address = ? " - + "order by block_number desc " - + "limit 5 "); + public String query = "" + + "select * " + + "from token_transfers " + + "where from_address = ? " + + "order by block_number desc " + + "limit 5 "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters String from_address = WEB3Util .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, from_address); - // Set parameter - query_stmt.setString(1, from_address); // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); - if (trace) - LOG.trace("query_stmt R21 START"); + } + + if (trace) { + LOG.trace("Query" + classname + " START"); + } // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R21 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R22.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R22.java index 75f918f..b47a1a9 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R22.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R22.java @@ -34,46 +34,60 @@ import java.util.Random; public class R22 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R22.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // Aggregation with no group by on a small range - public SQLStmt query_stmtSQL = new SQLStmt( - "/* R22 */ " - // + "explain analyze " - + "select count(*) " - + "from token_transfers " - + "where token_address = ? "); + public String query = "" + + "select count(*) " + + "from token_transfers " + + "where token_address = ? "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters String token_address = WEB3Util .convertToTokenAddressString(WEB3Util.randomNumber(1, WEB3Config.configTokenCount, gen)); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, token_address); - // Set parameter - query_stmt.setString(1, token_address); // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); - if (trace) - LOG.trace("query_stmt R22 START"); + } + + if (trace) { + LOG.trace("Query" + classname + " START"); + } // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R22 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R23.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R23.java index ae632a9..47f52c8 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R23.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R23.java @@ -34,54 +34,67 @@ import java.util.Random; public class R23 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R23.class); - public SQLStmt query_stmtSQL = new SQLStmt( - "/* R23 */ " - // + "explain analyze " - + "select * " - + "from token_transfers " - + "where token_address = ? " - + "and block_number <= ? " - + "and (next_block_number > ? or next_block_number = ?) " - + "order by block_number desc " - + "limit ?"); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; + public String query = "" + + "select * " + + "from token_transfers " + + "where token_address = ? " + + "and block_number <= ? " + + "and (next_block_number > ? or next_block_number = ?) " + + "order by block_number desc " + + "limit ?"; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters String token_address = WEB3Util .convertToTokenAddressString(WEB3Util.randomNumber(1, WEB3Config.configTokenCount, gen)); long block_number = WEB3Util.randomNumber(1, numScale * WEB3Config.configBlocksCount, gen); long next_block_number = WEB3Util.randomNumber(1, block_number, gen); int limit = WEB3Util.randomNumber(1, 100, gen); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, token_address, block_number, next_block_number, + next_block_number, limit); - query_stmt.setString(1, token_address); - query_stmt.setLong(2, block_number); - query_stmt.setLong(3, next_block_number); - query_stmt.setLong(4, next_block_number); - query_stmt.setInt(5, limit); // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); - if (trace) - LOG.trace("query_stmt R23 START"); + } + + if (trace) { + LOG.trace("Query" + classname + " START"); + } + // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R23 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R24.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R24.java index 182183e..b136469 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R24.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R24.java @@ -34,52 +34,64 @@ import java.util.Random; public class R24 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R24.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // List of transactions excluding some black listed ones. - public SQLStmt query_to_address_SQL = new SQLStmt( - "/* R24 */ " - // + "explain analyze " - + "select count(*) " - + "from transactions " - + "where to_address not in (?, ?, ?) "); + public String query = "" + + "select count(*) " + + "from transactions " + + "where to_address not in (?, ?, ?) "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_to_address_SQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters String to_address1 = WEB3Util .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); String to_address2 = WEB3Util .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); String to_address3 = WEB3Util .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, to_address1, to_address2, to_address3); - // Set parameter - query_stmt.setString(1, to_address1); - query_stmt.setString(2, to_address2); - query_stmt.setString(3, to_address3); // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); - if (trace) - LOG.trace("query_stmt R24 START"); + } + + if (trace) { + LOG.trace("Query" + classname + " START"); + } // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R24 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R25.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R25.java index cb04474..8a25707 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R25.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R25.java @@ -34,42 +34,59 @@ import java.util.Random; public class R25 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R25.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // Constraint checking that next_block_number <= block_number in token_transfers // Query result should be empty. - public SQLStmt query_SQL = new SQLStmt( - "/* R25 */ " - // + "explain analyze " - + "select count(*) " - + "from token_transfers " - + "where next_block_number <= block_number " - + "group by next_block_number "); + public String query = "" + + "select count(*) " + + "from token_transfers " + + "where next_block_number <= block_number " + + "group by next_block_number "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_SQL); + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL); + // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); - if (trace) - LOG.trace("query_stmt R25 START"); + } + + if (trace) { + LOG.trace("Query" + classname + " START"); + } // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R25 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R31.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R31.java index 1fcd9fe..8d96ee8 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R31.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R31.java @@ -34,49 +34,64 @@ import java.util.Random; public class R31 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R31.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // For a specific person, find transactions where this person is either a sender // or receiver. Limit the result by the most recent timestamp. - public SQLStmt query_stmtSQL = new SQLStmt( - "/* R31 */ " - // + "explain analyze " - + "select * " - + "from transactions " - + "where from_address = ? or to_address = ? " - + "order by block_timestamp desc " - + "limit 10"); + public String query = "" + + "select * " + + "from transactions " + + "where from_address = ? or to_address = ? " + + "order by block_timestamp desc " + + "limit 10"; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters String from_address = WEB3Util .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); String to_address = from_address; // one person + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, from_address, to_address); - query_stmt.setString(1, from_address); - query_stmt.setString(2, to_address); // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); - if (trace) - LOG.trace("query_stmt R31 START"); + } + + if (trace) { + LOG.trace("Query" + classname + " START"); + } + // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R31 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R32.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R32.java index 81d307d..c0fafa3 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R32.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R32.java @@ -34,41 +34,58 @@ import java.util.Random; public class R32 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R32.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // Top N transactions based on block timestamp. - public SQLStmt query_stmtSQL = new SQLStmt( - "/* R32 */ " - // + "explain analyze " - + "select * " - + "from transactions " - + "order by block_timestamp desc " - + "limit 100"); + public String query = "" + + "select * " + + "from transactions " + + "order by block_timestamp desc " + + "limit 100"; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing prepared statements + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters query_stmt = this.getPreparedStatement(conn, query_stmtSQL); + // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); + } - if (trace) - LOG.trace("query_stmt R32 START"); + if (trace) { + LOG.trace("Query" + classname + " START"); + } + // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R32 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R33.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R33.java index 1198584..2766960 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R33.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R33.java @@ -34,38 +34,56 @@ import java.util.Random; public class R33 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R33.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // Find the number of unique senders (from\_address) in transactions - public SQLStmt query_stmtSQL = new SQLStmt( - "/* R33 */ " - // + "explain analyze " - + "select count(distinct from_address) " - + "from transactions "); + public String query = "" + + "select count(distinct from_address) " + + "from transactions "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing prepared statements + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters query_stmt = this.getPreparedStatement(conn, query_stmtSQL); + // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); - if (trace) - LOG.trace("query_stmt R33 START"); + } + + if (trace) { + LOG.trace("Query" + classname + " START"); + } + // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R33 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R34.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R34.java index 74fb5cb..6adc8f9 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R34.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R34.java @@ -34,45 +34,63 @@ import java.util.Random; public class R34 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R34.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // Find top N senders (from\_address) by total transaction value - public SQLStmt query_stmtSQL = new SQLStmt( - "/* R34 */ " - // + "explain analyze " - + "select " - + "sum(value) as totalamount, " - + "count(value) as transactioncount, " - + "from_address as fromaddress " - + "from transactions " - + "group by from_address " - + "order by sum(value) desc " - + "limit 10 "); + public String query = "" + + "select " + + "sum(value) as totalamount, " + + "count(value) as transactioncount, " + + "from_address as fromaddress " + + "from transactions " + + "group by from_address " + + "order by sum(value) desc " + + "limit 10 "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); // initializing prepared statements + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters query_stmt = this.getPreparedStatement(conn, query_stmtSQL); + // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); + } - if (trace) - LOG.trace("query_stmt R34 START"); + if (trace) { + LOG.trace("Query" + classname + " START"); + } + // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R34 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R35.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R35.java index a4bc10e..b0953a8 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R35.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/R35.java @@ -34,55 +34,71 @@ import java.util.Random; public class R35 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(R35.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // Total count of token transfers for a specific sender and token transfers for // recipients who are also senders in other transactions. - public SQLStmt query_stmtSQL = new SQLStmt( - "/* R35 */ " - // + "explain analyze " - + "select count(*) as count " - + "from " - + "( " - + "select * " - + "from token_transfers t " - + "where from_address = ? " - + "union all " - + "select t2.* " - + "from token_transfers t2 " - + "inner join token_transfers t on t2.from_address = t.to_address " - + "and t.value < t2.value " - + ") as temp "); + public String query = "" + + "select count(*) as count " + + "from " + + "( " + + "select * " + + "from token_transfers t " + + "where from_address = ? " + + "union all " + + "select t2.* " + + "from token_transfers t2 " + + "inner join token_transfers t on t2.from_address = t.to_address " + + "and t.value < t2.value " + + ") as temp "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); // initializing prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters String from_address = WEB3Util .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, from_address); - query_stmt.setString(1, from_address); // Log query - if (LOG.isDebugEnabled()) + if (debug) { LOG.debug(queryToString(query_stmt)); + } - if (trace) - LOG.trace("query_stmt R35 START"); + if (trace) { + LOG.trace("Query" + classname + " START"); + } + // Execute query and commit ResultSet rs = query_stmt.executeQuery(); conn.commit(); - if (trace) - LOG.trace("query_stmt R35 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } // Log result - if (trace) + if (trace) { LOG.trace(resultSetToString(rs)); + } - // long latency_ns = getTimeFromRS(rs); + // Close result set rs.close(); return 0; } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W11.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W11.java index 33252d4..fc3dc05 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W11.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W11.java @@ -32,26 +32,28 @@ import com.olxpbenchmark.benchmarks.web3benchmark.WEB3Worker; public class W11 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(W11.class); - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W11 */ " - // + "explain analyze " - + "insert into blocks " - + "values " - + "(?, ?, ?, ?, ?," - + " ?, ?, ?, ?, ?," - + " ?, ?, ?, ?, ?," - + " ?, ?, ?)"); - + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; + public String query = "" + + "insert into blocks " + + "values " + + "(?, ?, ?, ?, ?," + + " ?, ?, ?, ?, ?," + + " ?, ?, ?, ?, ?," + + " ?, ?, ?)"; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters query_stmt = this.getPreparedStatement(conn, query_stmtSQL); long number = numScale * WEB3Config.configBlocksCount + startNumber; @@ -93,20 +95,41 @@ public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int query_stmt.setLong(idx++, transaction_count); query_stmt.setLong(idx++, base_fee_per_gas); - if (LOG.isDebugEnabled()) { + // Log query + if (debug) { LOG.debug(queryToString(query_stmt)); } - if (trace) - LOG.trace("query_stmt W11 InsertBlocks START"); - // int affectedRows = query_stmt.executeUpdate(); - query_stmt.executeUpdate(); + if (trace) { + LOG.trace("Query" + classname + " START"); + } + int affectedRows = 0; // Number of rows affected + ResultSet rs = null; + // Execute query and commit + if (isExplainAnalyze) { + // Use executeQuery for explain analyze + rs = query_stmt.executeQuery(); + } else { + // Use executeUpdate for normal query + affectedRows = query_stmt.executeUpdate(); + } conn.commit(); - if (trace) - LOG.trace("query_stmt W11 InsertBlocks END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } else { + if (debug) { + LOG.debug("Affected Rows: " + affectedRows); + } + } - // long latency_ns = getTimeFromRS(rs); - // rs.close(); return 0; } } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W12.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W12.java index 9dd9ea4..ff76b47 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W12.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W12.java @@ -32,22 +32,24 @@ import com.olxpbenchmark.benchmarks.web3benchmark.WEB3Worker; public class W12 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(W12.class); - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W12 */ " - // + "explain analyze " - + "insert into contracts " - + "values (?, ?, ?, ?, ?, ?) "); - + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; + public String query = "" + + "insert into contracts " + + "values (?, ?, ?, ?, ?, ?) "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters query_stmt = this.getPreparedStatement(conn, query_stmtSQL); String address = WEB3Util @@ -66,20 +68,41 @@ public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int query_stmt.setBoolean(idx++, is_erc721); query_stmt.setLong(idx++, block_number); - if (LOG.isDebugEnabled()) { + // Log query + if (debug) { LOG.debug(queryToString(query_stmt)); } - if (trace) - LOG.trace("query_stmt W12 InsertContracts START"); - // int affectedRows = query_stmt.executeUpdate(); - query_stmt.executeUpdate(); + if (trace) { + LOG.trace("Query" + classname + " START"); + } + int affectedRows = 0; // Number of rows affected + ResultSet rs = null; + // Execute query and commit + if (isExplainAnalyze) { + // Use executeQuery for explain analyze + rs = query_stmt.executeQuery(); + } else { + // Use executeUpdate for normal query + affectedRows = query_stmt.executeUpdate(); + } conn.commit(); - if (trace) - LOG.trace("query_stmt W12 InsertContracts END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } else { + if (debug) { + LOG.debug("Affected Rows: " + affectedRows); + } + } - // long latency_ns = getTimeFromRS(rs); - // rs.close(); return 0; } } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W13.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W13.java index 36cc03f..11764c6 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W13.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W13.java @@ -32,26 +32,28 @@ import com.olxpbenchmark.benchmarks.web3benchmark.WEB3Worker; public class W13 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(W13.class); - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W13 */ " - // + "explain analyze " - + "insert into transactions " - + "values " - + "(?, ?, ?, ?, ?," - + " ?, ?, ?, ?, ?," - + " ?, ?, ?, ?, ?," - + " ?, ?, ?, ?, ?)"); - + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; + public String query = "" + + "insert into transactions " + + "values " + + "(?, ?, ?, ?, ?," + + " ?, ?, ?, ?, ?," + + " ?, ?, ?, ?, ?," + + " ?, ?, ?, ?, ?)"; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters query_stmt = this.getPreparedStatement(conn, query_stmtSQL); String hash = WEB3Util.convertToTxnHashString(startNumber, nodeid + "-W13"); @@ -100,20 +102,41 @@ public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int query_stmt.setLong(idx++, max_priority_fee_per_gas); query_stmt.setLong(idx++, transaction_type); - if (LOG.isDebugEnabled()) { + // Log query + if (debug) { LOG.debug(queryToString(query_stmt)); } - if (trace) - LOG.trace("query_stmt W13 InsertTransactions START"); - // int affectedRows = query_stmt.executeUpdate(); - query_stmt.executeUpdate(); + if (trace) { + LOG.trace("Query" + classname + " START"); + } + int affectedRows = 0; // Number of rows affected + ResultSet rs = null; + // Execute query and commit + if (isExplainAnalyze) { + // Use executeQuery for explain analyze + rs = query_stmt.executeQuery(); + } else { + // Use executeUpdate for normal query + affectedRows = query_stmt.executeUpdate(); + } conn.commit(); - if (trace) - LOG.trace("query_stmt W13 InsertTransactions END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } else { + if (debug) { + LOG.debug("Affected Rows: " + affectedRows); + } + } - // long latency_ns = getTimeFromRS(rs); - // rs.close(); return 0; } } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W14.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W14.java index 77ad8a1..a87d29c 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W14.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W14.java @@ -32,64 +32,87 @@ import com.olxpbenchmark.benchmarks.web3benchmark.WEB3Worker; public class W14 extends WEB3Procedure { + private static final Logger LOG = Logger.getLogger(W14.class); + + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; + public String query = "" + + "insert into token_transfers " + + "values " + + "(?, ?, ?, ?, ?, ?, ?)"; + private PreparedStatement query_stmt = null; + + public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); + boolean trace = LOG.isTraceEnabled(); + + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL); + + String token_address = WEB3Util + .convertToTokenAddressString( + WEB3Util.randomNumber(1, WEB3Config.configTokenCount, gen)); + String from_address = WEB3Util + .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); + String to_address = WEB3Util + .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); + double value = (double) WEB3Util.randomNumber(0, 1000000, gen); + int transaction_hash_number = WEB3Util.randomNumber(1, numScale * WEB3Config.configTransactionsCount, + gen); + // make sure the startNumber is even, to avoid foreign key conflicts with W6 + transaction_hash_number = transaction_hash_number - (transaction_hash_number % 2); + String transaction_hash = WEB3Util.convertToTxnHashString(transaction_hash_number); + long block_number = WEB3Util.randomNumber(1, numScale * WEB3Config.configBlocksCount, gen); + long next_block_number = block_number + 1; + + int idx = 1; + query_stmt.setString(idx++, token_address); + query_stmt.setString(idx++, from_address); + query_stmt.setString(idx++, to_address); + query_stmt.setDouble(idx++, value); + query_stmt.setString(idx++, transaction_hash); + query_stmt.setLong(idx++, block_number); + query_stmt.setLong(idx++, next_block_number); + + // Log query + if (debug) { + LOG.debug(queryToString(query_stmt)); + } + + if (trace) { + LOG.trace("Query" + classname + " START"); + } + int affectedRows = 0; // Number of rows affected + ResultSet rs = null; + // Execute query and commit + if (isExplainAnalyze) { + // Use executeQuery for explain analyze + rs = query_stmt.executeQuery(); + } else { + // Use executeUpdate for normal query + affectedRows = query_stmt.executeUpdate(); + } + conn.commit(); + if (trace) { + LOG.trace("Query" + classname + " END"); + } - private static final Logger LOG = Logger.getLogger(W14.class); - - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W14 */ " - // + "explain analyze " - + "insert into token_transfers " - + "values " - + "(?, ?, ?, ?, ?, ?, ?)"); - - private PreparedStatement query_stmt = null; - - public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { - boolean trace = LOG.isTraceEnabled(); - - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - - String token_address = WEB3Util - .convertToTokenAddressString( - WEB3Util.randomNumber(1, WEB3Config.configTokenCount, gen)); - String from_address = WEB3Util - .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); - String to_address = WEB3Util - .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); - double value = (double) WEB3Util.randomNumber(0, 1000000, gen); - int transaction_hash_number = WEB3Util.randomNumber(1, numScale * WEB3Config.configTransactionsCount, - gen); - // make sure the startNumber is even, to avoid foreign key conflicts with W6 - transaction_hash_number = transaction_hash_number - (transaction_hash_number % 2); - String transaction_hash = WEB3Util.convertToTxnHashString(transaction_hash_number); - long block_number = WEB3Util.randomNumber(1, numScale * WEB3Config.configBlocksCount, gen); - long next_block_number = block_number + 1; - - int idx = 1; - query_stmt.setString(idx++, token_address); - query_stmt.setString(idx++, from_address); - query_stmt.setString(idx++, to_address); - query_stmt.setDouble(idx++, value); - query_stmt.setString(idx++, transaction_hash); - query_stmt.setLong(idx++, block_number); - query_stmt.setLong(idx++, next_block_number); - - if (LOG.isDebugEnabled()) { - LOG.debug(queryToString(query_stmt)); - } - - if (trace) - LOG.trace("query_stmt W14 InsertTokenTransfers START"); - // int affectedRows = query_stmt.executeUpdate(); - query_stmt.executeUpdate(); - conn.commit(); - if (trace) - LOG.trace("query_stmt W14 InsertTokenTransfers END"); - - // long latency_ns = getTimeFromRS(rs); - // rs.close(); - return 0; + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } else { + if (debug) { + LOG.debug("Affected Rows: " + affectedRows); + } } + + return 0; + } } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W2.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W2.java index eddc18e..b6bcb19 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W2.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W2.java @@ -33,28 +33,30 @@ import com.olxpbenchmark.benchmarks.web3benchmark.WEB3Worker; public class W2 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(W2.class); - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W2 */ " - // + "explain analyze " - + "insert into transactions " - + "values " - // Java 11 - // + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), ".repeat(99) - // Java 7 - + new String(new char[99]).replace("\0", - "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), ") - + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); - + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; + public String query = "" + + "insert into transactions " + + "values " + // Java 11 + // + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), ".repeat(99) + // Java 7 + + new String(new char[99]).replace("\0", + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), ") + + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters query_stmt = this.getPreparedStatement(conn, query_stmtSQL); // Small batch inserts (100 rows) for the transaction table. @@ -108,21 +110,41 @@ public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int query_stmt.setLong(idx++, transaction_type); } - // Log query and affected rows - if (LOG.isDebugEnabled()) { + // Log query + if (debug) { LOG.debug(queryToString(query_stmt)); - // LOG.debug("Result: " + resultSetToString(rs)); } - if (trace) - LOG.trace("query_stmt W2 RangeInsertTransactions START"); - query_stmt.executeUpdate(); + if (trace) { + LOG.trace("Query" + classname + " START"); + } + int[] affectedRows = null; // Number of rows affected + ResultSet rs = null; + // Execute query and commit + if (isExplainAnalyze) { + // Use executeQuery for explain analyze + rs = query_stmt.executeQuery(); + } else { + // Use executeUpdate/Batch for normal queries + affectedRows = query_stmt.executeBatch(); + } conn.commit(); - if (trace) - LOG.trace("query_stmt W2 RangeInsertTransactions END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } else { + if (debug) { + LOG.debug("Affected Rows: " + affectedRows.length); + } + } - // long latency_ns = getTimeFromRS(rs); - // rs.close(); return 0; } } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W3.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W3.java index 8402fc3..8d86005 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W3.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W3.java @@ -31,39 +31,62 @@ import com.olxpbenchmark.benchmarks.web3benchmark.WEB3Worker; public class W3 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(W3.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // Insert 1000 rows into transactions from a temp table - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W3 */ " - // + "explain analyze " - + "insert transactions " - + "select * from temp_table limit 1000 "); - + public String query = "" + + "insert transactions " + + "select * from temp_table limit 1000 "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - if (LOG.isDebugEnabled()) { + // Log query + if (debug) { LOG.debug(queryToString(query_stmt)); } - if (trace) - LOG.trace("query_stmt W3 InsertSelect START"); - // int affectedRows = query_stmt.executeUpdate(); - query_stmt.executeUpdate(); + if (trace) { + LOG.trace("Query" + classname + " START"); + } + int affectedRows = 0; // Number of rows affected + ResultSet rs = null; + // Execute query and commit + if (isExplainAnalyze) { + // Use executeQuery for explain analyze + rs = query_stmt.executeQuery(); + } else { + // Use executeUpdate for normal query + affectedRows = query_stmt.executeUpdate(); + } conn.commit(); - if (trace) - LOG.trace("query_stmt W3 InsertSelect END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } else { + if (debug) { + LOG.debug("Affected Rows: " + affectedRows); + } + } - // long latency_ns = getTimeFromRS(rs); - // rs.close(); return 0; } } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W4.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W4.java index 1e5bc2e..7e19005 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W4.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W4.java @@ -35,44 +35,66 @@ import java.util.List; public class W4 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(W4.class); - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W4 */ " - // + "explain analyze " - + "update transactions " - + "set gas_price = ? " - + "where hash = ? "); - + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; + public String query = "" + + "update transactions " + + "set gas_price = ? " + + "where hash = ? "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters long gas_price = WEB3Util.randomNumber(1000, 10000000, gen); String hash = WEB3Util .convertToTxnHashString(WEB3Util.randomNumber(1, WEB3Config.configTransactionsCount * numScale, gen)); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, gas_price, hash); - query_stmt.setLong(1, gas_price); - query_stmt.setString(2, hash); - if (LOG.isDebugEnabled()) { + // Log query + if (debug) { LOG.debug(queryToString(query_stmt)); } - if (trace) - LOG.trace("query_stmt W4 UpdateQuery1 START"); - // int affectedRows = query_stmt.executeUpdate(); - query_stmt.executeUpdate(); + + if (trace) { + LOG.trace("Query" + classname + " START"); + } + int affectedRows = 0; // Number of rows affected + ResultSet rs = null; + // Execute query and commit + if (isExplainAnalyze) { + // Use executeQuery for explain analyze + rs = query_stmt.executeQuery(); + } else { + // Use executeUpdate for normal query + affectedRows = query_stmt.executeUpdate(); + } conn.commit(); - if (trace) - LOG.trace("query_stmt W4 UpdateQuery1 END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } else { + if (debug) { + LOG.debug("Affected Rows: " + affectedRows); + } + } - // long latency_ns = getTimeFromRS(rs); - // rs.close(); return 0; } } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W51.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W51.java index 4634c1d..7c99ad6 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W51.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W51.java @@ -31,27 +31,29 @@ import com.olxpbenchmark.benchmarks.web3benchmark.WEB3Worker; public class W51 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(W51.class); - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W51 */ " - // + "explain analyze " - + "update token_transfers " - + "set value = ? " - + "where to_address = from_address "); - + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; + public String query = "" + + "update token_transfers " + + "set value = ? " + + "where to_address = from_address "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters double value = (double) WEB3Util.randomNumber(0, 1000000, gen); - query_stmt.setDouble(1, value); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, value); + if (LOG.isDebugEnabled()) { LOG.debug(queryToString(query_stmt)); } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W52.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W52.java index e1b0a84..c7c27c2 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W52.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W52.java @@ -31,24 +31,26 @@ import com.olxpbenchmark.benchmarks.web3benchmark.WEB3Worker; public class W52 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(W52.class); - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W52 */ " - // + "explain analyze " - + "update token_transfers " - + "set value = value + 1 " - + "where from_address in " - + "(select to_address from token_transfers) "); - + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; + public String query = "" + + "update token_transfers " + + "set value = value + 1 " + + "where from_address in " + + "(select to_address from token_transfers) "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Create statement and set parameters query_stmt = this.getPreparedStatement(conn, query_stmtSQL); if (LOG.isDebugEnabled()) { LOG.debug(queryToString(query_stmt)); diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W6.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W6.java index f7f401e..6ff7687 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W6.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W6.java @@ -32,44 +32,66 @@ import com.olxpbenchmark.benchmarks.web3benchmark.WEB3Worker; public class W6 extends WEB3Procedure { - private static final Logger LOG = Logger.getLogger(W6.class); + public String classname = this.getClass().getSimpleName(); + public String classname_note = "/* " + classname + " */ "; // Single record deletes for the transaction table. - public SQLStmt query_stmtSQL = new SQLStmt( - "/* W6 */ " - // + "explain analyze " - + "delete from transactions " - + "where hash = ? "); - + public String query = "" + + "delete from transactions " + + "where hash = ? "; private PreparedStatement query_stmt = null; public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, int numScale, - String nodeid) throws SQLException { + String nodeid, boolean isExplainAnalyze) throws SQLException { + boolean debug = LOG.isDebugEnabled(); boolean trace = LOG.isTraceEnabled(); - // initializing all prepared statements - query_stmt = this.getPreparedStatement(conn, query_stmtSQL); - + // Prepare statement + SQLStmt query_stmtSQL = new SQLStmt( + classname_note + (isExplainAnalyze ? SQL_EXPLAIN_ANALYZE : "") + query); + // Parameters // make sure the startNumber is odd, to avoid foreign key conflicts with W14 startNumber = startNumber - (startNumber % 2) + 1; String hash = WEB3Util.convertToTxnHashString(startNumber % (WEB3Config.configTransactionsCount * numScale)); + // Create statement and set parameters + query_stmt = this.getPreparedStatement(conn, query_stmtSQL, hash); - // Setting the parameters for the query - query_stmt.setString(1, hash); - if (LOG.isDebugEnabled()) { + // Log query + if (debug) { LOG.debug(queryToString(query_stmt)); } - if (trace) - LOG.trace("query_stmt W6 single record deletes for the transaction table START"); - // int affectedRows = query_stmt.executeUpdate(); - query_stmt.executeUpdate(); + + if (trace) { + LOG.trace("Query" + classname + " START"); + } + int affectedRows = 0; // Number of rows affected + ResultSet rs = null; + // Execute query and commit + if (isExplainAnalyze) { + // Use executeQuery for explain analyze + rs = query_stmt.executeQuery(); + } else { + // Use executeUpdate for normal query + affectedRows = query_stmt.executeUpdate(); + } conn.commit(); - if (trace) - LOG.trace("query_stmt W6 single record deletes for the transaction table END"); + if (trace) { + LOG.trace("Query" + classname + " END"); + } + + if (isExplainAnalyze) { + // If explain analyze, then return the latency + // Get the latency from the result set + long latency_ns = getTimeFromRS(rs); + rs.close(); + return latency_ns; + } else { + if (debug) { + LOG.debug("Affected Rows: " + affectedRows); + } + } - // long latency_ns = getTimeFromRS(rs); - // rs.close(); return 0; } } diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/WEB3Procedure.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/WEB3Procedure.java index 987a61e..07a1957 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/WEB3Procedure.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/WEB3Procedure.java @@ -51,7 +51,7 @@ public abstract class WEB3Procedure extends Procedure { // rand and iRand public abstract long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int upperLimit, - int numScale, String nodeid) throws SQLException; + int numScale, String nodeid, boolean isExplainAnalyze) throws SQLException; protected String queryToString(PreparedStatement query) { return query.toString().split(":")[1].trim();