You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "xtern (via GitHub)" <gi...@apache.org> on 2023/05/30 14:58:53 UTC

[GitHub] [ignite-3] xtern commented on a diff in pull request #2108: IGNITE-19575 Extend jmh benchmarks to compare thin clients against its embedded counterparts

xtern commented on code in PR #2108:
URL: https://github.com/apache/ignite-3/pull/2108#discussion_r1210356488


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/InsertBenchmark.java:
##########
@@ -136,7 +159,54 @@ void executeQuery() {
     }
 
     /**
-     * Benchmark state for {@link #jdbcInsert(JdbcState)}. Holds {@link Connection} and {@link PreparedStatement}.
+     * Benchmark state for {@link #sqlThinInsert(SqlThinState)}.
+     *
+     * <p>Holds {@link Session}, {@link IgniteClient}, and {@link Statement}.
+     */
+    @State(Scope.Benchmark)
+    public static class SqlThinState {
+        private IgniteClient client;
+        private Statement statement;
+        private Session session;
+
+        /**
+         * Initializes session and statement.
+         */
+        @Setup
+        public void setUp() {
+            String fieldsQ = IntStream.range(1, 11).mapToObj(i -> "field" + i).collect(joining(","));
+            String valQ = IntStream.range(1, 11).mapToObj(i -> "'" + FIELD_VAL + "'").collect(joining(","));
+
+            String queryStr = String.format("insert into %s(%s, %s) values(?, %s);", TABLE_NAME, "ycsb_key", fieldsQ, valQ);

Review Comment:
   These 3 lines are duplicated in each "sql/jdbc" state, maybe it's worth separating query generation into a separate static method or string constant?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org