-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHOENIX-7528 Add metrics for overall wall clock query wait time in Phoenix client thread pool and total time spent in executing HBase scan tasks #2077
base: master
Are you sure you want to change the base?
Conversation
long vpk3 = 1000; | ||
try(Connection conn = DriverManager.getConnection(getUrl())) { | ||
PreparedStatement stmt = conn.prepareStatement(upsertRows); | ||
stmt.execute(creatTableDdl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a slightly weird pattern. Creating a table with a PreparedStatement for upsert rows. Generally, we just do conn.createStatement().execute(ddl)
SecurityException, IllegalArgumentException, IllegalAccessException { | ||
private void changeInternalStateForTesting(PhoenixResultSet rs, | ||
ReadMetricQueue testMetricsQueue) throws | ||
NoSuchFieldException, SecurityException, IllegalArgumentException, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just change it to throws Exception
@@ -1298,5 +1301,225 @@ public Connection call() throws Exception { | |||
} | |||
} | |||
|
|||
@Test | |||
public void testPhoenixClientQueueWaitTimeAndEndToEndTime() throws SQLException, | |||
NoSuchFieldException, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just change it to throws Exception
} | ||
getRows += ")"; | ||
final String upsertRows = "UPSERT INTO " + tableName + " VALUES(?, ?, ?, ?, ?, ?)"; | ||
String creatTableDdl = "CREATE TABLE IF NOT EXISTS " + tableName + " (\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally we put the table schema first and then the upsert statements and the select statements. This makes it easy to understand the code.
int[] taskQueueWaitTime = {10, 5, 20, 7}; | ||
int[] taskEndToEndTime = {20, 15, 41, 16}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass these as parameters in the constructor
Summary of the change:
JobCallable
inRoundRobinResultItr.
when submitting next batches of scans as scanner cache of previous batches of scan has been exhausted. By using JobCallable we can track total wall clock time spent by a query waiting in Phoenix client thread pool queue along with total wall clock time spent in executing tasks (end to end).