Hello,
I am trying to collect some metrics on certain queries. Here is the code
that I have

Properties props = new Properties();
props.setProperty(QueryServices.COLLECT_REQUEST_LEVEL_METRICS, "true");
props.setProperty("phoenix.trace.frequency", "always");

try (Connection conn = DriverManager.getConnection(url, props)) {
    conn.setAutoCommit(true);

    PreparedStatement stmt = conn.prepareStatement(query);

    Map<org.apache.phoenix.monitoring.MetricType, Long>
overAllQueryMetrics = null;
    Map<String, Map<org.apache.phoenix.monitoring.MetricType, Long>>
requestReadMetrics = null;
    try (ResultSet rs = stmt.executeQuery()) {
        rs.next();
        requestReadMetrics = PhoenixRuntime.getRequestReadMetricInfo(rs);
        // log or report metrics as needed
        PhoenixRuntime.resetMetrics(rs);
        rs.close();
    }
}


However, rs.next() throws the following error
java.sql.SQLException: does not implement 'class
org.apache.phoenix.jdbc.PhoenixResultSet'

I am not sure why the error is happening. Are metrics not supported with
thin client?

If not how do I get query level metrics?

Thanks

Reply via email to