tkhurana commented on code in PR #2077: URL: https://github.com/apache/phoenix/pull/2077#discussion_r1996451259
########## phoenix-core/src/it/java/org/apache/phoenix/monitoring/PhoenixMetricsIT.java: ########## @@ -1298,5 +1301,225 @@ public Connection call() throws Exception { } } + @Test + public void testPhoenixClientQueueWaitTimeAndEndToEndTime() throws SQLException, + NoSuchFieldException, + IllegalAccessException { + int saltBucketNum = 8; + String tableName = generateUniqueName(); + String getRows = "SELECT COL1, COL2, PK4, PK2, PK3 FROM " + tableName + + " WHERE PK1=? AND PK2=? AND PK3=? AND PK4 IN (?"; + // Send at least 4 tasks in Phoenix client thread pool and we will assert also on this + // later while actually querying data. + int taskCount = 4; + for (int i = 1; i < taskCount; i++) { + getRows += ", ?"; + } + getRows += ")"; + final String upsertRows = "UPSERT INTO " + tableName + " VALUES(?, ?, ?, ?, ?, ?)"; + String creatTableDdl = "CREATE TABLE IF NOT EXISTS " + tableName + " (\n" + + " PK1 CHAR(15) NOT NULL,\n" + + " PK2 CHAR(15) NOT NULL,\n" + + " PK3 DECIMAL NOT NULL,\n" + + " PK4 CHAR(32) NOT NULL,\n" + + " COL1 VARCHAR NOT NULL,\n" + + " COL2 VARCHAR NOT NULL,\n" + + " CONSTRAINT PK PRIMARY KEY (\n" + + " PK1,\n" + + " PK2,\n" + + " PK3,\n" + + " PK4\n" + + " )\n" + + ") MULTI_TENANT=true, IMMUTABLE_ROWS=TRUE, SALT_BUCKETS=" + saltBucketNum; + long vpk3 = 1000; + try(Connection conn = DriverManager.getConnection(getUrl())) { + PreparedStatement stmt = conn.prepareStatement(upsertRows); + stmt.execute(creatTableDdl); Review Comment: This is a slightly weird pattern. Creating a table with a PreparedStatement for upsert rows. Generally, we just do `conn.createStatement().execute(ddl)` -- 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: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org